diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 300a1212e..7094d3b94 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -757,9 +757,9 @@ void movecrane(DDukeActor *actor, int crane) { if (actor->spr.xvel < 192) actor->spr.xvel += 8; - actor->spr.ang = getangle(cpt.x - actor->spr.pos.X, cpt.y - actor->spr.pos.Y); + actor->spr.ang = getangle(cpt.pos.X - actor->spr.pos.X, cpt.y - actor->spr.pos.Y); ssp(actor, CLIPMASK0); - if (((actor->spr.pos.X - cpt.x) * (actor->spr.pos.X - cpt.x) + (actor->spr.pos.Y - cpt.y) * (actor->spr.pos.Y - cpt.y)) < (128 * 128)) + if (((actor->spr.pos.X - cpt.pos.X) * (actor->spr.pos.X - cpt.pos.X) + (actor->spr.pos.Y - cpt.y) * (actor->spr.pos.Y - cpt.y)) < (128 * 128)) actor->temp_data[0]++; } diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index 97e516150..5c66751e0 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -67,7 +67,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, CraneDef& w, Crane { if (arc.BeginObject(keyname)) { - arc("x", w.x) + arc("x", w.pos.X) ("y", w.y) ("z", w.z) ("polex", w.polex) diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 0b6eb699e..a9ff2f75c 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -482,7 +482,7 @@ void initcrane(DDukeActor* actj, DDukeActor* act, int CRANEPOLE) act->temp_data[4] = cranes.Reserve(1); auto& apt = cranes[act->temp_data[4]]; - apt.x = act->spr.pos.X; + apt.pos.X = act->spr.pos.X; apt.y = act->spr.pos.Y; apt.z = act->spr.pos.Z; apt.poleactor = nullptr; diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 0b1d2ad62..2d5dd5aac 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -163,7 +163,8 @@ struct player_orig struct CraneDef { - int x, y, z; + vec3_t pos; + int y, z; int polex, poley; TObjPtr poleactor; };