Skip to content

Commit f271565

Browse files
committed
added starting recycler patch
1 parent a1b6257 commit f271565

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/Multiplayer.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ namespace ExtraUtilities::Lua::Multiplayer
3030

3131
// Set up stack for wrappuh call
3232
lua_getglobal(L, "BuildObject");
33-
33+
3434
// Handle the variadic args to BuildObject,
3535
// the function needs to be first so we shuffle
3636
// it's args to be on top
3737
int argC = lua_gettop(L);
38-
for (int i = 1; i < argC ; i++) // remember 1 based index!
38+
for (int i = 1; i < argC; i++) // remember 1 based index!
3939
{
4040
lua_pushvalue(L, i);
4141
}
@@ -85,7 +85,7 @@ namespace ExtraUtilities::Lua::Multiplayer
8585
{
8686
BZR::Multiplayer::UpdateLives();
8787
}
88-
88+
8989
return 0;
9090
}
9191

@@ -107,4 +107,10 @@ namespace ExtraUtilities::Lua::Multiplayer
107107
showScoreboard.Write(state);
108108
return 0;
109109
}
110+
111+
int DisableStartingRecycler(lua_State*)
112+
{
113+
skipStartingRecycler.Reload();
114+
return 0;
115+
}
110116
}

src/Multiplayer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ namespace ExtraUtilities::Lua::Multiplayer
3232
inline InlinePatch buildObjectAlwaysSync(0x005C833B, BasicPatch::NOP, 2, BasicPatch::Status::INACTIVE);
3333
inline Scanner myNetID(BZR::Multiplayer::myNetID, BasicScanner::Restore::DISABLED);
3434
inline Scanner showScoreboard(BZR::Multiplayer::showScoreboard);
35+
// This voodoo shellcode jumps to the end of the function just before the stack cookie is checked and skips building the rec
36+
inline InlinePatch skipStartingRecycler(0x0056EFA4, { 0xE9, 0x2C, 0x01, 0x00, 0x00, 0x90 }, BasicPatch::Status::INACTIVE);
3537

3638
int BuildAsyncObject(lua_State* L);
3739
int BuildSyncObject(lua_State* L);
@@ -43,4 +45,6 @@ namespace ExtraUtilities::Lua::Multiplayer
4345

4446
int GetShowScoreboard(lua_State* L);
4547
int SetShowScoreboard(lua_State* L);
48+
49+
int DisableStartingRecycler(lua_State*);
4650
}

src/luaexport.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ namespace ExtraUtilities::Lua
258258
{ "GetMyNetID", &Multiplayer::GetMyNetID },
259259
{ "GetShowScoreboard", &Multiplayer::GetShowScoreboard },
260260
{ "SetShowScoreboard", &Multiplayer::SetShowScoreboard },
261+
{ "DisableStartingRecycler", &Multiplayer::DisableStartingRecycler },
261262

262263
// Ordnance
263264
{ "GetCoeffBallistic", &Ordnance::GetCoeffBallistic },

0 commit comments

Comments
 (0)