From 5eeef20d70fc978372058371d29821dc27b019a5 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 27 Nov 2014 15:28:58 -0500 Subject: hexen: Store minotaur start time as little endian. The minotaur uses the first four bytes of the mobj_t args[] array to store its spawn time; after a certain amount of time has passed the minotaur self-destructs. But the level time was being copied from the leveltime variable without any endian conversion taking place. For compatibility with Vanilla Hexen savegames we need to store the start time in little endian format. This fixes the first issue noted in #477 (thanks Quasar). --- src/hexen/a_action.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/hexen/a_action.c') diff --git a/src/hexen/a_action.c b/src/hexen/a_action.c index e25b4f84..c4c194e3 100644 --- a/src/hexen/a_action.c +++ b/src/hexen/a_action.c @@ -636,7 +636,12 @@ void A_Summon(mobj_t * actor) return; } - memcpy((void *) mo->args, &leveltime, sizeof(leveltime)); + // Store leveltime into mo->args. This must be stored in little- + // endian format for Vanilla savegame compatibility. + mo->args[0] = leveltime & 0xff; + mo->args[1] = (leveltime >> 8) & 0xff; + mo->args[2] = (leveltime >> 16) & 0xff; + mo->args[3] = (leveltime >> 24) & 0xff; master = actor->special1.m; if (master->flags & MF_CORPSE) { // Master dead -- cgit v1.2.3