[Dedicated] Implement event for chat

This commit is contained in:
momo5502 2017-06-28 21:30:31 +02:00
parent 81608fb782
commit 8dfbe47bc6
4 changed files with 16 additions and 3 deletions

View File

@ -74,7 +74,7 @@ namespace Components
}
}
const char* Dedicated::EvaluateSay(char* text)
const char* Dedicated::EvaluateSay(char* text, Game::gentity_t* player)
{
Dedicated::SendChat = true;
@ -85,6 +85,10 @@ namespace Components
++text;
}
Game::Scr_AddEntity(player);
Game::Scr_AddString(text + 1);
Game::Scr_NotifyLevel(Game::SL_GetString("say", 0), 2);
return text;
}
@ -97,9 +101,10 @@ namespace Components
push eax
pushad
push[esp + 100h + 28h]
push eax
call Dedicated::EvaluateSay
add esp, 4h
add esp, 8h
mov [esp + 20h], eax
popad

View File

@ -23,7 +23,7 @@ namespace Components
static void PostInitialization();
static void PostInitializationStub();
static const char* EvaluateSay(char* text);
static const char* EvaluateSay(char* text, Game::gentity_t* player);
static void PreSayStub();
static void PostSayStub();

View File

@ -223,11 +223,13 @@ namespace Game
Scr_ExecThread_t Scr_ExecThread = Scr_ExecThread_t(0x4AD0B0);
Scr_FreeThread_t Scr_FreeThread = Scr_FreeThread_t(0x4BD320);
Scr_AddEntity_t Scr_AddEntity = Scr_AddEntity_t(0x4BFB40);
Scr_AddString_t Scr_AddString = Scr_AddString_t(0x412310);
Scr_AddInt_t Scr_AddInt = Scr_AddInt_t(0x41D7D0);
Scr_AddFloat_t Scr_AddFloat = Scr_AddFloat_t(0x61E860);
Scr_AddObject_t Scr_AddObject = Scr_AddObject_t(0x430F40);
Scr_Notify_t Scr_Notify = Scr_Notify_t(0x4A4750);
Scr_NotifyLevel_t Scr_NotifyLevel = Scr_NotifyLevel_t(0x4D9C30);
Scr_ClearOutParams_t Scr_ClearOutParams = Scr_ClearOutParams_t(0x4386E0);

View File

@ -523,6 +523,9 @@ namespace Game
typedef void(__cdecl * RemoveRefToObject_t)(unsigned int id);
extern RemoveRefToObject_t RemoveRefToObject;
typedef void(__cdecl * Scr_AddEntity_t)(gentity_s const*);
extern Scr_AddEntity_t Scr_AddEntity;
typedef void(__cdecl * Scr_AddString_t)(const char* str);
extern Scr_AddString_t Scr_AddString;
@ -571,6 +574,9 @@ namespace Game
typedef void(__cdecl * Scr_Notify_t)(gentity_t *ent, unsigned __int16 stringValue, unsigned int paramcount);
extern Scr_Notify_t Scr_Notify;
typedef void(__cdecl * Scr_NotifyLevel_t)(unsigned __int16 stringValue, unsigned int paramcount);
extern Scr_NotifyLevel_t Scr_NotifyLevel;
typedef void(__cdecl * Scr_ClearOutParams_t)();
extern Scr_ClearOutParams_t Scr_ClearOutParams;