kill have_blua
This commit is contained in:
1 parent
4401f0659e
commit
c5915091aa
47 files changed
+279
-2450
No files matched your search
+2
-4
@@ -391,9 +391,7 @@ CFLAGS+=-DHAVE_DISCORDRPC -DUSE_STUN
|
||||
OBJS+=$(OBJDIR)/discord.o $(OBJDIR)/stun.o
|
||||
endif
|
||||
|
||||
ifndef NO_LUA
|
||||
include blua/Makefile.cfg
|
||||
endif
|
||||
|
||||
ifdef NOMD5
|
||||
OPTS+=-DNOMD5
|
||||
@@ -724,9 +722,9 @@ $(OBJDIR)/depend.dep:
|
||||
ifndef NOHW
|
||||
$(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped
|
||||
endif
|
||||
ifndef NO_LUA
|
||||
|
||||
$(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped
|
||||
endif
|
||||
|
||||
@sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep
|
||||
$(REMOVE) $(OBJDIR)/depend.ped
|
||||
@echo "Created dependency file, depend.dep"
|
||||
|
||||
@@ -35,11 +35,9 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
|
||||
if (!sonic || sonic->health <= 0)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Lua can handle it!
|
||||
if (LUAh_BotAI(sonic, tails, cmd))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (tails->player->pflags & (PF_MACESPIN|PF_ITEMHANG))
|
||||
{
|
||||
@@ -123,11 +121,9 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
|
||||
// Bot AI isn't programmed in analog.
|
||||
//CV_SetValue(&cv_analog2, false);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Let Lua scripts build ticcmds
|
||||
if (LUAh_BotTiccmd(player, cmd))
|
||||
return;
|
||||
#endif
|
||||
|
||||
// We don't have any main character AI, sorry. D:
|
||||
if (player-players == consoleplayer)
|
||||
|
||||
@@ -10,8 +10,6 @@ WFLAGS+=-Wno-logical-op
|
||||
endif
|
||||
endif
|
||||
|
||||
OPTS+=-DHAVE_BLUA
|
||||
|
||||
OBJS:=$(OBJS) \
|
||||
$(OBJDIR)/lapi.o \
|
||||
$(OBJDIR)/lbaselib.o \
|
||||
|
||||
+2
-17
@@ -460,13 +460,11 @@ void COM_AddCommand(const char *name, com_func_t func)
|
||||
{
|
||||
if (!stricmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
// don't I_Error for Lua commands
|
||||
// Lua commands can replace game commands, and they have priority.
|
||||
// BUT, if for some reason we screwed up and made two console commands with the same name,
|
||||
// it's good to have this here so we find out.
|
||||
if (cmd->function != COM_Lua_f)
|
||||
#endif
|
||||
I_Error("Command %s already exists\n", name);
|
||||
|
||||
return;
|
||||
@@ -480,7 +478,6 @@ void COM_AddCommand(const char *name, com_func_t func)
|
||||
com_commands = cmd;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
/** Adds a console command for Lua.
|
||||
* No I_Errors allowed; return a negative code instead.
|
||||
*
|
||||
@@ -513,7 +510,6 @@ int COM_AddLuaCommand(const char *name)
|
||||
com_commands = cmd;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Tests if a command exists.
|
||||
*
|
||||
@@ -1496,17 +1492,6 @@ found:
|
||||
var->value = atoi(var->string);
|
||||
|
||||
finish:
|
||||
// See the note above.
|
||||
/* if (var->flags & CV_CHEAT)
|
||||
{
|
||||
boolean newcheats = CV_CheatsEnabled();
|
||||
|
||||
if (!prevcheats && newcheats)
|
||||
CONS_Printf(M_GetText("Cheats have been enabled.\n"));
|
||||
else if (prevcheats && !newcheats)
|
||||
CONS_Printf(M_GetText("Cheats have been disabled.\n"));
|
||||
} */
|
||||
|
||||
if (var->flags & CV_SHOWMODIFONETIME || var->flags & CV_SHOWMODIF)
|
||||
{
|
||||
CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string);
|
||||
@@ -1517,10 +1502,10 @@ finish:
|
||||
DEBFILE(va("%s set to %s\n", var->name, var->string));
|
||||
}
|
||||
var->flags |= CV_MODIFIED;
|
||||
|
||||
// raise 'on change' code
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_CVarChanged(var->name); // let consolelib know what cvar this is.
|
||||
#endif
|
||||
|
||||
if (var->flags & CV_CALL && !stealth)
|
||||
var->func();
|
||||
|
||||
|
||||
+1
-13
@@ -3188,11 +3188,7 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerQuit(&players[playernum], reason); // Lua hook for player quitting
|
||||
#else
|
||||
(void)reason;
|
||||
#endif
|
||||
|
||||
// Reset player data
|
||||
CL_ClearPlayer(playernum);
|
||||
@@ -3216,13 +3212,9 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||
if (playernum == displayplayers[0] && !demo.playback)
|
||||
displayplayers[0] = consoleplayer; // don't look through someone's view who isn't there
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_InvalidatePlayer(&players[playernum]);
|
||||
#endif
|
||||
|
||||
/*if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
|
||||
P_CheckSurvivors();
|
||||
else*/ if (G_BattleGametype()) // SRB2Kart
|
||||
if (G_BattleGametype()) // SRB2Kart
|
||||
K_CheckBumpers();
|
||||
else if (G_RaceGametype())
|
||||
P_CheckRacers();
|
||||
@@ -4099,9 +4091,7 @@ void SV_ResetServer(void)
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_InvalidatePlayer(&players[i]);
|
||||
#endif
|
||||
playeringame[i] = false;
|
||||
playernode[i] = UINT8_MAX;
|
||||
sprintf(player_names[i], "Player %d", i + 1);
|
||||
@@ -4287,9 +4277,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||
if (server && multiplayer && motd[0] != '\0')
|
||||
COM_BufAddText(va("sayto %d %s\n", newplayernum, motd));
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerJoin(newplayernum);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
DRPC_UpdatePresence();
|
||||
|
||||
+2
-6
@@ -70,6 +70,8 @@
|
||||
#include "d_protocol.h"
|
||||
#include "m_perfstats.h"
|
||||
|
||||
#include "lua_script.h"
|
||||
|
||||
#ifdef CMAKECONFIG
|
||||
#include "config.h"
|
||||
#else
|
||||
@@ -84,10 +86,6 @@
|
||||
#include "hardware/hw3sound.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#include "lua_script.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
#include "discord.h"
|
||||
#endif
|
||||
@@ -765,9 +763,7 @@ void D_SRB2Loop(void)
|
||||
HW3S_EndFrameUpdate();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_Step();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
if (! dedicated)
|
||||
|
||||
+4
-18
@@ -193,10 +193,8 @@ static void Command_SkinSearch(void);
|
||||
|
||||
#ifdef _DEBUG
|
||||
static void Command_Togglemodified_f(void);
|
||||
#ifdef HAVE_BLUA
|
||||
static void Command_Archivetest_f(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// =========================================================================
|
||||
// CLIENT VARIABLES
|
||||
@@ -614,10 +612,8 @@ const char *netxcmdnames[MAXNETXCMD - 1] =
|
||||
"MODIFYVOTE",
|
||||
"PICKVOTE",
|
||||
"REMOVEPLAYER",
|
||||
#ifdef HAVE_BLUA
|
||||
"LUACMD",
|
||||
"LUAVAR"
|
||||
#endif
|
||||
};
|
||||
|
||||
// =========================================================================
|
||||
@@ -658,9 +654,7 @@ void D_RegisterServerCommands(void)
|
||||
RegisterNetXCmd(XD_PAUSE, Got_Pause);
|
||||
RegisterNetXCmd(XD_RESPAWN, Got_Respawn);
|
||||
RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd);
|
||||
#ifdef HAVE_BLUA
|
||||
RegisterNetXCmd(XD_LUACMD, Got_Luacmd);
|
||||
#endif
|
||||
|
||||
RegisterNetXCmd(XD_SETUPVOTE, Got_SetupVotecmd);
|
||||
RegisterNetXCmd(XD_MODIFYVOTE, Got_ModifyVotecmd);
|
||||
@@ -717,9 +711,7 @@ void D_RegisterServerCommands(void)
|
||||
COM_AddCommand("cheats", Command_Cheats_f); // test
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("togglemodified", Command_Togglemodified_f);
|
||||
#ifdef HAVE_BLUA
|
||||
COM_AddCommand("archivetest", Command_Archivetest_f);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
COM_AddCommand("replaymarker", Command_ReplayMarker);
|
||||
@@ -1185,7 +1177,7 @@ void D_RegisterClientCommands(void)
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("causecfail", Command_CauseCfail_f);
|
||||
#endif
|
||||
#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE)
|
||||
#if defined(LUA_ALLOW_BYTECODE)
|
||||
COM_AddCommand("dumplua", Command_Dumplua_f);
|
||||
#endif
|
||||
|
||||
@@ -2953,9 +2945,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||
INT32 resetplayer = 1, lastgametype;
|
||||
UINT8 skipprecutscene, FLS;
|
||||
boolean pencoremode;
|
||||
/*#ifdef HAVE_BLUA
|
||||
INT16 mapnumber;
|
||||
#endif*/
|
||||
//INT16 mapnumber;
|
||||
|
||||
forceresetplayers = deferencoremode = false;
|
||||
|
||||
@@ -3021,10 +3011,8 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||
if (modeattacking) // i remember moving this here in internal fixed a heisenbug so
|
||||
SetPlayerSkinByNum(0, cv_chooseskin.value-1);
|
||||
|
||||
/*#ifdef HAVE_BLUA
|
||||
mapnumber = M_MapNumber(mapname[3], mapname[4]);
|
||||
LUAh_MapChange(mapnumber);
|
||||
#endif*/
|
||||
//mapnumber = M_MapNumber(mapname[3], mapname[4]);
|
||||
//LUAh_MapChange(mapnumber);
|
||||
|
||||
demo.savemode = (cv_recordmultiplayerdemos.value == 2) ? DSM_WILLAUTOSAVE : DSM_NOTSAVING;
|
||||
demo.savebutton = 0;
|
||||
@@ -5754,7 +5742,6 @@ static void Command_Togglemodified_f(void)
|
||||
modifiedgame = !modifiedgame;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
extern UINT8 *save_p;
|
||||
static void Command_Archivetest_f(void)
|
||||
{
|
||||
@@ -5799,7 +5786,6 @@ static void Command_Archivetest_f(void)
|
||||
CONS_Printf("Done. No crash.\n");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Makes a change to ::cv_forceskin take effect immediately.
|
||||
*
|
||||
|
||||
@@ -253,10 +253,8 @@ typedef enum
|
||||
XD_PICKVOTE, // 24
|
||||
XD_REMOVEPLAYER,// 25
|
||||
XD_DISCORD, // 26
|
||||
#ifdef HAVE_BLUA
|
||||
XD_LUACMD, // 27
|
||||
XD_LUAVAR, // 28
|
||||
#endif
|
||||
MAXNETXCMD
|
||||
} netxcmd_t;
|
||||
|
||||
|
||||
+6
-272
@@ -31,19 +31,19 @@
|
||||
#include "r_data.h"
|
||||
#include "r_patch.h"
|
||||
#include "r_sky.h"
|
||||
#include "r_draw.h" // translation colormap consts (for lua)
|
||||
#include "fastcmp.h"
|
||||
#include "lua_script.h"
|
||||
#include "lua_glib.h"
|
||||
#include "lua_hook.h"
|
||||
#include "d_clisrv.h"
|
||||
#include "v_video.h" // video flags (for lua)
|
||||
|
||||
#include "lua_script.h"
|
||||
#include "lua_libs.h"
|
||||
|
||||
#include "m_cond.h"
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#include "v_video.h" // video flags (for lua)
|
||||
#include "r_draw.h" // translation colormap consts (for lua)
|
||||
#endif
|
||||
|
||||
#define REQUIRE_MATHLIB_GUID "{748fcbc8-6480-4013-ac4e-7afce6cab766}"
|
||||
|
||||
// Free slot names
|
||||
@@ -67,9 +67,6 @@ static sfxenum_t get_sfx(const char *word);
|
||||
static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
|
||||
#endif
|
||||
static hudnum_t get_huditem(const char *word);
|
||||
#ifndef HAVE_BLUA
|
||||
static powertype_t get_power(const char *word);
|
||||
#endif
|
||||
|
||||
boolean deh_loaded = false;
|
||||
static int dbg_line;
|
||||
@@ -795,7 +792,6 @@ static void readlevelheader(MYFILE *f, INT32 num, INT32 wadnum)
|
||||
// Lua custom options also go above, contents may be case sensitive.
|
||||
if (fastncmp(word, "LUA.", 4))
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
UINT8 j;
|
||||
customoption_t *modoption;
|
||||
|
||||
@@ -829,9 +825,6 @@ static void readlevelheader(MYFILE *f, INT32 num, INT32 wadnum)
|
||||
modoption->option[31] = '\0';
|
||||
strncpy(modoption->value, word2, 255);
|
||||
modoption->value[255] = '\0';
|
||||
#else
|
||||
// Silently ignore.
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1748,10 +1741,8 @@ static void readframe(MYFILE *f, INT32 num)
|
||||
}
|
||||
|
||||
z = 0;
|
||||
#ifdef HAVE_BLUA
|
||||
found = LUA_SetLuaAction(&states[num], actiontocompare);
|
||||
if (!found)
|
||||
#endif
|
||||
while (actionpointers[z].name)
|
||||
{
|
||||
if (fastcmp(actiontocompare, actionpointers[z].name))
|
||||
@@ -7403,14 +7394,12 @@ static const char *const MOBJEFLAG_LIST[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
static const char *const MAPTHINGFLAG_LIST[4] = {
|
||||
NULL,
|
||||
"OBJECTFLIP", // Reverse gravity flag for objects.
|
||||
"OBJECTSPECIAL", // Special flag used with certain objects.
|
||||
"AMBUSH" // Deaf monsters/do not react to sound.
|
||||
};
|
||||
#endif
|
||||
|
||||
static const char *const PLAYERFLAG_LIST[] = {
|
||||
// Flip camera angle with gravity flip prefrence.
|
||||
@@ -7483,7 +7472,6 @@ static const char *const PLAYERFLAG_LIST[] = {
|
||||
NULL // stop loop here.
|
||||
};
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Linedef flags
|
||||
static const char *const ML_LIST[16] = {
|
||||
"IMPASSIBLE",
|
||||
@@ -7503,7 +7491,6 @@ static const char *const ML_LIST[16] = {
|
||||
"BOUNCY",
|
||||
"TFERLINE"
|
||||
};
|
||||
#endif
|
||||
|
||||
// This DOES differ from r_draw's Color_Names, unfortunately.
|
||||
// Also includes Super colors
|
||||
@@ -7710,7 +7697,6 @@ static const char *const POWERS_LIST[] = {
|
||||
"INGOOP" // In goop
|
||||
};
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
static const char *const KARTSTUFF_LIST[] = {
|
||||
"POSITION",
|
||||
"OLDPOSITION",
|
||||
@@ -7797,7 +7783,6 @@ static const char *const KARTSTUFF_LIST[] = {
|
||||
"SPECTATEWAIT",
|
||||
"GROWCANCEL"
|
||||
};
|
||||
#endif
|
||||
|
||||
static const char *const HUDITEMS_LIST[] = {
|
||||
"LIVESNAME",
|
||||
@@ -7840,11 +7825,7 @@ static const char *const HUDITEMS_LIST[] = {
|
||||
struct {
|
||||
const char *n;
|
||||
// has to be able to hold both fixed_t and angle_t, so drastic measure!!
|
||||
#ifdef HAVE_BLUA
|
||||
lua_Integer v;
|
||||
#else
|
||||
INT64 v;
|
||||
#endif
|
||||
} const INT_CONST[] = {
|
||||
// If a mod removes some variables here,
|
||||
// please leave the names in-tact and just set
|
||||
@@ -8033,7 +8014,6 @@ struct {
|
||||
{"SF_NOINTERRUPT",SF_NOINTERRUPT},
|
||||
{"SF_X2AWAYSOUND",SF_X2AWAYSOUND},
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// p_local.h constants
|
||||
{"FLOATSPEED",FLOATSPEED},
|
||||
{"MAXSTEPMOVE",MAXSTEPMOVE},
|
||||
@@ -8341,7 +8321,6 @@ struct {
|
||||
// Custom client features exposed to lua
|
||||
{"FEATURE_INTERMISSIONHUD",1},
|
||||
{"FEATURE_VOTEHUD",1},
|
||||
#endif
|
||||
|
||||
{NULL,0}
|
||||
};
|
||||
@@ -8470,249 +8449,10 @@ static hudnum_t get_huditem(const char *word)
|
||||
return HUD_LIVESNAME;
|
||||
}
|
||||
|
||||
#ifndef HAVE_BLUA
|
||||
static powertype_t get_power(const char *word)
|
||||
{ // Returns the vlaue of pw_ enumerations
|
||||
powertype_t i;
|
||||
if (*word >= '0' && *word <= '9')
|
||||
return atoi(word);
|
||||
if (fastncmp("PW_",word,3))
|
||||
word += 3; // take off the pw_
|
||||
for (i = 0; i < NUMPOWERS; i++)
|
||||
if (fastcmp(word, POWERS_LIST[i]))
|
||||
return i;
|
||||
deh_warning("Couldn't find power named 'pw_%s'",word);
|
||||
return pw_invulnerability;
|
||||
}
|
||||
|
||||
/// \todo Make ANY of this completely over-the-top math craziness obey the order of operations.
|
||||
static fixed_t op_mul(fixed_t a, fixed_t b) { return a*b; }
|
||||
static fixed_t op_div(fixed_t a, fixed_t b) { return a/b; }
|
||||
static fixed_t op_add(fixed_t a, fixed_t b) { return a+b; }
|
||||
static fixed_t op_sub(fixed_t a, fixed_t b) { return a-b; }
|
||||
static fixed_t op_or(fixed_t a, fixed_t b) { return a|b; }
|
||||
static fixed_t op_and(fixed_t a, fixed_t b) { return a&b; }
|
||||
static fixed_t op_lshift(fixed_t a, fixed_t b) { return a<<b; }
|
||||
static fixed_t op_rshift(fixed_t a, fixed_t b) { return a>>b; }
|
||||
|
||||
struct {
|
||||
const char c;
|
||||
fixed_t (*v)(fixed_t,fixed_t);
|
||||
} OPERATIONS[] = {
|
||||
{'*',op_mul},
|
||||
{'/',op_div},
|
||||
{'+',op_add},
|
||||
{'-',op_sub},
|
||||
{'|',op_or},
|
||||
{'&',op_and},
|
||||
{'<',op_lshift},
|
||||
{'>',op_rshift},
|
||||
{0,NULL}
|
||||
};
|
||||
|
||||
// Returns the full word, cut at the first symbol or whitespace
|
||||
static char *read_word(const char *line)
|
||||
{
|
||||
// Part 1: You got the start of the word, now find the end.
|
||||
const char *p;
|
||||
INT32 i;
|
||||
for (p = line+1; *p; p++) {
|
||||
if (*p == ' ' || *p == '\t')
|
||||
break;
|
||||
for (i = 0; OPERATIONS[i].c; i++)
|
||||
if (*p == OPERATIONS[i].c) {
|
||||
i = -1;
|
||||
break;
|
||||
}
|
||||
if (i == -1)
|
||||
break;
|
||||
}
|
||||
|
||||
// Part 2: Make a copy of the word and return it.
|
||||
{
|
||||
size_t len = (p-line);
|
||||
char *word = malloc(len+1);
|
||||
M_Memcpy(word,line,len);
|
||||
word[len] = '\0';
|
||||
return word;
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 operation_pad(const char **word)
|
||||
{ // Brings word the next operation and returns the operation number.
|
||||
INT32 i;
|
||||
for (; **word; (*word)++) {
|
||||
if (**word == ' ' || **word == '\t')
|
||||
continue;
|
||||
for (i = 0; OPERATIONS[i].c; i++)
|
||||
if (**word == OPERATIONS[i].c)
|
||||
{
|
||||
if ((**word == '<' && *(*word+1) == '<') || (**word == '>' && *(*word+1) == '>')) (*word)++; // These operations are two characters long.
|
||||
else if (**word == '<' || **word == '>') continue; // ... do not accept one character long.
|
||||
(*word)++;
|
||||
return i;
|
||||
}
|
||||
deh_warning("Unknown operation '%c'",**word);
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void const_warning(const char *type, const char *word)
|
||||
{
|
||||
deh_warning("Couldn't find %s named '%s'",type,word);
|
||||
}
|
||||
|
||||
static fixed_t find_const(const char **rword)
|
||||
{ // Finds the value of constants and returns it, bringing word to the next operation.
|
||||
INT32 i;
|
||||
fixed_t r;
|
||||
char *word = read_word(*rword);
|
||||
*rword += strlen(word);
|
||||
if ((*word >= '0' && *word <= '9') || *word == '-') { // Parse a number
|
||||
r = atoi(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
if (!*(word+1) && // Turn a single A-z symbol into numbers, like sprite frames.
|
||||
((*word >= 'A' && *word <= 'Z') || (*word >= 'a' && *word <= 'z'))) {
|
||||
r = R_Char2Frame(*word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
if (fastncmp("MF_", word, 3)) {
|
||||
char *p = word+3;
|
||||
for (i = 0; MOBJFLAG_LIST[i]; i++)
|
||||
if (fastcmp(p, MOBJFLAG_LIST[i])) {
|
||||
free(word);
|
||||
return (1<<i);
|
||||
}
|
||||
|
||||
// Not found error
|
||||
const_warning("mobj flag",word);
|
||||
free(word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("MF2_", word, 4)) {
|
||||
char *p = word+4;
|
||||
for (i = 0; MOBJFLAG2_LIST[i]; i++)
|
||||
if (fastcmp(p, MOBJFLAG2_LIST[i])) {
|
||||
free(word);
|
||||
return (1<<i);
|
||||
}
|
||||
|
||||
// Not found error
|
||||
const_warning("mobj flag2",word);
|
||||
free(word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("MFE_", word, 4)) {
|
||||
char *p = word+4;
|
||||
for (i = 0; MOBJEFLAG_LIST[i]; i++)
|
||||
if (fastcmp(p, MOBJEFLAG_LIST[i])) {
|
||||
free(word);
|
||||
return (1<<i);
|
||||
}
|
||||
|
||||
// Not found error
|
||||
const_warning("mobj eflag",word);
|
||||
free(word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("PF_", word, 3)) {
|
||||
char *p = word+3;
|
||||
for (i = 0; PLAYERFLAG_LIST[i]; i++)
|
||||
if (fastcmp(p, PLAYERFLAG_LIST[i])) {
|
||||
free(word);
|
||||
return (1<<i);
|
||||
}
|
||||
if (fastcmp(p, "FULLSTASIS"))
|
||||
return PF_FULLSTASIS;
|
||||
|
||||
// Not found error
|
||||
const_warning("player flag",word);
|
||||
free(word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("S_",word,2)) {
|
||||
r = get_state(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
else if (fastncmp("MT_",word,3)) {
|
||||
r = get_mobjtype(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
else if (fastncmp("SPR_",word,4)) {
|
||||
r = get_sprite(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
else if (fastncmp("SFX_",word,4) || fastncmp("DS",word,2)) {
|
||||
r = get_sfx(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
#ifdef MUSICSLOT_COMPATIBILITY
|
||||
else if (fastncmp("MUS_",word,4) || fastncmp("O_",word,2)) {
|
||||
r = get_mus(word, true);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
else if (fastncmp("PW_",word,3)) {
|
||||
r = get_power(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
else if (fastncmp("HUD_",word,4)) {
|
||||
r = get_huditem(word);
|
||||
free(word);
|
||||
return r;
|
||||
}
|
||||
else if (fastncmp("SKINCOLOR_",word,10)) {
|
||||
char *p = word+10;
|
||||
for (i = 0; i < MAXTRANSLATIONS; i++)
|
||||
if (fastcmp(p, COLOR_ENUMS[i])) {
|
||||
free(word);
|
||||
return i;
|
||||
}
|
||||
const_warning("color",word);
|
||||
free(word);
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; INT_CONST[i].n; i++)
|
||||
if (fastcmp(word,INT_CONST[i].n)) {
|
||||
free(word);
|
||||
return INT_CONST[i].v;
|
||||
}
|
||||
|
||||
// Not found error.
|
||||
const_warning("constant",word);
|
||||
free(word);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Loops through every constant and operation in word and performs its calculations, returning the final value.
|
||||
fixed_t get_number(const char *word)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
return LUA_EvalMath(word);
|
||||
#else
|
||||
// DESPERATELY NEEDED: Order of operations support! :x
|
||||
fixed_t i = find_const(&word);
|
||||
INT32 o;
|
||||
while(*word) {
|
||||
o = operation_pad(&word);
|
||||
if (o != -1)
|
||||
i = OPERATIONS[o].v(i,find_const(&word));
|
||||
else
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
#endif
|
||||
}
|
||||
|
||||
void DEH_Check(void)
|
||||
@@ -8741,10 +8481,6 @@ void DEH_Check(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#include "lua_script.h"
|
||||
#include "lua_libs.h"
|
||||
|
||||
// freeslot takes a name (string only!)
|
||||
// and allocates it to the appropriate free slot.
|
||||
// Returns the slot number allocated for it or nil if failed.
|
||||
@@ -9682,6 +9418,4 @@ void LUA_SetActionByName(void *state, const char *actiontocompare)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HAVE_BLUA
|
||||
}
|
||||
@@ -38,11 +38,9 @@ void DEH_Check(void);
|
||||
|
||||
fixed_t get_number(const char *word);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
|
||||
const char *LUA_GetActionName(void *action);
|
||||
void LUA_SetActionByName(void *state, const char *actiontocompare);
|
||||
#endif
|
||||
|
||||
extern boolean deh_loaded;
|
||||
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ typedef enum
|
||||
#endif
|
||||
EXT_PK3,
|
||||
EXT_SOC,
|
||||
EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt
|
||||
EXT_LUA,
|
||||
NUM_EXT,
|
||||
NUM_EXT_TABLE = NUM_EXT-EXT_START,
|
||||
EXT_LOADED = 0x80
|
||||
|
||||
+2
-22
@@ -1622,10 +1622,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
-Making some galaxy brain autopilot Lua if you're a masochist
|
||||
-Making a Mario Kart 8 Deluxe tier baby mode that steers you away from walls and whatnot. You know what, do what you want!
|
||||
*/
|
||||
#ifdef HAVE_BLUA
|
||||
if (gamestate == GS_LEVEL)
|
||||
LUAh_PlayerCmd(player, cmd);
|
||||
#endif
|
||||
|
||||
//Reset away view if a command is given.
|
||||
if ((cmd->forwardmove || cmd->sidemove || cmd->buttons)
|
||||
@@ -2955,9 +2953,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||
if (starpost) //Don't even bother with looking for a place to spawn.
|
||||
{
|
||||
P_MovePlayerToStarpost(playernum);
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3013,10 +3009,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||
}
|
||||
P_MovePlayerToSpawn(playernum, spawnpoint);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
mapthing_t *G_FindCTFStart(INT32 playernum)
|
||||
@@ -3311,9 +3304,7 @@ void G_DoReborn(INT32 playernum)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_MapChange(gamemap);
|
||||
#endif
|
||||
G_DoLoadLevel(true);
|
||||
}
|
||||
}*/
|
||||
@@ -4785,9 +4776,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
|
||||
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->precutscenenum-1, true, resetplayer);
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_MapChange(gamemap);
|
||||
#endif
|
||||
G_DoLoadLevel(resetplayer);
|
||||
}
|
||||
|
||||
@@ -5108,9 +5097,7 @@ INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep)
|
||||
#define DF_NIGHTSATTACK 0x04 // This demo is from NiGHTS attack and contains its time left, score, and mares!
|
||||
#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ???
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#define DF_LUAVARS 0x20 // this demo contains extra lua vars; this is mostly used for backwards compability
|
||||
#endif
|
||||
|
||||
#define DF_ATTACKSHIFT 1
|
||||
#define DF_ENCORE 0x40
|
||||
@@ -6778,11 +6765,9 @@ void G_BeginRecording(void)
|
||||
if (encoremode)
|
||||
demoflags |= DF_ENCORE;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (!modeattacking && gL) // Ghosts don't read luavars, and you shouldn't ever need to save Lua in replays, you doof!
|
||||
// SERIOUSLY THOUGH WHY WOULD YOU LOAD HOSTMOD AND RECORD A GHOST WITH IT !????
|
||||
demoflags |= DF_LUAVARS;
|
||||
#endif
|
||||
|
||||
// Setup header.
|
||||
M_Memcpy(demo_p, DEMOHEADER, 12); demo_p += 12;
|
||||
@@ -6890,11 +6875,9 @@ void G_BeginRecording(void)
|
||||
|
||||
WRITEUINT8(demo_p, 0xFF); // Denote the end of the player listing
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// player lua vars, always saved even if empty... Unless it's record attack.
|
||||
if (demoflags & DF_LUAVARS)
|
||||
LUA_ArchiveDemo();
|
||||
#endif
|
||||
|
||||
memset(&oldcmd,0,sizeof(oldcmd));
|
||||
memset(&oldghost,0,sizeof(oldghost));
|
||||
@@ -7880,9 +7863,8 @@ void G_DoPlayDemo(char *defdemoname)
|
||||
// didn't start recording right away.
|
||||
demo.deferstart = false;
|
||||
|
||||
/*#ifdef HAVE_BLUA
|
||||
LUAh_MapChange(gamemap);
|
||||
#endif*/
|
||||
//LUAh_MapChange(gamemap);
|
||||
|
||||
displayplayers[0] = consoleplayer = 0;
|
||||
memset(playeringame,0,sizeof(playeringame));
|
||||
|
||||
@@ -7969,7 +7951,6 @@ void G_DoPlayDemo(char *defdemoname)
|
||||
|
||||
// end of player read (the 0xFF marker)
|
||||
// so this is where we are to read our lua variables (if possible!)
|
||||
#ifdef HAVE_BLUA
|
||||
if (demoflags & DF_LUAVARS) // again, used for compability, lua shit will be saved to replays regardless of if it's even been loaded
|
||||
{
|
||||
if (!gL) // No Lua state! ...I guess we'll just start one...
|
||||
@@ -7978,7 +7959,6 @@ void G_DoPlayDemo(char *defdemoname)
|
||||
// No modeattacking check, DF_LUAVARS won't be present here.
|
||||
LUA_UnArchiveDemo();
|
||||
}
|
||||
#endif
|
||||
|
||||
splitscreen = 0;
|
||||
|
||||
|
||||
+13
-22
@@ -42,19 +42,17 @@
|
||||
#include "p_local.h" // camera[]
|
||||
#include "p_tick.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#include "lua_hud.h"
|
||||
#include "lua_hudlib_drawlist.h"
|
||||
#include "lua_hook.h"
|
||||
#endif
|
||||
|
||||
#include "s_sound.h" // song credits
|
||||
#include "k_kart.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
#endif
|
||||
|
||||
// coords are scaled
|
||||
#define HU_INPUTX 0
|
||||
#define HU_INPUTY 0
|
||||
@@ -94,9 +92,7 @@ static boolean headsupactive = false;
|
||||
boolean hu_showscores; // draw rankings
|
||||
static char hu_tick;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
static huddrawlist_h luahuddrawlist_scores;
|
||||
#endif
|
||||
|
||||
patch_t *rflagico;
|
||||
patch_t *bflagico;
|
||||
@@ -349,9 +345,7 @@ void HU_Init(void)
|
||||
// set shift translation table
|
||||
shiftxform = english_shiftxform;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
luahuddrawlist_scores = LUA_HUD_CreateDrawList();
|
||||
#endif
|
||||
|
||||
HU_LoadGraphics();
|
||||
}
|
||||
@@ -888,10 +882,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
|
||||
// run the lua hook even if we were supposed to eat the msg, netgame consistency goes first.
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_PlayerMsg(playernum, target, flags, msg, spam_eatmsg))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (spam_eatmsg)
|
||||
return; // don't proceed if we were supposed to eat the message.
|
||||
@@ -2268,19 +2260,18 @@ void HU_Drawer(void)
|
||||
{
|
||||
if (netgame || multiplayer)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_rankings))
|
||||
#endif
|
||||
HU_DrawRankings();
|
||||
#ifdef HAVE_BLUA
|
||||
if (renderisnewtic)
|
||||
{
|
||||
LUA_HUD_ClearDrawList(luahuddrawlist_scores);
|
||||
LUAh_ScoresHUD(luahuddrawlist_scores);
|
||||
}
|
||||
LUA_HUD_DrawList(luahuddrawlist_scores);
|
||||
#endif
|
||||
|
||||
if (renderisnewtic)
|
||||
{
|
||||
LUA_HUD_ClearDrawList(luahuddrawlist_scores);
|
||||
LUAh_ScoresHUD(luahuddrawlist_scores);
|
||||
}
|
||||
|
||||
LUA_HUD_DrawList(luahuddrawlist_scores);
|
||||
}
|
||||
|
||||
if (demo.playback)
|
||||
{
|
||||
HU_DrawDemoInfo();
|
||||
|
||||
+20
-84
@@ -2231,7 +2231,6 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
|
||||
{
|
||||
UINT8 scoremultiply = 1;
|
||||
// PS: Inflictor is unused for all purposes here and is actually only ever relevant to Lua. It may be nil too.
|
||||
#ifdef HAVE_BLUA
|
||||
boolean force = false; // Used to check if Lua ShouldSpin should get us damaged reguardless of flashtics or heck knows what.
|
||||
UINT8 shouldForce = LUAh_ShouldSpin(player, inflictor, source);
|
||||
if (P_MobjWasRemoved(player->mo))
|
||||
@@ -2240,11 +2239,6 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
|
||||
force = true;
|
||||
else if (shouldForce == 2)
|
||||
return;
|
||||
#else
|
||||
static const boolean force = false;
|
||||
(void)inflictor; // in case some weirdo doesn't want Lua.
|
||||
#endif
|
||||
|
||||
|
||||
if (!trapitem && G_BattleGametype())
|
||||
{
|
||||
@@ -2268,10 +2262,8 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_PlayerSpin(player, inflictor, source)) // Let Lua do its thing or overwrite if it wants to. Make sure to let any possible instashield happen because we didn't get "damaged" in this case.
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (source && source != player->mo && source->player)
|
||||
K_PlayHitEmSound(source);
|
||||
@@ -2377,7 +2369,6 @@ void K_SquishPlayer(player_t *player, mobj_t *source, mobj_t *inflictor)
|
||||
{
|
||||
UINT8 scoremultiply = 1;
|
||||
// PS: Inflictor is unused for all purposes here and is actually only ever relevant to Lua. It may be nil too.
|
||||
#ifdef HAVE_BLUA
|
||||
boolean force = false; // Used to check if Lua ShouldSquish should get us damaged reguardless of flashtics or heck knows what.
|
||||
UINT8 shouldForce = LUAh_ShouldSquish(player, inflictor, source);
|
||||
if (P_MobjWasRemoved(player->mo))
|
||||
@@ -2386,10 +2377,6 @@ void K_SquishPlayer(player_t *player, mobj_t *source, mobj_t *inflictor)
|
||||
force = true;
|
||||
else if (shouldForce == 2)
|
||||
return;
|
||||
#else
|
||||
static const boolean force = false;
|
||||
(void)inflictor; // Please stop forgetting to put inflictor in yer functions thank -Lat'
|
||||
#endif
|
||||
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
@@ -2413,10 +2400,8 @@ void K_SquishPlayer(player_t *player, mobj_t *source, mobj_t *inflictor)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_PlayerSquish(player, inflictor, source)) // Let Lua do its thing or overwrite if it wants to. Make sure to let any possible instashield happen because we didn't get "damaged" in this case.
|
||||
return;
|
||||
#endif
|
||||
|
||||
player->kartstuff[k_sneakertimer] = 0;
|
||||
player->kartstuff[k_driftboost] = 0;
|
||||
@@ -2495,7 +2480,6 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
|
||||
{
|
||||
fixed_t upgoer;
|
||||
UINT8 scoremultiply = 1;
|
||||
#ifdef HAVE_BLUA
|
||||
boolean force = false; // Used to check if Lua ShouldExplode should get us damaged reguardless of flashtics or heck knows what.
|
||||
UINT8 shouldForce = LUAh_ShouldExplode(player, inflictor, source);
|
||||
|
||||
@@ -2506,10 +2490,6 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
|
||||
else if (shouldForce == 2)
|
||||
return;
|
||||
|
||||
#else
|
||||
static const boolean force = false;
|
||||
#endif
|
||||
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
if (K_IsPlayerWanted(player))
|
||||
@@ -2532,10 +2512,8 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_PlayerExplode(player, inflictor, source)) // Same thing. Also make sure to let Instashield happen blah blah
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (source && source != player->mo && source->player)
|
||||
K_PlayHitEmSound(source);
|
||||
@@ -7714,13 +7692,10 @@ static void K_drawKartStats(void)
|
||||
if (stplyr == &players[displayplayers[splitnum]])
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
if (!LUA_HudEnabled(hud_statdisplay))
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// I tried my best, but this is still mess :/
|
||||
if (splitscreen)
|
||||
{
|
||||
@@ -8433,10 +8408,8 @@ static boolean K_drawKartPositionFaces(void)
|
||||
if (numplayersingame <= 1)
|
||||
return true;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (!LUA_HudEnabled(hud_minirankings))
|
||||
return false; // Don't proceed but still return true for free play above if HUD is disabled.
|
||||
#endif
|
||||
|
||||
for (j = 0; j < numplayersingame; j++)
|
||||
{
|
||||
@@ -8460,9 +8433,6 @@ static boolean K_drawKartPositionFaces(void)
|
||||
if (players+i == stplyr)
|
||||
strank = ranklines;
|
||||
|
||||
//if (ranklines == 5)
|
||||
//break; // Only draw the top 5 players -- we do this a different way now...
|
||||
|
||||
ranklines++;
|
||||
}
|
||||
|
||||
@@ -8514,10 +8484,8 @@ static boolean K_drawKartPositionFaces(void)
|
||||
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceRank(p), colormap);
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_battlebumpers))
|
||||
{
|
||||
#endif
|
||||
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
|
||||
{
|
||||
V_DrawMappedPatch(bumperx-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_tinybumper[0], colormap);
|
||||
@@ -8527,9 +8495,7 @@ static boolean K_drawKartPositionFaces(void)
|
||||
V_DrawMappedPatch(bumperx, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_tinybumper[1], colormap);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_BLUA
|
||||
} // A new level of stupidity: checking if lua is enabled to close a bracket. :Fascinating:
|
||||
#endif
|
||||
}
|
||||
|
||||
if (i == strank)
|
||||
@@ -9868,10 +9834,9 @@ static void K_drawBattleFullscreen(void)
|
||||
INT32 splitflags = V_SNAPTOTOP; // I don't feel like properly supporting non-green resolutions, so you can have a misuse of SNAPTO instead
|
||||
fixed_t scale = FRACUNIT;
|
||||
boolean drawcomebacktimer = true; // lazy hack because it's cleaner in the long run.
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
if (!LUA_HudEnabled(hud_battlecomebacktimer))
|
||||
drawcomebacktimer = false;
|
||||
#endif
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
@@ -9983,9 +9948,7 @@ static void K_drawBattleFullscreen(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_freeplay))
|
||||
#endif
|
||||
K_drawKartFreePlay(leveltime);
|
||||
}
|
||||
}
|
||||
@@ -10472,76 +10435,61 @@ void K_drawKartHUD(void)
|
||||
if (!demo.title && (!battlefullscreen || splitscreen))
|
||||
{
|
||||
// Draw the CHECK indicator before the other items, so it's overlapped by everything else
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
if (LUA_HudEnabled(hud_check)) // delete lua when?
|
||||
#endif
|
||||
{
|
||||
if (cv_kartcheck.value && !splitscreen && !players[displayplayers[0]].exiting && !freecam)
|
||||
K_drawKartPlayerCheck();
|
||||
}
|
||||
|
||||
// Draw WANTED status
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_wanted))
|
||||
#endif
|
||||
K_drawKartWanted();
|
||||
}
|
||||
|
||||
if (cv_kartminimap.value)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_minimap))
|
||||
#endif
|
||||
K_drawKartMinimap();
|
||||
}
|
||||
}
|
||||
|
||||
if (battlefullscreen && !freecam)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_battlefullscreen))
|
||||
#endif
|
||||
K_drawBattleFullscreen();
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw the item window
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_item) && !freecam)
|
||||
#endif
|
||||
K_drawKartItem();
|
||||
|
||||
if (cv_driftgauge.value && !modeattacking)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_driftgauge))
|
||||
#endif
|
||||
K_drawDriftGauge();
|
||||
if (LUA_HudEnabled(hud_driftgauge))
|
||||
K_drawDriftGauge();
|
||||
}
|
||||
|
||||
if (cv_nametag.value)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_nametags))
|
||||
#endif
|
||||
K_drawNameTags();
|
||||
if (LUA_HudEnabled(hud_nametags))
|
||||
K_drawNameTags();
|
||||
}
|
||||
|
||||
// If not splitscreen, draw...
|
||||
if (!splitscreen && !demo.title)
|
||||
{
|
||||
// Draw the timestamp
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_time))
|
||||
#endif
|
||||
K_drawKartTimestamp(stplyr->realtime, TIME_X, TIME_Y, gamemap, 0);
|
||||
|
||||
if (!modeattacking)
|
||||
{
|
||||
// The top-four faces on the left
|
||||
/*#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_minirankings))
|
||||
#endif*/
|
||||
//if (LUA_HudEnabled(hud_minirankings))
|
||||
isfreeplay = K_drawKartPositionFaces();
|
||||
}
|
||||
}
|
||||
@@ -10549,16 +10497,16 @@ void K_drawKartHUD(void)
|
||||
if (!stplyr->spectator && !demo.freecam) // Bottom of the screen elements, don't need in spectate mode
|
||||
{
|
||||
if (!(splitscreen || demo.title))
|
||||
#ifdef HAVE_BLUA
|
||||
{
|
||||
if (LUA_HudEnabled(hud_position))
|
||||
#endif
|
||||
K_drawInput();
|
||||
}
|
||||
|
||||
if (!demo.title && cv_showstats.value)
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_statdisplay))
|
||||
#endif
|
||||
K_drawKartStats();
|
||||
{
|
||||
if (LUA_HudEnabled(hud_statdisplay))
|
||||
K_drawKartStats();
|
||||
}
|
||||
|
||||
if (demo.title) // Draw title logo instead in demo.titles
|
||||
{
|
||||
@@ -10585,19 +10533,15 @@ void K_drawKartHUD(void)
|
||||
else if (G_RaceGametype()) // Race-only elements
|
||||
{
|
||||
// Draw the lap counter
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_gametypeinfo))
|
||||
#endif
|
||||
K_drawKartLaps();
|
||||
|
||||
if (!splitscreen)
|
||||
{
|
||||
// Draw the speedometer
|
||||
// TODO: Make a better speedometer.
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_speedometer))
|
||||
#endif
|
||||
K_drawKartSpeedometer();
|
||||
// TODO: Make a better speedometer. << done :p
|
||||
if (LUA_HudEnabled(hud_speedometer))
|
||||
K_drawKartSpeedometer();
|
||||
}
|
||||
|
||||
if (isfreeplay)
|
||||
@@ -10605,26 +10549,20 @@ void K_drawKartHUD(void)
|
||||
else if (!modeattacking)
|
||||
{
|
||||
// Draw the numerical position
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_position))
|
||||
#endif
|
||||
K_DrawKartPositionNum(stplyr->kartstuff[k_position]);
|
||||
}
|
||||
else //if (!(demo.playback && hu_showscores))
|
||||
{
|
||||
// Draw the input UI
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_position))
|
||||
#endif
|
||||
K_drawInput();
|
||||
}
|
||||
}
|
||||
else if (G_BattleGametype()) // Battle-only
|
||||
{
|
||||
// Draw the hits left!
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_gametypeinfo))
|
||||
#endif
|
||||
K_drawKartBumpersOrKarma();
|
||||
}
|
||||
}
|
||||
@@ -10668,9 +10606,7 @@ void K_drawKartHUD(void)
|
||||
// Draw FREE PLAY.
|
||||
if (isfreeplay && !stplyr->spectator && timeinmap > 113)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_freeplay))
|
||||
#endif
|
||||
K_drawKartFreePlay(leveltime);
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief basic functions for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "p_local.h"
|
||||
#include "p_setup.h" // So we can have P_SetupLevelSky
|
||||
#include "p_slopes.h" // P_GetZAt
|
||||
@@ -3267,6 +3266,4 @@ int LUA_BaseLib(lua_State *L)
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||
luaL_register(L, NULL, lib);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
/// \brief blockmap library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "p_local.h"
|
||||
#include "r_main.h" // validcount
|
||||
#include "lua_script.h"
|
||||
@@ -257,6 +256,4 @@ int LUA_BlockmapLib(lua_State *L)
|
||||
{
|
||||
lua_register(L, "searchBlockmap", lib_searchBlockmap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
/// \brief console modifying/etc library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "p_local.h"
|
||||
#include "g_game.h"
|
||||
@@ -600,6 +599,4 @@ int LUA_ConsoleLib(lua_State *L)
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||
luaL_register(L, NULL, lib);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-5
@@ -10,8 +10,6 @@
|
||||
/// \file lua_hook.h
|
||||
/// \brief hooks for Lua scripting
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
#include "r_defs.h"
|
||||
#include "d_player.h"
|
||||
|
||||
@@ -112,6 +110,4 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd); // Allows to write to p
|
||||
|
||||
void LUAh_IntermissionThinker(void); // Hook for Y_Ticker
|
||||
void LUAh_VoteThinker(void); // Hook for Y_VoteTicker
|
||||
#define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink
|
||||
|
||||
#endif
|
||||
#define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief hooks for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "doomstat.h"
|
||||
#include "p_mobj.h"
|
||||
#include "g_game.h"
|
||||
@@ -1750,6 +1749,4 @@ boolean LUAh_PlayerExplode(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||
}
|
||||
lua_settop(gL, 0);
|
||||
return hooked;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-4
@@ -12,7 +12,6 @@
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "fastcmp.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "r_defs.h"
|
||||
#include "r_local.h"
|
||||
#include "st_stuff.h" // hudinfo[]
|
||||
@@ -1569,6 +1568,4 @@ void LUAh_VoteHUD(huddrawlist_h list)
|
||||
|
||||
lua_pushlightuserdata(gL, NULL);
|
||||
lua_setfield(gL, LUA_REGISTRYINDEX, "HUD_DRAW_LIST");
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief infotable editing library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "info.h"
|
||||
#include "dehacked.h"
|
||||
@@ -984,6 +983,4 @@ int LUA_InfoLib(lua_State *L)
|
||||
lua_setglobal(L, "S_sfx");
|
||||
lua_setglobal(L, "sfxinfo");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-5
@@ -10,8 +10,6 @@
|
||||
/// \file lua_libs.h
|
||||
/// \brief libraries for Lua scripting
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
extern lua_State *gL;
|
||||
|
||||
#define LREG_VALID "VALID_USERDATA"
|
||||
@@ -70,6 +68,4 @@ int LUA_SkinLib(lua_State *L);
|
||||
int LUA_ThinkerLib(lua_State *L);
|
||||
int LUA_MapLib(lua_State *L);
|
||||
int LUA_BlockmapLib(lua_State *L);
|
||||
int LUA_HudLib(lua_State *L);
|
||||
|
||||
#endif
|
||||
int LUA_HudLib(lua_State *L);
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief game map library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "r_state.h"
|
||||
#include "p_local.h"
|
||||
#include "p_setup.h"
|
||||
@@ -1691,6 +1690,4 @@ int LUA_MapLib(lua_State *L)
|
||||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, "mapheaderinfo");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief basic math library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
//#include "fastcmp.h"
|
||||
#include "tables.h"
|
||||
#include "p_local.h"
|
||||
@@ -228,6 +227,4 @@ int LUA_MathLib(lua_State *L)
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||
luaL_register(L, NULL, lib);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-4
@@ -13,7 +13,6 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "r_things.h"
|
||||
#include "r_main.h"
|
||||
@@ -926,6 +925,4 @@ int LUA_MobjLib(lua_State *L)
|
||||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, "mapthings");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief player object library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "r_main.h"
|
||||
#include "r_things.h"
|
||||
@@ -820,6 +819,4 @@ int LUA_PlayerLib(lua_State *L)
|
||||
lua_setglobal(L, "displayplayers");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief Lua scripting basics
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "dehacked.h"
|
||||
#include "z_zone.h"
|
||||
@@ -1688,6 +1687,4 @@ int Lua_optoption(lua_State *L, int narg,
|
||||
if (fastcmp(lst[i], name))
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif // HAVE_BLUA
|
||||
}
|
||||
@@ -10,8 +10,6 @@
|
||||
/// \file lua_script.h
|
||||
/// \brief Lua scripting basics
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
#include "m_fixed.h"
|
||||
#include "doomtype.h"
|
||||
#include "d_player.h"
|
||||
@@ -95,5 +93,3 @@ void COM_Lua_f(void);
|
||||
CONS_Alert(CONS_WARNING,"%s\n", warningmsg);\
|
||||
}\
|
||||
}
|
||||
|
||||
#endif
|
||||
+1
-4
@@ -11,7 +11,6 @@
|
||||
/// \brief player skin structure library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "r_things.h"
|
||||
#include "sounds.h"
|
||||
@@ -273,6 +272,4 @@ int LUA_SkinLib(lua_State *L)
|
||||
lua_setglobal(L, "skins");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
/// \brief thinker library for Lua scripting
|
||||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "p_local.h"
|
||||
#include "lua_script.h"
|
||||
#include "lua_libs.h"
|
||||
@@ -131,6 +130,4 @@ int LUA_ThinkerLib(lua_State *L)
|
||||
lua_setfield(L, -2, "iterate");
|
||||
lua_setglobal(L, "thinkers");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
+1
-5
@@ -1,8 +1,6 @@
|
||||
#ifndef __LUA_UDATALIB_H__
|
||||
#define __LUA_UDATALIB_H__
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "lua_script.h"
|
||||
#include "lua_libs.h"
|
||||
@@ -102,6 +100,4 @@ void udatalib_addfields(lua_State *L, int mt, const udata_field_t fields[]);
|
||||
return 0; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
+1
-3
@@ -647,7 +647,7 @@ void Command_CauseCfail_f(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE)
|
||||
#if defined(LUA_ALLOW_BYTECODE)
|
||||
void Command_Dumplua_f(void)
|
||||
{
|
||||
if (modifiedgame)
|
||||
@@ -891,9 +891,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
|
||||
mapthing_t *mt = mapthings;
|
||||
sector_t *sec = player->mo->subsector->sector;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_InvalidateMapthings();
|
||||
#endif
|
||||
|
||||
mapthings = Z_Realloc(mapthings, ++nummapthings * sizeof (*mapthings), PU_LEVEL, NULL);
|
||||
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ void Command_Weather_f(void);
|
||||
#ifdef _DEBUG
|
||||
void Command_CauseCfail_f(void);
|
||||
#endif
|
||||
#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE)
|
||||
#if defined(LUA_ALLOW_BYTECODE)
|
||||
void Command_Dumplua_f(void);
|
||||
#endif
|
||||
|
||||
|
||||
+1
-6
@@ -6567,13 +6567,8 @@ static void M_HandleAddons(INT32 choice)
|
||||
case EXT_CFG:
|
||||
M_AddonExec(KEY_ENTER);
|
||||
break;
|
||||
case EXT_LUA:
|
||||
#ifndef HAVE_BLUA
|
||||
S_StartSound(NULL, sfx_s26d);
|
||||
M_StartMessage(va("%c%s\x80\nThis version of SRB2Kart does not\nhave support for .lua files.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING);
|
||||
break;
|
||||
#endif
|
||||
// else intentional fallthrough
|
||||
case EXT_LUA:
|
||||
case EXT_SOC:
|
||||
case EXT_WAD:
|
||||
#ifdef USE_KART
|
||||
|
||||
+186
-447
File diff suppressed because it is too large.
Load diff
+3
-116
@@ -288,43 +288,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
if (special->flags & MF_BOSS && special->flags2 & MF2_FRET)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_TouchSpecial(special, toucher) || P_MobjWasRemoved(special))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (special->flags & MF_BOSS)
|
||||
{
|
||||
/*if (special->type == MT_BLACKEGGMAN)
|
||||
{
|
||||
P_DamageMobj(toucher, special, special, 1); // ouch
|
||||
return;
|
||||
}
|
||||
|
||||
if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||
|| (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
|
||||
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
||||
{
|
||||
if (P_MobjFlip(toucher)*toucher->momz < 0)
|
||||
toucher->momz = -toucher->momz;
|
||||
toucher->momx = -toucher->momx;
|
||||
toucher->momy = -toucher->momy;
|
||||
P_DamageMobj(special, toucher, toucher, 1);
|
||||
}
|
||||
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|
||||
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP)))
|
||||
&& player->charability == CA_FLY
|
||||
&& (player->powers[pw_tailsfly]
|
||||
|| (toucher->state >= &states[S_PLAY_SPC1] && toucher->state <= &states[S_PLAY_SPC4]))) // Tails can shred stuff with his propeller.
|
||||
{
|
||||
toucher->momz = -toucher->momz/2;
|
||||
|
||||
P_DamageMobj(special, toucher, toucher, 1);
|
||||
}
|
||||
// SRB2kart - Removed: No more fly states
|
||||
else*/
|
||||
P_DamageMobj(toucher, special, special, 1);
|
||||
|
||||
P_DamageMobj(toucher, special, special, 1);
|
||||
return;
|
||||
}
|
||||
else if ((special->flags & MF_ENEMY) && !(special->flags & MF_MISSILE)
|
||||
@@ -2163,10 +2132,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
target->flags2 &= ~(MF2_SKULLFLY|MF2_NIGHTSPULL);
|
||||
target->health = 0; // This makes it easy to check if something's dead elsewhere.
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_MobjDeath(target, inflictor, source) || P_MobjWasRemoved(target))
|
||||
return;
|
||||
#endif
|
||||
|
||||
// SRB2kart
|
||||
// I wish I knew a better way to do this
|
||||
@@ -3129,11 +3096,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
|
||||
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
||||
{
|
||||
player_t *player;
|
||||
#ifdef HAVE_BLUA
|
||||
boolean force = false;
|
||||
#else
|
||||
static const boolean force = false;
|
||||
#endif
|
||||
|
||||
if (objectplacing)
|
||||
return false;
|
||||
@@ -3153,7 +3116,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Everything above here can't be forced.
|
||||
if (!metalrecording)
|
||||
{
|
||||
@@ -3167,7 +3129,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
else if (shouldForce == 2)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!force)
|
||||
{
|
||||
@@ -3201,10 +3162,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
if (!force && target->fuse) // Invincible
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if (target->health > 1)
|
||||
{
|
||||
@@ -3229,21 +3188,17 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
if (!force && target->flags2 & MF2_FRET) // Currently flashing from being hit
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if (target->health > 1)
|
||||
target->flags2 |= MF2_FRET;
|
||||
}
|
||||
#ifdef HAVE_BLUA
|
||||
else if (target->flags & MF_ENEMY)
|
||||
{
|
||||
if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
player = target->player;
|
||||
|
||||
@@ -3269,18 +3224,16 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
|| (G_GametypeHasTeams() && target->player->ctfteam == source->player->ctfteam)))
|
||||
return false; // Don't run eachother over in special stages and team games and such
|
||||
}
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
if (LUAh_MobjDamage(target, inflictor, source, damage))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
P_NiGHTSDamage(target, source); // -5s :(
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA // Add this back here for ACTUAL NORMAL DAMAGE. The funny shit is that the player is barely ever "actually" damaged.
|
||||
if (LUAh_MobjDamage(target, inflictor, source, damage))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if (!force && inflictor && (inflictor->flags & MF_FIRE))
|
||||
{
|
||||
@@ -3343,72 +3296,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/* // SRB2kart - don't need these
|
||||
else if (metalrecording)
|
||||
{
|
||||
if (!inflictor)
|
||||
inflictor = source;
|
||||
if (inflictor && inflictor->flags & MF_ENEMY)
|
||||
{ // Metal Sonic destroy enemy !!
|
||||
P_KillMobj(inflictor, NULL, target);
|
||||
return false;
|
||||
}
|
||||
else if (inflictor && inflictor->flags & MF_MISSILE)
|
||||
return false; // Metal Sonic walk through flame !!
|
||||
else
|
||||
{ // Oh no! Metal Sonic is hit !!
|
||||
P_ShieldDamage(player, inflictor, source, damage);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (player->powers[pw_invulnerability] || player->powers[pw_flashing] // ignore bouncing & such in invulnerability
|
||||
|| (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player))))
|
||||
{
|
||||
if (force || (inflictor && (inflictor->flags & MF_MISSILE)
|
||||
&& (inflictor->flags2 & MF2_SUPERFIRE)
|
||||
&& player->powers[pw_super]))
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (!LUAh_MobjDamage(target, inflictor, source, damage))
|
||||
#endif
|
||||
P_SuperDamage(player, inflictor, source, damage);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
#ifdef HAVE_BLUA
|
||||
else if (LUAh_MobjDamage(target, inflictor, source, damage))
|
||||
return true;
|
||||
#endif
|
||||
else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield
|
||||
{
|
||||
P_ShieldDamage(player, inflictor, source, damage);
|
||||
damage = 0;
|
||||
}
|
||||
else if (player->mo->health > 1) // No shield but have rings.
|
||||
{
|
||||
damage = player->mo->health - 1;
|
||||
P_RingDamage(player, inflictor, source, damage);
|
||||
}
|
||||
else // No shield, no rings, no invincibility.
|
||||
{
|
||||
// To reduce griefing potential, don't allow players to be killed
|
||||
// by friendly fire. Spilling their rings and other items is enough.
|
||||
if (force || !(G_GametypeHasTeams()
|
||||
&& source && source->player && (source->player->ctfteam == player->ctfteam)
|
||||
&& cv_friendlyfire.value))
|
||||
{
|
||||
damage = 1;
|
||||
P_KillPlayer(player, source, damage);
|
||||
}
|
||||
else
|
||||
{
|
||||
damage = 0;
|
||||
P_ShieldDamage(player, inflictor, source, damage);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
|
||||
{
|
||||
|
||||
@@ -596,7 +596,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
return true; // the line doesn't cross between either pair of opposite corners
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
{
|
||||
UINT8 shouldCollide = LUAh_MobjCollide(thing, tmthing); // checks hook for thing's type
|
||||
if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing))
|
||||
@@ -615,7 +614,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
else if (shouldCollide == 2)
|
||||
return true; // force no collide
|
||||
}
|
||||
#endif
|
||||
|
||||
// When solid spikes move, assume they just popped up and teleport things on top of them to hurt.
|
||||
if (tmthing->type == MT_SPIKE && tmthing->flags & MF_SOLID)
|
||||
|
||||
+10
-36
@@ -63,9 +63,8 @@ void P_RunCachedActions(void)
|
||||
{
|
||||
var1 = states[ac->statenum].var1;
|
||||
var2 = states[ac->statenum].var2;
|
||||
#ifdef HAVE_BLUA
|
||||
astate = &states[ac->statenum];
|
||||
#endif
|
||||
|
||||
if (ac->mobj && !P_MobjWasRemoved(ac->mobj)) // just in case...
|
||||
states[ac->statenum].action.acp1(ac->mobj);
|
||||
next = ac->next;
|
||||
@@ -214,9 +213,8 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
||||
{
|
||||
var1 = st->var1;
|
||||
var2 = st->var2;
|
||||
#ifdef HAVE_BLUA
|
||||
astate = st;
|
||||
#endif
|
||||
|
||||
st->action.acp1(mobj);
|
||||
|
||||
// woah. a player was removed by an action.
|
||||
@@ -285,9 +283,8 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
|
||||
{
|
||||
var1 = st->var1;
|
||||
var2 = st->var2;
|
||||
#ifdef HAVE_BLUA
|
||||
astate = st;
|
||||
#endif
|
||||
|
||||
st->action.acp1(mobj);
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return false;
|
||||
@@ -6120,12 +6117,12 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
// Special thinker for scenery objects
|
||||
if (mobj->flags & MF_SCENERY)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_MobjThinker(mobj))
|
||||
return;
|
||||
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
#endif
|
||||
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_HOOP:
|
||||
@@ -6817,10 +6814,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
mobj->fuse--;
|
||||
if (!mobj->fuse)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (!LUAh_MobjFuse(mobj))
|
||||
#endif
|
||||
P_RemoveMobj(mobj);
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -6831,7 +6826,6 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Check for a Lua thinker first
|
||||
if (!mobj->player)
|
||||
{
|
||||
@@ -6845,7 +6839,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// if it's pushable, or if it would be pushable other than temporary disablement, use the
|
||||
// separate thinker
|
||||
if (mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse))
|
||||
@@ -6863,7 +6857,6 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
}
|
||||
else if (mobj->flags & MF_BOSS)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_BossThinker(mobj))
|
||||
{
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
@@ -6872,23 +6865,13 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
else if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
else
|
||||
#endif
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_EGGMOBILE:
|
||||
if (mobj->health < mobj->info->damage+1 && leveltime & 1 && mobj->health > 0)
|
||||
P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SMOKE);
|
||||
if (mobj->flags2 & MF2_SKULLFLY)
|
||||
#if 1
|
||||
P_SpawnGhostMobj(mobj);
|
||||
#else
|
||||
{
|
||||
mobj_t *spawnmobj;
|
||||
spawnmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->info->painchance);
|
||||
P_SetTarget(&spawnmobj->target, mobj);
|
||||
spawnmobj->color = SKINCOLOR_GREY;
|
||||
}
|
||||
#endif
|
||||
P_Boss1Thinker(mobj);
|
||||
break;
|
||||
case MT_EGGMOBILE2:
|
||||
@@ -8833,9 +8816,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
fixed_t x, y, z;
|
||||
mobj_t *flagmo, *newmobj;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (!LUAh_MobjFuse(mobj) && !P_MobjWasRemoved(mobj))
|
||||
#endif
|
||||
switch (mobj->type)
|
||||
{
|
||||
// gargoyle and snowman handled in P_PushableThinker, not here
|
||||
@@ -9422,7 +9403,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
|
||||
mobj->colorized = false;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// DANGER! This can cause P_SpawnMobj to return NULL!
|
||||
// Avoid using P_RemoveMobj on the newly created mobj in "MobjSpawn" Lua hooks!
|
||||
if (LUAh_MobjSpawn(mobj))
|
||||
@@ -9433,7 +9413,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
else if (P_MobjWasRemoved(mobj))
|
||||
return NULL;
|
||||
else
|
||||
#endif
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE:
|
||||
@@ -9755,9 +9734,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||
{
|
||||
var1 = st->var1;
|
||||
var2 = st->var2;
|
||||
#ifdef HAVE_BLUA
|
||||
astate = st;
|
||||
#endif
|
||||
|
||||
st->action.acp1(mobj);
|
||||
// DANGER! This can cause P_SpawnMobj to return NULL!
|
||||
// Avoid using MF_RUNSPAWNFUNC on mobjs whose spawn state expects target or tracer to already be set!
|
||||
@@ -9870,9 +9848,8 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster)
|
||||
{
|
||||
var1 = st->var1;
|
||||
var2 = st->var2;
|
||||
#ifdef HAVE_BLUA
|
||||
astate = st;
|
||||
#endif
|
||||
|
||||
st->action.acp1(mobj);
|
||||
// DANGER! This is the ONLY way for P_SpawnMobj to return NULL!
|
||||
// Avoid using MF_RUNSPAWNFUNC on mobjs whose spawn state expects target or tracer to already be set!
|
||||
@@ -9969,16 +9946,13 @@ size_t iquehead, iquetail;
|
||||
void P_RemoveMobj(mobj_t *mobj)
|
||||
{
|
||||
I_Assert(mobj != NULL);
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return; // something already removing this mobj.
|
||||
|
||||
mobj->thinker.function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing.
|
||||
LUAh_MobjRemoved(mobj);
|
||||
mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker; // needed for P_UnsetThingPosition, etc. to work.
|
||||
#else
|
||||
I_Assert(!P_MobjWasRemoved(mobj));
|
||||
#endif
|
||||
|
||||
// Rings only, please!
|
||||
if (mobj->spawnpoint &&
|
||||
|
||||
+2
-5
@@ -3490,10 +3490,8 @@ void P_SaveNetGame(void)
|
||||
P_NetArchiveThinkers();
|
||||
P_NetArchiveSpecials();
|
||||
}
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_Archive();
|
||||
#endif
|
||||
|
||||
LUA_Archive();
|
||||
WRITEUINT8(save_p, 0x1d); // consistency marker
|
||||
}
|
||||
|
||||
@@ -3537,9 +3535,8 @@ boolean P_LoadNetGame(void)
|
||||
P_RelinkPointers();
|
||||
P_FinishMobjs();
|
||||
}
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
LUA_UnArchive();
|
||||
#endif
|
||||
|
||||
// This is stupid and hacky, but maybe it'll work!
|
||||
P_SetRandSeed(P_GetInitSeed());
|
||||
|
||||
@@ -2890,9 +2890,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||
I_UpdateNoVsync();
|
||||
}*/
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_InvalidateLevel();
|
||||
#endif
|
||||
|
||||
for (ss = sectors; sectors+numsectors != ss; ss++)
|
||||
{
|
||||
@@ -3307,9 +3305,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||
G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1);
|
||||
}
|
||||
P_PreTicker(2);
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_MapLoad();
|
||||
#endif
|
||||
}
|
||||
|
||||
G_AddMapToBuffer(gamemap-1);
|
||||
|
||||
@@ -3111,14 +3111,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
}
|
||||
|
||||
case 443: // Calls a named Lua function
|
||||
#ifdef HAVE_BLUA
|
||||
if (line->text)
|
||||
LUAh_LinedefExecute(line, mo, callsec);
|
||||
else
|
||||
CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in the front texture fields)\n", sizeu1(line-lines));
|
||||
#else
|
||||
CONS_Alert(CONS_ERROR, "The map is trying to run a Lua script, but this exe was not compiled with Lua support!\n");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 444: // Earthquake camera
|
||||
|
||||
@@ -254,9 +254,7 @@ void P_RemoveThinkerDelayed(void *pthinker)
|
||||
//
|
||||
void P_RemoveThinker(thinker_t *thinker)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_InvalidateUserdata(thinker);
|
||||
#endif
|
||||
thinker->function.acp1 = P_RemoveThinkerDelayed;
|
||||
}
|
||||
|
||||
@@ -661,13 +659,10 @@ void P_Ticker(boolean run)
|
||||
ps_lua_mobjhooks.value.i = 0;
|
||||
ps_checkposition_calls.value.i = 0;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
PS_START_TIMING(ps_lua_prethinkframe_time);
|
||||
LUAh_PreThinkFrame();
|
||||
PS_STOP_TIMING(ps_lua_prethinkframe_time);
|
||||
|
||||
#endif
|
||||
|
||||
PS_START_TIMING(ps_playerthink_time);
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
@@ -679,12 +674,6 @@ void P_Ticker(boolean run)
|
||||
if (!demo.playback) // Don't increment if a demo is playing.
|
||||
totalplaytime++;
|
||||
|
||||
/*if (!useNightsSS && G_IsSpecialStage(gamemap))
|
||||
P_DoSpecialStageStuff();
|
||||
|
||||
if (runemeraldmanager)
|
||||
P_EmeraldManager(); // Power stone mode*/
|
||||
|
||||
if (run)
|
||||
{
|
||||
PS_START_TIMING(ps_thinkertime);
|
||||
@@ -696,11 +685,9 @@ void P_Ticker(boolean run)
|
||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
P_PlayerAfterThink(&players[i]);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
PS_START_TIMING(ps_lua_thinkframe_time);
|
||||
LUAh_ThinkFrame();
|
||||
PS_STOP_TIMING(ps_lua_thinkframe_time);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Run shield positioning
|
||||
@@ -825,13 +812,9 @@ void P_Ticker(boolean run)
|
||||
&& server) // Remember: server uses it for mapchange, but EVERYONE ticks down for the animation
|
||||
D_MapChange(gamemap, gametype, encoremode, true, 0, false, false);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
PS_START_TIMING(ps_lua_postthinkframe_time);
|
||||
LUAh_PostThinkFrame();
|
||||
PS_STOP_TIMING(ps_lua_postthinkframe_time);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// Always move the camera.
|
||||
@@ -891,9 +874,7 @@ void P_PreTicker(INT32 frames)
|
||||
|
||||
R_UpdateMobjInterpolators();
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PreThinkFrame();
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
@@ -918,22 +899,15 @@ void P_PreTicker(INT32 frames)
|
||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
P_PlayerAfterThink(&players[i]);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_ThinkFrame();
|
||||
#endif
|
||||
|
||||
// Run shield positioning
|
||||
//P_RunShields();
|
||||
P_RunOverlays();
|
||||
|
||||
P_RunShadows();
|
||||
|
||||
P_UpdateSpecials();
|
||||
P_RespawnSpecials();
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PostThinkFrame();
|
||||
#endif
|
||||
|
||||
R_UpdateLevelInterpolators();
|
||||
R_UpdateViewInterpolation();
|
||||
|
||||
@@ -4326,9 +4326,7 @@ void P_PlayerThink(player_t *player)
|
||||
}
|
||||
if (player->playerstate == PST_REBORN)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerThink(player);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -4435,9 +4433,7 @@ void P_PlayerThink(player_t *player)
|
||||
|
||||
if (player->playerstate == PST_DEAD)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerThink(player);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -4503,9 +4499,7 @@ void P_PlayerThink(player_t *player)
|
||||
else
|
||||
player->mo->flags2 &= ~MF2_SHADOW;
|
||||
P_DeathThink(player);
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerThink(player);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4670,9 +4664,7 @@ void P_PlayerThink(player_t *player)
|
||||
|
||||
if (!player->mo)
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerThink(player);
|
||||
#endif
|
||||
return; // P_MovePlayer removed player->mo.
|
||||
}
|
||||
|
||||
@@ -4856,9 +4848,7 @@ void P_PlayerThink(player_t *player)
|
||||
if (rendermode != render_none)
|
||||
DoABarrelRoll(player);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerThink(player);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+2
-4
@@ -30,9 +30,7 @@
|
||||
#include "m_cond.h" // for conditionsets
|
||||
#include "m_menu.h" // bird music stuff
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#include "lua_hook.h" // MusicChange hook
|
||||
#endif
|
||||
|
||||
#ifdef HW3SOUND
|
||||
// 3D Sound Interface
|
||||
@@ -1996,10 +1994,10 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||
return;
|
||||
|
||||
strncpy(newmusic, mmusic, 6);
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms))
|
||||
return;
|
||||
#endif
|
||||
|
||||
newmusic[6] = 0;
|
||||
|
||||
// No Music (empty string)
|
||||
|
||||
+3
-1208
File diff suppressed because it is too large.
Load diff
+1
-8
@@ -222,7 +222,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
|
||||
static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum)
|
||||
{
|
||||
UINT16 posStart, posEnd;
|
||||
#ifdef HAVE_BLUA
|
||||
|
||||
posStart = W_CheckNumForFolderStartPK3("Lua/", wadnum, 0);
|
||||
if (posStart != INT16_MAX)
|
||||
{
|
||||
@@ -230,7 +230,6 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum)
|
||||
for (; posStart < posEnd; posStart++)
|
||||
LUA_LoadLump(wadnum, posStart);
|
||||
}
|
||||
#endif
|
||||
|
||||
posStart = W_CheckNumForFolderStartPK3("SOC/", wadnum, 0);
|
||||
if (posStart != INT16_MAX)
|
||||
@@ -255,7 +254,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum)
|
||||
{
|
||||
UINT16 lump;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Find Lua scripts before SOCs to allow new A_Actions in SOC editing.
|
||||
{
|
||||
lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo;
|
||||
@@ -263,7 +261,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum)
|
||||
if (memcmp(lump_p->name,"LUA_",4)==0)
|
||||
LUA_LoadLump(wadnum, lump);
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo;
|
||||
@@ -770,11 +767,9 @@ UINT16 W_InitFile(const char *filename, boolean local)
|
||||
case RET_SOC:
|
||||
lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "OBJCTCFG");
|
||||
break;
|
||||
#ifdef HAVE_BLUA
|
||||
case RET_LUA:
|
||||
lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "LUA_INIT");
|
||||
break;
|
||||
#endif
|
||||
case RET_PK3:
|
||||
lumpinfo = ResGetLumpsZip(handle, &numlumps);
|
||||
break;
|
||||
@@ -842,11 +837,9 @@ UINT16 W_InitFile(const char *filename, boolean local)
|
||||
CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfile->filename);
|
||||
DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0);
|
||||
break;
|
||||
#ifdef HAVE_BLUA
|
||||
case RET_LUA:
|
||||
LUA_LoadLump(numwadfiles - 1, 0);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -125,11 +125,8 @@ static INT32 foundAnimVoteWideFrames = 0;
|
||||
|
||||
intertype_t intertype = int_none;
|
||||
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
static huddrawlist_h luahuddrawlist_intermission = NULL;
|
||||
static huddrawlist_h luahuddrawlist_vote = NULL;
|
||||
#endif
|
||||
|
||||
static void Y_FollowIntermission(void);
|
||||
static void Y_UnloadData(void);
|
||||
@@ -675,14 +672,12 @@ dotimer:
|
||||
if (cv_scrambleonchange.value && cv_teamscramble.value && (intertic/TICRATE % 2 == 0))
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, hilicol, M_GetText("Teams will be scrambled next round!"));
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (renderisnewtic)
|
||||
{
|
||||
LUA_HUD_ClearDrawList(luahuddrawlist_intermission);
|
||||
LUAh_IntermissionHUD(luahuddrawlist_intermission);
|
||||
}
|
||||
LUA_HUD_DrawList(luahuddrawlist_intermission);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
@@ -710,22 +705,10 @@ void Y_Ticker(void)
|
||||
if (paused || P_AutoPause())
|
||||
return;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_IntermissionThinker();
|
||||
#endif
|
||||
|
||||
intertic++;
|
||||
|
||||
// Team scramble code for team match and CTF.
|
||||
// Don't do this if we're going to automatically scramble teams next round.
|
||||
/*if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server)
|
||||
{
|
||||
// If we run out of time in intermission, the beauty is that
|
||||
// the P_Ticker() team scramble code will pick it up.
|
||||
if ((intertic % (TICRATE/7)) == 0)
|
||||
P_DoTeamscrambling();
|
||||
}*/
|
||||
|
||||
// multiplayer uses timer (based on cv_inttime)
|
||||
if (timer)
|
||||
{
|
||||
@@ -944,11 +927,6 @@ void Y_StartIntermission(void)
|
||||
mapvisited[gamemap-1] |= MV_BEATEN;
|
||||
if (ALL7EMERALDS(emeralds))
|
||||
mapvisited[gamemap-1] |= MV_ALLEMERALDS;
|
||||
/*if (ultimatemode)
|
||||
mapvisited[gamemap-1] |= MV_ULTIMATE;
|
||||
if (data.coop.gotperfbonus)
|
||||
mapvisited[gamemap-1] |= MV_PERFECT;*/
|
||||
|
||||
if (modeattacking == ATTACKING_RECORD)
|
||||
Y_UpdateRecordReplays();
|
||||
}
|
||||
@@ -970,10 +948,8 @@ void Y_StartIntermission(void)
|
||||
usebuffer = true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_HUD_DestroyDrawList(luahuddrawlist_intermission);
|
||||
luahuddrawlist_intermission = LUA_HUD_CreateDrawList();
|
||||
#endif
|
||||
}
|
||||
|
||||
// ======
|
||||
@@ -1375,14 +1351,12 @@ void Y_VoteDrawer(void)
|
||||
|
||||
lastvotetic = votetic;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (renderisnewtic)
|
||||
{
|
||||
LUA_HUD_ClearDrawList(luahuddrawlist_vote);
|
||||
LUAh_VoteHUD(luahuddrawlist_vote);
|
||||
}
|
||||
LUA_HUD_DrawList(luahuddrawlist_vote);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1427,9 +1401,7 @@ void Y_VoteTicker(void)
|
||||
if (paused || P_AutoPause() || !voteclient.loaded)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_VoteThinker();
|
||||
#endif
|
||||
|
||||
votetic++;
|
||||
|
||||
@@ -1715,10 +1687,8 @@ void Y_StartVote(void)
|
||||
|
||||
voteclient.loaded = true;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_HUD_DestroyDrawList(luahuddrawlist_vote);
|
||||
luahuddrawlist_vote = LUA_HUD_CreateDrawList();
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user