James R
8c237ae452
Replace LUA_PushLightUserdata with LUA_PushUserdata
...
See c92378fa and a7e20f70 . I didn't realize that light
userdata's metatable is shared--like numbers or strings.
So it cannot be paired with a metatable.
I also made a few minor tweaks to Lua cvars, other than
accounting for the double pointer in the userdata.
2022-03-18 12:54:22 +00:00
toaster
fcb6a4e1ab
Disable the vanilla-sourced "keepbody" (rejointimeout) feature.
2022-03-14 16:33:03 +00:00
Sally Coolatta
9d7ec0ab8f
Merge SRB2 next
...
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
GoldenTails
66aac9bd7a
Have Lua_OnChange restore the stack to what it was before it was called.
...
So we don't get Luas with access to LUA_GetErrorMessage.
2020-12-20 21:43:14 -06:00
LJ Sonic
079df8df4d
Merge branch 'fix-stacktrace' of https://git.do.srb2.org/STJr/SRB2.git into next
...
# Conflicts:
# src/dehacked.c
# src/dehacked.h
2020-11-29 21:54:15 +01:00
Louis-Antoine
05ae84bd09
Fix Lua stacktrace not showing in various situations
2020-11-13 19:12:25 +01:00
Sally Coolatta
fc934b38e1
Merge public next
2020-11-10 15:32:48 -05:00
James R
9992190afb
Don't let Lua cvar setting functions work on CV_NOLUA vars
2020-11-09 18:54:00 -08:00
James R
758a43385d
Add CV_Set, CV_SetValue, CV_StealthSet, CV_StealthSetValue and CV_AddValue to Lua
...
CV_SetValue merged with CV_Set (same with CV_StealthSetValue and CV_StealthSet).
2020-11-05 20:23:43 -08:00
James R
2ba99dac90
Improve COM_AddCommand boolean deprecated warning
2020-11-05 20:16:28 -08:00
James R
7e9922febf
COM_LOCAL makes your commands NetXCmd free, FUCK NetXCmd
2020-11-05 20:16:28 -08:00
James R
d996a6a3b9
Fuck magic numbers; COM_ flags for Lua commands!
2020-11-05 20:16:26 -08:00
Sally Coolatta
7c2bd0d1c2
Merge remote-tracking branch 'srb2/next' into the-scary-22-merge
2020-10-24 20:50:58 -04:00
James R
f99cdc6b99
Add CV_Set, CV_SetValue, CV_StealthSet, CV_StealthSetValue and CV_AddValue to Lua
...
CV_SetValue merged with CV_Set (same with CV_StealthSetValue and CV_StealthSet).
2020-10-20 16:08:34 -07:00
Sally Coolatta
a50a9a1843
Lots of splitscreen fixes
...
LOTS of stuff I changed to use arrays instead of constantly duplicated code
2020-08-10 23:38:32 -04:00
Sally Coolatta
e296e1309a
YAY, round 2
2020-08-09 21:02:56 -04:00
Sally Coolatta
7e9efd4e29
Merge lua_consolelib.c
...
Properly supports 3P/4P commands while we're at it too
2020-08-05 09:58:12 -04:00
GoldenTails
1faea0d4b6
Make the player optional for COM_BufInsertText and COM_BufAddText.
...
When no player is supplied, the command will run for all players.
2020-07-26 12:08:33 -05:00
kaysrishaq
de3b0c36c8
minor lua fixes
...
minor lua fixes
2020-07-14 01:34:57 -04:00
Sally Coolatta
63917ffccc
The start of the scary 2.2 merge
...
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
Sally Coolatta
15d18640de
Merge remote-tracking branch 'public/master' into merge-12
2020-05-12 03:16:14 -04:00
James R
7ff3e7f18b
Merge branch 'lightmemedata' into 'next'
...
Cvars returned by CV_FindVar did not work with userdataType
See merge request STJr/SRB2!754
2020-04-09 19:48:39 -04:00
Louis-Antoine
46df2b9551
Use HAVE_BLUA as fuel for my fireplace
2020-03-19 18:36:14 +01:00
Latapostrophe
e801057559
Expose CV_FindVar to Lua
2020-03-10 18:12:20 +01:00
James R
4f40edaf01
Maybe localdisplayplayers is a bad idea
2020-02-23 23:21:20 -08:00
James R
f164320c88
Make the order of displayplayers irrelevant and split splitscreen into splitscreen and r_splitscreen
2020-02-23 23:20:20 -08:00
James R
2274129f57
Update copyright year to 2020
2020-02-19 14:08:45 -08:00
James R
0f3a44887c
LUA_PushLightUserdata takes the fun out of lib_cvFindVar
2020-02-02 15:19:19 -08:00
Louis-Antoine
a997683d1c
Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into keep-body
...
# Conflicts:
# src/g_game.c
# src/p_setup.c
2020-01-22 03:57:22 +01:00
Louis-Antoine
c2682ac1b6
Let clients rejoin the server without losing their status
...
This is accomplished by simply preserving
the player's body after disconnecting.
Bodies will despawn after the number of minutes
specified by the "rejointimeout" console variable (float).
A value of 0 disables the feature completely.
Clients rejoining are identified by their IP address,
and may rejoin even if the server is full or joins are disabled,
for as long as their body remains.
From a technical standpoint, when the user disconnects,
the player they were controlling does not leave,
the underlying player_t just keeps working normally,
except it does not receive any input anymore.
When the user reconnects, they are simply "relinked"
to their player_t.
Those "soulless" players can be identified through
their "quittime" field, which is the number of tics
elapsed since the user disconnected, or zero
if still connected. "quittime" is exposed to Lua.
2020-01-22 03:05:08 +01:00
James R
7daf24fcb8
Merge remote-tracking branch 'origin/master' into next
2020-01-12 14:17:52 -08:00
LJ Sonic
fd18f1cb7f
Merge branch 'fix-node-player-mixups' into 'master'
...
Fix node player mixups
See merge request STJr/SRB2!684
2020-01-12 15:57:20 -05:00
Louis-Antoine
82876c2eff
Replace all instances of XD_KICK with a SendKick function
2020-01-12 19:43:04 +01:00
James R
40d080cfe1
Merge branch 'local-lua-commands' into 'next'
...
Local Lua commands + no magic numbers
See merge request STJr/SRB2!602
2020-01-08 16:14:30 -05:00
James R
7e0dd5bf02
Merge branch 'findvar' into 'next'
...
CV_FindVar for Lua
See merge request STJr/SRB2!583
2020-01-02 20:54:16 -05:00
James R
81bdd2d473
Merge remote-tracking branch 'origin/next' into local-lua-commands
2019-12-30 15:08:34 -08:00
James R
4a4fd1051b
Revert revert revert
...
This reverts commit 41a8bed879 .
This reverts commit e37e9b0f99 .
2019-12-30 12:31:53 -08:00
James R
b13b3f197f
Improve COM_AddCommand boolean deprecated warning
2019-12-29 21:09:07 -08:00
James R
c7821da6b6
COM_LOCAL makes your commands NetXCmd free, FUCK NetXCmd
2019-12-29 21:07:28 -08:00
James R
41a8bed879
No.
2019-12-29 21:02:42 -08:00
James R
2ab129b7bc
Fuck magic numbers; COM_ flags for Lua commands!
2019-12-29 21:00:38 -08:00
James R
e37e9b0f99
Bro player 2 can't use the console
2019-12-29 21:00:38 -08:00
James R
c92378fab7
Lua CV_FindVar function
...
(cherry picked from commit b5746c231d17cd7b58c6b633e242d5ad26ad7017)
2019-12-26 18:30:34 -08:00
James R
4100e43a9d
CV_NOLUA for when a cvar should not be changed via Lua
2019-12-26 18:15:19 -08:00
Steel Titanium
a5cdb0a4b3
Update copyright date on source files
2019-12-06 13:49:42 -05:00
Monster Iestyn
a7353a9835
Merge branch 'public_next'
...
# Conflicts:
# src/d_netfil.c
2019-08-25 18:18:59 +01:00
Monster Iestyn
fa76579a1b
Fixes for lib_cvRegisterVar (the Lua version of CV_RegisterVar):
...
* Make sure the consvar's properties are all initialised to zeros as defaults
* Error if the consvar is not given a name
* Error if the consvar has CV_CALL but no call function
* Error if the consvar has CV_NOINIT but not CV_CALL
2019-08-20 18:18:29 +01:00
toaster
3b99335605
* Strip the word "function" from INLEVEL error messages, since they're now shared between access and function cases.
...
* Move it into lua_script.h, so it's available to everything that needs it.
2019-07-30 17:57:57 +01:00
toaster
c659e3f26b
Fix lua scripts erroring on the title screen because they're run there but it's not counted as GS_LEVEL (aka #168 ).
2019-07-30 17:48:13 +01:00
TehRealSalt
089be795a2
Huge splitscreen refactor
...
Did not get to finish all refactoring or even compile this, I'll continue later
2019-04-18 03:08:11 -04:00