Skip to content

Commit

Permalink
Revert "New entity trigger_bomb_reset (#796)"
Browse files Browse the repository at this point in the history
This reverts commit 5dec3ba.
  • Loading branch information
wopox1337 committed Mar 11, 2023
1 parent 889edc8 commit 8ff30b4
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 149 deletions.
1 change: 0 additions & 1 deletion regamedll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ set(GAMEDLL_SRCS
"dlls/API/CSPlayerItem.cpp"
"dlls/addons/item_airbox.cpp"
"dlls/addons/point_command.cpp"
"dlls/addons/trigger_bomb_reset.cpp"
"dlls/addons/trigger_random.cpp"
"dlls/addons/trigger_setorigin.cpp"
"dlls/wpn_shared/wpn_ak47.cpp"
Expand Down
39 changes: 0 additions & 39 deletions regamedll/dlls/addons/trigger_bomb_reset.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions regamedll/dlls/addons/trigger_bomb_reset.h

This file was deleted.

1 change: 0 additions & 1 deletion regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8028,7 +8028,6 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte
pWeaponBox->m_bIsBomb = true;
pWeaponBox->SetThink(&CWeaponBox::BombThink);
pWeaponBox->pev->nextthink = gpGlobals->time + 1.0f;
pWeaponBox->SetLastValidHeldC4Position(((CC4 *)pWeapon)->GetLastValidHeldPosition());

if (TheCSBots())
{
Expand Down
18 changes: 0 additions & 18 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,24 +2181,6 @@ void CWeaponBox::SetObjectCollisionBox()
pev->absmax = pev->origin + Vector(16, 16, 16);
}

void CWeaponBox::ResetToLastValidPlayerHeldC4Position()
{
if (pev->origin == m_vecLastValidPlayerHeldC4Position)
{
return;
}

Vector const vecResetPos = m_vecLastValidPlayerHeldC4Position + Vector(0.0f, 0.0f, 8.0f);
Vector const angResetAng = Vector(0.0f, RANDOM_FLOAT(0.0f, 360.0f), 0.0f);

// Teleport
pev->velocity = Vector(0.0f, 0.0f, 0.0f);
pev->movetype = MOVETYPE_NONE;
pev->flags |= FL_ONGROUND;
pev->angles = angResetAng;
UTIL_SetOrigin(pev, vecResetPos);
}

char *CArmoury::m_ItemModels[] = {
"models/w_mp5.mdl",
"models/w_tmp.mdl",
Expand Down
12 changes: 0 additions & 12 deletions regamedll/dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,6 @@ class CWeaponBox: public CBaseEntity
void SetModel_OrigFunc(const char *pszModelName);
#endif

void SetLastValidHeldC4Position(const Vector &vecPositon) { m_vecLastValidPlayerHeldC4Position = vecPositon; }
void ResetToLastValidPlayerHeldC4Position();

public:
static TYPEDESCRIPTION m_SaveData[];

Expand All @@ -494,9 +491,6 @@ class CWeaponBox: public CBaseEntity
int m_rgAmmo[MAX_AMMO_SLOTS];
int m_cAmmoTypes;
bool m_bIsBomb;

private:
Vector m_vecLastValidPlayerHeldC4Position;
};


Expand Down Expand Up @@ -849,7 +843,6 @@ class CAWP: public CBasePlayerWeapon

const float C4_MAX_SPEED = 250.0f;
const float C4_ARMING_ON_TIME = 3.0f;
constexpr float WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL = 0.2f;

enum c4_e
{
Expand All @@ -869,8 +862,6 @@ class CC4: public CBasePlayerWeapon
virtual int GetItemInfo(ItemInfo *p);
virtual BOOL Deploy();
virtual void Holster(int skiplocal);
virtual void AttachToPlayer(CBasePlayer* pPlayer);
virtual void Think();
virtual float GetMaxSpeed();
virtual int iItemSlot() { return C4_SLOT; }
virtual void PrimaryAttack();
Expand All @@ -884,16 +875,13 @@ class CC4: public CBasePlayerWeapon
#endif
}

Vector GetLastValidHeldPosition() const { return m_vecLastValidPlayerHeldPosition; }

public:
bool m_bStartedArming;
bool m_bBombPlacedAnimation;
float m_fArmedTime;

private:
bool m_bHasShield;
Vector m_vecLastValidPlayerHeldPosition;
};


Expand Down
34 changes: 0 additions & 34 deletions regamedll/dlls/wpn_shared/wpn_c4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,37 +382,3 @@ float CC4::GetMaxSpeed()

return C4_MAX_SPEED;
}

