Skip to content

Commit

Permalink
Make plasma kill :D
Browse files Browse the repository at this point in the history
  • Loading branch information
M0REKZ committed May 15, 2024
1 parent ddd2afd commit 37ca38d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/engine/shared/variables_insta.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ MACRO_CONFIG_INT(SvKillingspreeKills, sv_killingspree_kills, 0, 0, 20, CFGFLAG_S
MACRO_CONFIG_INT(SvDamageNeededForKill, sv_damage_needed_for_kill, 4, 0, 5, CFGFLAG_SERVER, "Damage needed to kill")
MACRO_CONFIG_INT(SvAllowZoom, sv_allow_zoom, 0, 0, 1, CFGFLAG_SERVER, "allow ddnet clients to use the client side zoom feature")
MACRO_CONFIG_STR(SvSpawnWeapons, sv_spawn_weapons, 900, "grenade", CFGFLAG_SERVER, "possible values: grenade, laser")
MACRO_CONFIG_INT(SvPlasmaKills, sv_plasma_kills, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Plasma turret kills player")
/*
sv_chat_ratelimit_long_messages
Expand Down
5 changes: 5 additions & 0 deletions src/game/server/entities/plasma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
#include "character.h"

#include <engine/server.h>
#include <engine/shared/config.h>

#include <game/generated/protocol.h>
#include <game/mapitems.h>
#include <game/server/player.h>
#include <game/teamscore.h>

#include <game/server/gamecontext.h>
Expand Down Expand Up @@ -78,6 +81,8 @@ bool CPlasma::HitCharacter(CCharacter *pTarget)
GameServer()->CreateExplosion(
m_Pos, m_ForClientId, WEAPON_GRENADE, true, pTarget->Team(), pTarget->TeamMask());
}
if(g_Config.m_SvPlasmaKills)
pTarget->Die(pTarget->GetPlayer()->GetCid(), WEAPON_WORLD);
Reset();
return true;
}
Expand Down

0 comments on commit 37ca38d

Please sign in to comment.