Skip to content

Commit

Permalink
refactor: removed take damage flag
Browse files Browse the repository at this point in the history
  • Loading branch information
FeiRoN23 committed Jan 10, 2024
1 parent 6146a4e commit 7844bb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dlls/damagetrigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ void CDamageTrigger::Use(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE
void CDamageTrigger::giveDamage(entvars_t* selfInflictor, float flDamage)
{

if(selfInflictor->takedamage != DAMAGE_NO)
if(selfInflictor->health >= 35)
{
selfInflictor->dmg_take += flDamage;
selfInflictor->health -= flDamage;
selfInflictor->dmg_save = flDamage;
ALERT(at_console, "give damage ammount %g\n", flDamage);
}
if (selfInflictor->health <= 35)
if (selfInflictor->health < 35)
{
selfInflictor->takedamage = DAMAGE_NO;
ALERT(at_console, "No more damage given");
return;
}

if (selfInflictor->health <= 0)
Expand Down

0 comments on commit 7844bb6

Please sign in to comment.