- Add nullptr check to Interp_Sprite_Z reversion so I can load older saves before this was reverted.

This commit is contained in:
Mitchell Richters 2022-01-03 09:13:00 +11:00
parent 00ffc8b6a2
commit bc6dd4ae3e

View file

@ -55,7 +55,7 @@ double Get(int index, DCoreActor* actor, int type)
case Interp_Wall_PanX: return wall[index].xpan_;
case Interp_Wall_PanY: return wall[index].ypan_;
case Interp_Sprite_Z: return actor->spr.pos.Z;
case Interp_Sprite_Z: return actor ? actor->spr.pos.Z : 0;
default: return 0;
}
}
@ -79,7 +79,7 @@ void Set(int index, DCoreActor* actor, int type, double val)
case Interp_Wall_PanX: wall[index].xpan_ = float(val); break;
case Interp_Wall_PanY: wall[index].ypan_ = float(val); break;
case Interp_Sprite_Z: actor->spr.pos.Z = xs_CRoundToInt(val); break;
case Interp_Sprite_Z: if (actor) actor->spr.pos.Z = xs_CRoundToInt(val); break;
}
}