Skip to content

Commit

Permalink
Fixed m_takedamage values
Browse files Browse the repository at this point in the history
  • Loading branch information
azalty committed Sep 21, 2022
1 parent 64b42ba commit 8939591
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions addons/sourcemod/scripting/MyJailbreak/freeday.sp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
#pragma semicolon 1
#pragma newdecls required

// m_takedamage values
#define DAMAGE_NO 0
#define DAMAGE_EVENTS_ONLY 1 // Call damage functions, but don't modify health
#define DAMAGE_YES 2
#define DAMAGE_AIM 3

// Booleans
bool g_bIsFreeday = false;
bool g_bStartFreeday = false;
Expand Down Expand Up @@ -706,7 +712,7 @@ void StartEventRound(bool thisround)

if (IsPlayerAlive(i))
{
SetEntProp(i, Prop_Data, "m_takedamage", 0, 1);
SetEntProp(i, Prop_Data, "m_takedamage", DAMAGE_NO, 1);

SetEntityMoveType(i, MOVETYPE_NONE);
}
Expand Down Expand Up @@ -779,11 +785,11 @@ void PrepareDay()

if (!gc_bdamage.BoolValue)
{
SetEntProp(i, Prop_Data, "m_takedamage", 0, 1);
SetEntProp(i, Prop_Data, "m_takedamage", DAMAGE_NO, 1); // Disable damage received (godmode)
}
else
{
SetEntProp(i, Prop_Data, "m_takedamage", 1, 1);
SetEntProp(i, Prop_Data, "m_takedamage", DAMAGE_YES, 1); // Allow damage receive (no godmode, normal)
}

SetEntityMoveType(i, MOVETYPE_WALK);
Expand Down

0 comments on commit 8939591

Please sign in to comment.