void CC4::AttachToPlayer(CBasePlayer* pPlayer)
{
CBasePlayerWeapon::AttachToPlayer(pPlayer);

#ifdef REGAMEDLL_ADD
SetThink(&CC4::Think);
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;

if (pPlayer->IsPlayer() && pPlayer->IsAlive())
{
entvars_t* pevPlayer = pPlayer->pev;
m_vecLastValidPlayerHeldPosition = pevPlayer->origin + pevPlayer->mins;
}
#endif
}

void CC4::Think()
{
#ifdef REGAMEDLL_ADD
pev->nextthink = gpGlobals->time + WEAPON_C4_UPDATE_LAST_VALID_PLAYER_HELD_POSITION_INTERVAL;

// If the bomb is held by an alive player standing on the ground, then we can use this
// position as the last known valid position to respawn the bomb if it gets reset.

if (m_pPlayer && m_pPlayer->IsPlayer() && m_pPlayer->IsAlive() && (m_pPlayer->pev->flags & FL_ONGROUND))
{
entvars_t* pevPlayer = m_pPlayer->pev;
m_vecLastValidPlayerHeldPosition = pevPlayer->origin + pevPlayer->mins;
}
#else
CBasePlayerWeapon::Think();
#endif
}
4 changes: 0 additions & 4 deletions regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -2272,10 +2272,6 @@
]
]

@SolidClass base(Trigger) = trigger_bomb_reset : "Trigger bomb reset"
[
]

// Function entities
@SolidClass = func_bomb_target : "Bomb target zone"
[
Expand Down
4 changes: 1 addition & 3 deletions regamedll/msvc/ReGameDLL.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug Play|Win32">
Expand All @@ -25,7 +25,6 @@
<ItemGroup>
<ClCompile Include="..\dlls\addons\item_airbox.cpp" />
<ClCompile Include="..\dlls\addons\point_command.cpp" />
<ClCompile Include="..\dlls\addons\trigger_bomb_reset.cpp" />
<ClCompile Include="..\dlls\addons\trigger_random.cpp" />
<ClCompile Include="..\dlls\addons\trigger_setorigin.cpp" />
<ClCompile Include="..\dlls\airtank.cpp" />
Expand Down Expand Up @@ -617,7 +616,6 @@
<ClInclude Include="..\dlls\activity.h" />
<ClInclude Include="..\dlls\addons\item_airbox.h" />
<ClInclude Include="..\dlls\addons\point_command.h" />
<ClInclude Include="..\dlls\addons\trigger_bomb_reset.h" />
<ClInclude Include="..\dlls\addons\trigger_random.h" />
<ClInclude Include="..\dlls\addons\trigger_setorigin.h" />
<ClInclude Include="..\dlls\airtank.h" />
Expand Down
8 changes: 1 addition & 7 deletions regamedll/msvc/ReGameDLL.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="engine">
Expand Down Expand Up @@ -549,9 +549,6 @@
<ClCompile Include="..\dlls\addons\point_command.cpp">
<Filter>dlls\addons</Filter>
</ClCompile>
<ClCompile Include="..\dlls\addons\trigger_bomb_reset.cpp">
<Filter>dlls\addons</Filter>
</ClCompile>
<ClCompile Include="..\public\FileSystem.cpp">
<Filter>public</Filter>
</ClCompile>
Expand Down Expand Up @@ -1052,8 +1049,5 @@
<ClInclude Include="..\dlls\addons\point_command.h">
<Filter>dlls\addons</Filter>
</ClInclude>
<ClInclude Include="..\dlls\addons\trigger_bomb_reset.h">
<Filter>dlls\addons</Filter>
</ClInclude>
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion regamedll/public/regamedll/API/CSInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ class CCSChangeLevel: public CCSTrigger {};
class CCSLadder: public CCSTrigger {};
class CCSTriggerPush: public CCSTrigger {};
class CCSTriggerTeleport: public CCSTrigger {};
class CCSTriggerBombReset: public CCSTrigger {};
class CCSBuyZone: public CCSTrigger {};
class CCSBombTarget: public CCSTrigger {};
class CCSHostageRescue: public CCSTrigger {};
Expand Down
1 change: 0 additions & 1 deletion regamedll/regamedll/dlls.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ using FloatRef = float;
#include "addons/trigger_setorigin.h"
#include "addons/trigger_random.h"
#include "addons/point_command.h"
#include "addons/trigger_bomb_reset.h"

// Tutor
#include "tutor.h"
Expand Down

1 comment on commit 8ff30b4

@Vaqtincha
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ахахахах. По факту сам ты ничего не можешь нормально сделать. Только копипаст и фсе.

Please sign in to comment.