Skip to content

Commit 8ff30b4

Browse files
committed
Revert "New entity trigger_bomb_reset (#796)"
This reverts commit 5dec3ba.
1 parent 889edc8 commit 8ff30b4

12 files changed

Lines changed: 2 additions & 149 deletions

File tree

regamedll/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ set(GAMEDLL_SRCS
228228
"dlls/API/CSPlayerItem.cpp"
229229
"dlls/addons/item_airbox.cpp"
230230
"dlls/addons/point_command.cpp"
231-
"dlls/addons/trigger_bomb_reset.cpp"
232231
"dlls/addons/trigger_random.cpp"
233232
"dlls/addons/trigger_setorigin.cpp"
234233
"dlls/wpn_shared/wpn_ak47.cpp"

regamedll/dlls/addons/trigger_bomb_reset.cpp

Lines changed: 0 additions & 39 deletions
This file was deleted.

regamedll/dlls/addons/trigger_bomb_reset.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

regamedll/dlls/player.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8028,7 +8028,6 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte
80288028
pWeaponBox->m_bIsBomb = true;
80298029
pWeaponBox->SetThink(&CWeaponBox::BombThink);
80308030
pWeaponBox->pev->nextthink = gpGlobals->time + 1.0f;
8031-
pWeaponBox->SetLastValidHeldC4Position(((CC4 *)pWeapon)->GetLastValidHeldPosition());
80328031

80338032
if (TheCSBots())
80348033
{

regamedll/dlls/weapons.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,24 +2181,6 @@ void CWeaponBox::SetObjectCollisionBox()
21812181
pev->absmax = pev->origin + Vector(16, 16, 16);
21822182
}
21832183

2184-
void CWeaponBox::ResetToLastValidPlayerHeldC4Position()
2185-
{
2186-
if (pev->origin == m_vecLastValidPlayerHeldC4Position)
2187-
{
2188-
return;
2189-
}
2190-
2191-
Vector const vecResetPos = m_vecLastValidPlayerHeldC4Position + Vector(0.0f, 0.0f, 8.0f);
2192-
Vector const angResetAng = Vector(0.0f, RANDOM_FLOAT(0.0f, 360.0f), 0.0f);
2193-
2194-
// Teleport
2195-
pev->velocity = Vector(0.0f, 0.0f, 0.0f);
2196-
pev->movetype = MOVETYPE_NONE;
2197-
pev->flags |= FL_ONGROUND;
2198-
pev->angles = angResetAng;
2199-
UTIL_SetOrigin(pev, vecResetPos);
2200-
}
2201-
22022184
char *CArmoury::m_ItemModels[] = {
22032185
"models/w_mp5.mdl",
22042186
"models/w_tmp.mdl",

regamedll/dlls/weapons.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,6 @@ class CWeaponBox: public CBaseEntity
483483
void SetModel_OrigFunc(const char *pszModelName);
484484
#endif
485485

486-
void SetLastValidHeldC4Position(const Vector &vecPositon) { m_vecLastValidPlayerHeldC4Position = vecPositon; }
487-
void ResetToLastValidPlayerHeldC4Position();
488-
489486
public:
490487
static TYPEDESCRIPTION m_SaveData[];
491488

@@ -494,9 +491,6 @@ class CWeaponBox: public CBaseEntity
494491
int m_rgAmmo[MAX_AMMO_SLOTS];
495492
int m_cAmmoTypes;
496493
bool m_bIsBomb;
497-
498-
private:
499-
Vector m_vecLastValidPlayerHeldC4Position;
500494
};
501495

502496

@@ -849,7 +843,6 @@ class CAWP: public CBasePlayerWeapon
849843

850844
const float C4_MAX_SPEED = 250.0f;
851845
const float C4_ARMING_ON_TIME = 3.0f;
852-
constexpr float WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL = 0.2f;
853846

854847
enum c4_e
855848
{
@@ -869,8 +862,6 @@ class CC4: public CBasePlayerWeapon
869862
virtual int GetItemInfo(ItemInfo *p);
870863
virtual BOOL Deploy();
871864
virtual void Holster(int skiplocal);
872-
virtual void AttachToPlayer(CBasePlayer* pPlayer);
873-
virtual void Think();
874865
virtual float GetMaxSpeed();
875866
virtual int iItemSlot() { return C4_SLOT; }
876867
virtual void PrimaryAttack();
@@ -884,16 +875,13 @@ class CC4: public CBasePlayerWeapon
884875
#endif
885876
}
886877

887-
Vector GetLastValidHeldPosition() const { return m_vecLastValidPlayerHeldPosition; }
888-
889878
public:
890879
bool m_bStartedArming;
891880
bool m_bBombPlacedAnimation;
892881
float m_fArmedTime;
893882

894883
private:
895884
bool m_bHasShield;
896-
Vector m_vecLastValidPlayerHeldPosition;
897885
};
898886

