mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Minor changes
This commit is contained in:
parent
cb002c0fa6
commit
2e618915db
2 changed files with 9 additions and 6 deletions
|
@ -1848,7 +1848,7 @@ void D_AddWorld(INT32 mapnum)
|
||||||
char buf[MAX_WADPATH+1];
|
char buf[MAX_WADPATH+1];
|
||||||
char *buf_p = buf;
|
char *buf_p = buf;
|
||||||
|
|
||||||
CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d\n", mapnum);
|
CONS_Debug(DBG_GAMELOGIC, "New world: mapnum=%d\n", mapnum);
|
||||||
|
|
||||||
I_Assert(W_CheckNumForName(mapname) != LUMPERROR);
|
I_Assert(W_CheckNumForName(mapname) != LUMPERROR);
|
||||||
|
|
||||||
|
|
13
src/g_game.c
13
src/g_game.c
|
@ -5107,29 +5107,32 @@ boolean G_LoadWorld(const char *mapname)
|
||||||
|
|
||||||
INT16 mapnum = (INT16)M_MapNumber(mapname[3], mapname[4]); // get xx out of MAPxx
|
INT16 mapnum = (INT16)M_MapNumber(mapname[3], mapname[4]); // get xx out of MAPxx
|
||||||
|
|
||||||
LUA_HookInt(mapnum, HOOK(MapChange));
|
|
||||||
|
|
||||||
// gamemap changed; we assume that its map header is always valid,
|
// gamemap changed; we assume that its map header is always valid,
|
||||||
// so make it so
|
// so make it so
|
||||||
if(!mapheaderinfo[mapnum-1])
|
if(!mapheaderinfo[mapnum-1])
|
||||||
P_AllocMapHeader(mapnum-1);
|
P_AllocMapHeader(mapnum-1);
|
||||||
|
|
||||||
|
LUA_HookInt(mapnum, HOOK(MapChange));
|
||||||
|
|
||||||
nextmapheader = mapheaderinfo[mapnum-1];
|
nextmapheader = mapheaderinfo[mapnum-1];
|
||||||
worldmapheader = nextmapheader;
|
worldmapheader = nextmapheader;
|
||||||
|
|
||||||
|
world_t *curworld = world;
|
||||||
|
|
||||||
if (!P_LoadWorld(mapnum, false))
|
if (!P_LoadWorld(mapnum, false))
|
||||||
{
|
{
|
||||||
|
P_SetWorld(curworld); // Change world back to the previous one
|
||||||
CONS_Alert(CONS_ERROR, "G_LoadWorld: Could not load map '%s'\n", mapname);
|
CONS_Alert(CONS_ERROR, "G_LoadWorld: Could not load map '%s'\n", mapname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change world back to the previous one
|
||||||
|
P_SetWorld(curworld);
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
Z_CheckHeap(-2);
|
Z_CheckHeap(-2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// change world back to yours, for consistency
|
|
||||||
P_SetWorld(localworld);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue