diff --git a/assets/converters.py b/assets/converters.py index 6108a85..5988531 100644 --- a/assets/converters.py +++ b/assets/converters.py @@ -324,10 +324,15 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax): structData += fxconv.u32(0) structData += fxconv.u32(0) else: + o_xdata = fxconv.Structure() + o_xdata += xdata + o_ydata = fxconv.Structure() + o_ydata += ydata + structData += fxconv.u32(path) structData += fxconv.u32(path_length) - structData += fxconv.ptr( xdata ) - structData += fxconv.ptr( ydata ) + structData += fxconv.ptr(o_xdata) + structData += fxconv.ptr(o_ydata) #else we do nothing (yet) else: diff --git a/src/npc.c b/src/npc.c index b4ce57b..d316a52 100644 --- a/src/npc.c +++ b/src/npc.c @@ -39,12 +39,12 @@ void npc_draw(Game *game) { { - int16_t deltaX1=((int16_t) (Data->xpath[v % NbPoints] * PXSIZE))-(int16_t) player->wx; - int16_t deltaY1=((int16_t) (Data->ypath[v % NbPoints] * PXSIZE))-(int16_t) player->wy; + int16_t deltaX1=((int16_t) (Data->x + Data->xpath[v % NbPoints]) * PXSIZE)-(int16_t) player->wx; + int16_t deltaY1=((int16_t) (Data->x + Data->ypath[v % NbPoints]) * PXSIZE)-(int16_t) player->wy; /*DEBUG*/ dprint(0, 0, 0xFAFA, "coucou 43 : %d", v); dupdate(); getkey(); //plante avant ici (le v % NbPoints est sus) - int16_t deltaX2=((int16_t) (Data->xpath[(v+1) % NbPoints] * PXSIZE))-(int16_t) player->wx; - int16_t deltaY2=((int16_t) (Data->ypath[(v+1) % NbPoints] * PXSIZE))-(int16_t) player->wy; + int16_t deltaX2=((int16_t) (Data->x + Data->xpath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wx; + int16_t deltaY2=((int16_t) (Data->x + Data->ypath[(v+1) % NbPoints]) * PXSIZE)-(int16_t) player->wy; dline( player->px + deltaX1, player->py + deltaY1, player->px + deltaX2, player->py + deltaY2,