899887

regamedll/dlls/wpn_shared/wpn_c4.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -382,37 +382,3 @@ float CC4::GetMaxSpeed()
382382

383383
return C4_MAX_SPEED;
384384
}
385-
386-
void CC4::AttachToPlayer(CBasePlayer* pPlayer)
387-
{
388-
CBasePlayerWeapon::AttachToPlayer(pPlayer);
389-
390-
#ifdef REGAMEDLL_ADD
391-
SetThink(&CC4::Think);
392-
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;
393-
394-
if (pPlayer->IsPlayer() && pPlayer->IsAlive())
395-
{
396-
entvars_t* pevPlayer = pPlayer->pev;
397-
m_vecLastValidPlayerHeldPosition = pevPlayer->origin + pevPlayer->mins;
398-
}
399-
#endif
400-
}
401-
402-
void CC4::Think()
403-
{
404-
#ifdef REGAMEDLL_ADD
405-
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;
406-
407-
// If the bomb is held by an alive player standing on the ground, then we can use this
408-
// position as the last known valid position to respawn the bomb if it gets reset.
409-
410-
if (m_pPlayer && m_pPlayer->IsPlayer() && m_pPlayer->IsAlive() && (m_pPlayer->pev->flags & FL_ONGROUND))
411-
{
412-
entvars_t* pevPlayer = m_pPlayer->pev;
413-
m_vecLastValidPlayerHeldPosition = pevPlayer->origin + pevPlayer->mins;
414-
}
415-
#else
416-
CBasePlayerWeapon::Think();
417-
#endif
418-
}

regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,10 +2272,6 @@
22722272
]
22732273
]
22742274

2275-
@SolidClass base(Trigger) = trigger_bomb_reset : "Trigger bomb reset"
2276-
[
2277-
]
2278-
22792275
// Function entities
22802276
@SolidClass = func_bomb_target : "Bomb target zone"
22812277
[

regamedll/msvc/ReGameDLL.vcxproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug Play|Win32">
@@ -25,7 +25,6 @@
2525
<ItemGroup>
2626
<ClCompile Include="..\dlls\addons\item_airbox.cpp" />
2727
<ClCompile Include="..\dlls\addons\point_command.cpp" />
28-
<ClCompile Include="..\dlls\addons\trigger_bomb_reset.cpp" />
2928
<ClCompile Include="..\dlls\addons\trigger_random.cpp" />
3029
<ClCompile Include="..\dlls\addons\trigger_setorigin.cpp" />
3130
<ClCompile Include="..\dlls\airtank.cpp" />
@@ -617,7 +616,6 @@
617616
<ClInclude Include="..\dlls\activity.h" />
618617
<ClInclude Include="..\dlls\addons\item_airbox.h" />
619618
<ClInclude Include="..\dlls\addons\point_command.h" />
620-
<ClInclude Include="..\dlls\addons\trigger_bomb_reset.h" />
621619
<ClInclude Include="..\dlls\addons\trigger_random.h" />
622620
<ClInclude Include="..\dlls\addons\trigger_setorigin.h" />
623621
<ClInclude Include="..\dlls\airtank.h" />

regamedll/msvc/ReGameDLL.vcxproj.filters

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
44
<Filter Include="engine">
@@ -549,9 +549,6 @@
549549
<ClCompile Include="..\dlls\addons\point_command.cpp">
550550
<Filter>dlls\addons</Filter>
551551
</ClCompile>
552-
<ClCompile Include="..\dlls\addons\trigger_bomb_reset.cpp">
553-
<Filter>dlls\addons</Filter>
554-
</ClCompile>
555552
<ClCompile Include="..\public\FileSystem.cpp">
556553
<Filter>public</Filter>
557554
</ClCompile>
@@ -1052,8 +1049,5 @@
10521049
<ClInclude Include="..\dlls\addons\point_command.h">
10531050
<Filter>dlls\addons</Filter>
10541051
</ClInclude>
1055-
<ClInclude Include="..\dlls\addons\trigger_bomb_reset.h">
1056-
<Filter>dlls\addons</Filter>
1057-
</ClInclude>
10581052
</ItemGroup>
10591053
</Project>

0 commit comments

Comments
 (0)