aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/clientchathooks.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 16:42:33 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 16:42:33 +0100
commit5a58dd1c05e943d6b440bea5b4a6ae80ce16841e (patch)
tree9ea18142c2e2885b990671c04db4786aa05f86f3 /NorthstarDedicatedTest/clientchathooks.cpp
parent77a1195d77034c00959dfd030e2eb7a57d58a88d (diff)
downloadNorthstarLauncher-5a58dd1c05e943d6b440bea5b4a6ae80ce16841e.tar.gz
NorthstarLauncher-5a58dd1c05e943d6b440bea5b4a6ae80ce16841e.zip
refactor some squirrel stuff and ingame compilation error message
Diffstat (limited to 'NorthstarDedicatedTest/clientchathooks.cpp')
-rw-r--r--NorthstarDedicatedTest/clientchathooks.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/NorthstarDedicatedTest/clientchathooks.cpp b/NorthstarDedicatedTest/clientchathooks.cpp
index b6cf56ac..d666072e 100644
--- a/NorthstarDedicatedTest/clientchathooks.cpp
+++ b/NorthstarDedicatedTest/clientchathooks.cpp
@@ -24,7 +24,7 @@ static void CHudChat__AddGameLineHook(void* self, const char* message, int inbox
return;
}
- if (g_ClientSquirrelManager->setupfunc("CHudChat_ProcessMessageStartThread") != SQRESULT_ERROR)
+ if (g_pClientSquirrel->setupfunc("CHudChat_ProcessMessageStartThread") != SQRESULT_ERROR)
{
int senderId = inboxId & CUSTOM_MESSAGE_INDEX_MASK;
bool isAnonymous = senderId == 0;
@@ -39,12 +39,12 @@ static void CHudChat__AddGameLineHook(void* self, const char* message, int inbox
payload = message + 1;
}
- g_ClientSquirrelManager->pusharg((int)senderId - 1);
- g_ClientSquirrelManager->pusharg(payload);
- g_ClientSquirrelManager->pusharg(isTeam);
- g_ClientSquirrelManager->pusharg(isDead);
- g_ClientSquirrelManager->pusharg(type);
- g_ClientSquirrelManager->call(5);
+ g_pClientSquirrel->pusharg((int)senderId - 1);
+ g_pClientSquirrel->pusharg(payload);
+ g_pClientSquirrel->pusharg(isTeam);
+ g_pClientSquirrel->pusharg(isDead);
+ g_pClientSquirrel->pusharg(type);
+ g_pClientSquirrel->call(5);
}
else
{
@@ -58,8 +58,8 @@ static void CHudChat__AddGameLineHook(void* self, const char* message, int inbox
// void NSChatWrite( int context, string str )
static SQRESULT SQ_ChatWrite(void* sqvm)
{
- int context = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
- const char* str = g_ClientSquirrelManager->sq_getstring(sqvm, 2);
+ int context = g_pClientSquirrel->sq_getinteger(sqvm, 1);
+ const char* str = g_pClientSquirrel->sq_getstring(sqvm, 2);
LocalChatWriter((LocalChatWriter::Context)context).Write(str);
return SQRESULT_NOTNULL;
@@ -68,8 +68,8 @@ static SQRESULT SQ_ChatWrite(void* sqvm)
// void NSChatWriteRaw( int context, string str )
static SQRESULT SQ_ChatWriteRaw(void* sqvm)
{
- int context = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
- const char* str = g_ClientSquirrelManager->sq_getstring(sqvm, 2);
+ int context = g_pClientSquirrel->sq_getinteger(sqvm, 1);
+ const char* str = g_pClientSquirrel->sq_getstring(sqvm, 2);
LocalChatWriter((LocalChatWriter::Context)context).InsertText(str);
return SQRESULT_NOTNULL;
@@ -78,8 +78,8 @@ static SQRESULT SQ_ChatWriteRaw(void* sqvm)
// void NSChatWriteLine( int context, string str )
static SQRESULT SQ_ChatWriteLine(void* sqvm)
{
- int context = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
- const char* str = g_ClientSquirrelManager->sq_getstring(sqvm, 2);
+ int context = g_pClientSquirrel->sq_getinteger(sqvm, 1);
+ const char* str = g_pClientSquirrel->sq_getstring(sqvm, 2);
LocalChatWriter((LocalChatWriter::Context)context).WriteLine(str);
return SQRESULT_NOTNULL;
@@ -90,7 +90,7 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientChatHooks, ClientSquirrel, (HMOD
HookEnabler hook;
ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x22E580, &CHudChat__AddGameLineHook, reinterpret_cast<LPVOID*>(&CHudChat__AddGameLine));
- g_ClientSquirrelManager->AddFuncRegistration("void", "NSChatWrite", "int context, string text", "", SQ_ChatWrite);
- g_ClientSquirrelManager->AddFuncRegistration("void", "NSChatWriteRaw", "int context, string text", "", SQ_ChatWriteRaw);
- g_ClientSquirrelManager->AddFuncRegistration("void", "NSChatWriteLine", "int context, string text", "", SQ_ChatWriteLine);
+ g_pClientSquirrel->AddFuncRegistration("void", "NSChatWrite", "int context, string text", "", SQ_ChatWrite);
+ g_pClientSquirrel->AddFuncRegistration("void", "NSChatWriteRaw", "int context, string text", "", SQ_ChatWriteRaw);
+ g_pClientSquirrel->AddFuncRegistration("void", "NSChatWriteLine", "int context, string text", "", SQ_ChatWriteLine);
})