Skip to content

Commit

Permalink
Fix "instant respawning" when dying to trigger_hurt (#815)
Browse files Browse the repository at this point in the history
Fix:
- Fixed an issue where spawned SI might be queued to the front when killed by `trigger_hurt`.
  • Loading branch information
jensewe committed Sep 8, 2024
1 parent 302db6b commit 45e7385
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Binary file modified addons/sourcemod/plugins/optional/l4d2_fix_spawn_order.smx
Binary file not shown.
14 changes: 11 additions & 3 deletions addons/sourcemod/scripting/l4d2_fix_spawn_order.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <left4dhooks>
#include <l4d2util_infected>

#define PLUGIN_VERSION "4.4.2"
#define PLUGIN_VERSION "4.4.3"

public Plugin myinfo =
{
Expand Down Expand Up @@ -145,11 +145,19 @@ void ToggleEvents(bool isEnable)
// 2. Return zombie class, based on the player state: ghost to the beginning, materialized to the end.
//

public void L4D_OnMaterializeFromGhost(int client)
public Action L4D_OnMaterializeFromGhostPre(int client)
{
PrintDebug("\x05%N \x05materialized \x01as (\x04%s\x01)", client, L4D2_InfectedNames[GetInfectedClass(client)]);

g_bPlayerSpawned[client] = true;
return Plugin_Continue;
}

public void L4D_OnMaterializeFromGhost_PostHandled(int client)
{
PrintDebug("\x05%N \x05got de-materialized because of other plugins' handling.", client);

g_bPlayerSpawned[client] = false;
}

void Event_PlayerTeam(Event event, const char[] name, bool dontBroadcast)
Expand Down

0 comments on commit 45e7385

Please sign in to comment.