Commit 3a95266e by Sal

Merge branch 'microwavable-thinkframe' into 'next'

Add a Lua global to tell if you are in the preticker See merge request !245
parents 5ec44ba3 1a3e883b
......@@ -9687,6 +9687,9 @@ static inline int lib_getenum(lua_State *L)
} else if (fastcmp(word,"leveltime")) {
lua_pushinteger(L, leveltime);
return 1;
} else if (fastcmp(word,"defrosting")) {
lua_pushinteger(L, hook_defrosting);
return 1;
} else if (fastcmp(word,"curWeather")) {
lua_pushinteger(L, curWeather);
return 1;
......
......@@ -63,6 +63,7 @@ enum hook {
extern const char *const hookNames[];
extern boolean hook_cmd_running; // This is used by PlayerCmd and lua_playerlib to prevent anything from being wirtten to player while we run PlayerCmd.
extern int hook_defrosting;
void LUAh_MapChange(INT16 mapnumber); // Hook for map change (before load)
void LUAh_MapLoad(void); // Hook for map load
......
......@@ -35,6 +35,8 @@
lua_State *gL = NULL;
int hook_defrosting;
// List of internal libraries to load from SRB2
static lua_CFunction liblist[] = {
LUA_EnumLib, // global metatable for enums
......
......@@ -807,13 +807,15 @@ void P_Ticker(boolean run)
// Abbreviated ticker for pre-loading, calls thinkers and assorted things
void P_PreTicker(INT32 frames)
{
INT32 i,framecnt;
INT32 i;
ticcmd_t temptic;
for (i = 0; i <= splitscreen; i++)
postimgtype[i] = postimg_none;
for (framecnt = 0; framecnt < frames; ++framecnt)
hook_defrosting = frames;
while (hook_defrosting)
{
P_MapStart();
......@@ -860,5 +862,7 @@ void P_PreTicker(INT32 frames)
#endif
P_MapEnd();
hook_defrosting--;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment