Set object lifeleft to IMMORTAL_TIME if the byte read in demo playback is -1. This allows the objects to stay when playing a demo, going to the editor then playing the game from the editor

This commit is contained in:
Chris Taylor 2012-04-17 15:35:23 +08:00
parent 7ff82427d9
commit 670219fa5a
2 changed files with 6 additions and 2 deletions

View file

@ -5,6 +5,7 @@ D1X-Rebirth Changelog
main/gameseq.c: Allow level progressing if playing the builtin mission with EDITOR compiled - only exit if Current_level_num is 0
editor/med.c: Reset the player object for the editor, since demo playback mucks it up
main/render.c: Skip rendering of OBJ_NONE objects to avoid a failed Assert (can happen when playing a demo then going to the editor)
main/newdemo.c: Set object lifeleft to IMMORTAL_TIME if the byte read in demo playback is -1. This allows the objects to stay when playing a demo, going to the editor then playing the game from the editor
20120416
--------

View file

@ -518,10 +518,13 @@ void nd_read_object(object *obj)
else {
sbyte b;
// MWA old way -- won't work with big endian machines nd_read_byte((ubyte *)&(obj->lifeleft));
nd_read_byte(&b);
obj->lifeleft = (fix)b;
// MWA old way -- won't work with big endian machines nd_read_byte((ubyte *)&(obj->lifeleft));
obj->lifeleft = (fix)((int)obj->lifeleft << 12);
if (obj->lifeleft == -1)
obj->lifeleft = IMMORTAL_TIME;
else
obj->lifeleft = (fix)((int)obj->lifeleft << 12);
}
if ((obj->type == OBJ_ROBOT) && !shareware) {