diff --git a/code/cgame/cg_commands.cpp b/code/cgame/cg_commands.cpp index 1331d7df..170f9f88 100644 --- a/code/cgame/cg_commands.cpp +++ b/code/cgame/cg_commands.cpp @@ -1094,6 +1094,15 @@ Event EV_Client_Print "string", "Prints a string." ); +// Added in 2.0 +Event EV_Client_PrintDeathMsg +( + "printdeathmsg", + EV_DEFAULT, + "sssss", + "msg1, msg2, killer, victim, deathType", + "Prints a death message string. Used to allow death messages to appear in their correct language on client machines.." +); Event EV_Client_SetVolumetric ( "volumetric", @@ -1341,6 +1350,7 @@ CLASS_DECLARATION(Listener, ClientGameCommandManager, NULL) { {&EV_Client_SetClampVelocity, &ClientGameCommandManager::SetClampVel }, {&EV_Client_SetClampVelocityAxis, &ClientGameCommandManager::SetClampVelAxis }, {&EV_Client_Print, &ClientGameCommandManager::Print }, + {&EV_Client_PrintDeathMsg, &ClientGameCommandManager::PrintDeathMsg }, {&EV_Client_EyeLimits, &ClientGameCommandManager::SetEyeLimits }, {&EV_Client_EyeMovement, &ClientGameCommandManager::SetEyeMovement }, {&EV_Client_SFXStart, &ClientGameCommandManager::StartSFX }, @@ -1493,6 +1503,13 @@ void ClientGameCommandManager::Print(Event *ev) } } +void ClientGameCommandManager::PrintDeathMsg(Event* ev) +{ + if (current_entity) { + cgi.DPrintf("%d:%s\n", current_entity->entityNumber, ev->GetString(1).c_str()); + } +} + qboolean ClientGameCommandManager::IsBlockCommand(const str& name) { if (!str::icmp(name, "originspawn")) { diff --git a/code/cgame/cg_commands.h b/code/cgame/cg_commands.h index a0f1f3d0..60e39dec 100644 --- a/code/cgame/cg_commands.h +++ b/code/cgame/cg_commands.h @@ -764,6 +764,7 @@ private: void SpawnVSSSource(int count, int timealive); void EventViewKick(Event *ev); void Print(Event *ev); + void PrintDeathMsg(Event *ev); // Added in 2.0 void StartBlock(Event *ev); void EndBlock(Event *ev); void UpdateSpawnThing(spawnthing_t *ep);