mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Revert "New entity trigger_bomb_reset
(#796)"
This reverts commit 5dec3bad326b543e9d6007b9eaca05c03d267884.
This commit is contained in:
parent
889edc81bf
commit
8ff30b4c3e
@ -228,7 +228,6 @@ set(GAMEDLL_SRCS
|
|||||||
"dlls/API/CSPlayerItem.cpp"
|
"dlls/API/CSPlayerItem.cpp"
|
||||||
"dlls/addons/item_airbox.cpp"
|
"dlls/addons/item_airbox.cpp"
|
||||||
"dlls/addons/point_command.cpp"
|
"dlls/addons/point_command.cpp"
|
||||||
"dlls/addons/trigger_bomb_reset.cpp"
|
|
||||||
"dlls/addons/trigger_random.cpp"
|
"dlls/addons/trigger_random.cpp"
|
||||||
"dlls/addons/trigger_setorigin.cpp"
|
"dlls/addons/trigger_setorigin.cpp"
|
||||||
"dlls/wpn_shared/wpn_ak47.cpp"
|
"dlls/wpn_shared/wpn_ak47.cpp"
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the
|
|
||||||
* Free Software Foundation; either version 2 of the License, or (at
|
|
||||||
* your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "precompiled.h"
|
|
||||||
|
|
||||||
LINK_ENTITY_TO_CLASS(trigger_bomb_reset, CTriggerBombReset, CCSTriggerBombReset)
|
|
||||||
|
|
||||||
void CTriggerBombReset::Spawn()
|
|
||||||
{
|
|
||||||
InitTrigger();
|
|
||||||
SetTouch(&CTriggerBombReset::Touch);
|
|
||||||
SetUse(&CTriggerBombReset::ToggleUse);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CTriggerBombReset::Touch(CBaseEntity *pOther)
|
|
||||||
{
|
|
||||||
CWeaponBox *pWeaponBox = dynamic_cast<CWeaponBox *>(pOther);
|
|
||||||
|
|
||||||
if (pWeaponBox && pWeaponBox->m_bIsBomb)
|
|
||||||
{
|
|
||||||
// If the bomb touches this trigger, tell it to reset to its last known valid position.
|
|
||||||
pWeaponBox->ResetToLastValidPlayerHeldC4Position();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the
|
|
||||||
* Free Software Foundation; either version 2 of the License, or (at
|
|
||||||
* your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "triggers.h"
|
|
||||||
|
|
||||||
class CTriggerBombReset: public CBaseTrigger
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void Spawn();
|
|
||||||
virtual void Touch(CBaseEntity *pOther);
|
|
||||||
};
|
|
@ -8028,7 +8028,6 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte
|
|||||||
pWeaponBox->m_bIsBomb = true;
|
pWeaponBox->m_bIsBomb = true;
|
||||||
pWeaponBox->SetThink(&CWeaponBox::BombThink);
|
pWeaponBox->SetThink(&CWeaponBox::BombThink);
|
||||||
pWeaponBox->pev->nextthink = gpGlobals->time + 1.0f;
|
pWeaponBox->pev->nextthink = gpGlobals->time + 1.0f;
|
||||||
pWeaponBox->SetLastValidHeldC4Position(((CC4 *)pWeapon)->GetLastValidHeldPosition());
|
|
||||||
|
|
||||||
if (TheCSBots())
|
if (TheCSBots())
|
||||||
{
|
{
|
||||||
|
@ -2181,24 +2181,6 @@ void CWeaponBox::SetObjectCollisionBox()
|
|||||||
pev->absmax = pev->origin + Vector(16, 16, 16);
|
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[] = {
|
char *CArmoury::m_ItemModels[] = {
|
||||||
"models/w_mp5.mdl",
|
"models/w_mp5.mdl",
|
||||||
"models/w_tmp.mdl",
|
"models/w_tmp.mdl",
|
||||||
|
@ -483,9 +483,6 @@ public:
|
|||||||
void SetModel_OrigFunc(const char *pszModelName);
|
void SetModel_OrigFunc(const char *pszModelName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SetLastValidHeldC4Position(const Vector &vecPositon) { m_vecLastValidPlayerHeldC4Position = vecPositon; }
|
|
||||||
void ResetToLastValidPlayerHeldC4Position();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static TYPEDESCRIPTION m_SaveData[];
|
static TYPEDESCRIPTION m_SaveData[];
|
||||||
|
|
||||||
@ -494,9 +491,6 @@ public:
|
|||||||
int m_rgAmmo[MAX_AMMO_SLOTS];
|
int m_rgAmmo[MAX_AMMO_SLOTS];
|
||||||
int m_cAmmoTypes;
|
int m_cAmmoTypes;
|
||||||
bool m_bIsBomb;
|
bool m_bIsBomb;
|
||||||
|
|
||||||
private:
|
|
||||||
Vector m_vecLastValidPlayerHeldC4Position;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -849,7 +843,6 @@ private:
|
|||||||
|
|
||||||
const float C4_MAX_SPEED = 250.0f;
|
const float C4_MAX_SPEED = 250.0f;
|
||||||
const float C4_ARMING_ON_TIME = 3.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
|
enum c4_e
|
||||||
{
|
{
|
||||||
@ -869,8 +862,6 @@ public:
|
|||||||
virtual int GetItemInfo(ItemInfo *p);
|
virtual int GetItemInfo(ItemInfo *p);
|
||||||
virtual BOOL Deploy();
|
virtual BOOL Deploy();
|
||||||
virtual void Holster(int skiplocal);
|
virtual void Holster(int skiplocal);
|
||||||
virtual void AttachToPlayer(CBasePlayer* pPlayer);
|
|
||||||
virtual void Think();
|
|
||||||
virtual float GetMaxSpeed();
|
virtual float GetMaxSpeed();
|
||||||
virtual int iItemSlot() { return C4_SLOT; }
|
virtual int iItemSlot() { return C4_SLOT; }
|
||||||
virtual void PrimaryAttack();
|
virtual void PrimaryAttack();
|
||||||
@ -884,8 +875,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector GetLastValidHeldPosition() const { return m_vecLastValidPlayerHeldPosition; }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool m_bStartedArming;
|
bool m_bStartedArming;
|
||||||
bool m_bBombPlacedAnimation;
|
bool m_bBombPlacedAnimation;
|
||||||
@ -893,7 +882,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_bHasShield;
|
bool m_bHasShield;
|
||||||
Vector m_vecLastValidPlayerHeldPosition;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -382,37 +382,3 @@ float CC4::GetMaxSpeed()
|
|||||||
|
|
||||||
return C4_MAX_SPEED;
|
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
|
|
||||||
}
|
|
||||||
|
@ -2272,10 +2272,6 @@
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@SolidClass base(Trigger) = trigger_bomb_reset : "Trigger bomb reset"
|
|
||||||
[
|
|
||||||
]
|
|
||||||
|
|
||||||
// Function entities
|
// Function entities
|
||||||
@SolidClass = func_bomb_target : "Bomb target zone"
|
@SolidClass = func_bomb_target : "Bomb target zone"
|
||||||
[
|
[
|
||||||
|
@ -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">
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug Play|Win32">
|
<ProjectConfiguration Include="Debug Play|Win32">
|
||||||
@ -25,7 +25,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\dlls\addons\item_airbox.cpp" />
|
<ClCompile Include="..\dlls\addons\item_airbox.cpp" />
|
||||||
<ClCompile Include="..\dlls\addons\point_command.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_random.cpp" />
|
||||||
<ClCompile Include="..\dlls\addons\trigger_setorigin.cpp" />
|
<ClCompile Include="..\dlls\addons\trigger_setorigin.cpp" />
|
||||||
<ClCompile Include="..\dlls\airtank.cpp" />
|
<ClCompile Include="..\dlls\airtank.cpp" />
|
||||||
@ -617,7 +616,6 @@
|
|||||||
<ClInclude Include="..\dlls\activity.h" />
|
<ClInclude Include="..\dlls\activity.h" />
|
||||||
<ClInclude Include="..\dlls\addons\item_airbox.h" />
|
<ClInclude Include="..\dlls\addons\item_airbox.h" />
|
||||||
<ClInclude Include="..\dlls\addons\point_command.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_random.h" />
|
||||||
<ClInclude Include="..\dlls\addons\trigger_setorigin.h" />
|
<ClInclude Include="..\dlls\addons\trigger_setorigin.h" />
|
||||||
<ClInclude Include="..\dlls\airtank.h" />
|
<ClInclude Include="..\dlls\airtank.h" />
|
||||||
|
@ -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">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="engine">
|
<Filter Include="engine">
|
||||||
@ -549,9 +549,6 @@
|
|||||||
<ClCompile Include="..\dlls\addons\point_command.cpp">
|
<ClCompile Include="..\dlls\addons\point_command.cpp">
|
||||||
<Filter>dlls\addons</Filter>
|
<Filter>dlls\addons</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\dlls\addons\trigger_bomb_reset.cpp">
|
|
||||||
<Filter>dlls\addons</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\public\FileSystem.cpp">
|
<ClCompile Include="..\public\FileSystem.cpp">
|
||||||
<Filter>public</Filter>
|
<Filter>public</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -1052,8 +1049,5 @@
|
|||||||
<ClInclude Include="..\dlls\addons\point_command.h">
|
<ClInclude Include="..\dlls\addons\point_command.h">
|
||||||
<Filter>dlls\addons</Filter>
|
<Filter>dlls\addons</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\dlls\addons\trigger_bomb_reset.h">
|
|
||||||
<Filter>dlls\addons</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -213,7 +213,6 @@ class CCSChangeLevel: public CCSTrigger {};
|
|||||||
class CCSLadder: public CCSTrigger {};
|
class CCSLadder: public CCSTrigger {};
|
||||||
class CCSTriggerPush: public CCSTrigger {};
|
class CCSTriggerPush: public CCSTrigger {};
|
||||||
class CCSTriggerTeleport: public CCSTrigger {};
|
class CCSTriggerTeleport: public CCSTrigger {};
|
||||||
class CCSTriggerBombReset: public CCSTrigger {};
|
|
||||||
class CCSBuyZone: public CCSTrigger {};
|
class CCSBuyZone: public CCSTrigger {};
|
||||||
class CCSBombTarget: public CCSTrigger {};
|
class CCSBombTarget: public CCSTrigger {};
|
||||||
class CCSHostageRescue: public CCSTrigger {};
|
class CCSHostageRescue: public CCSTrigger {};
|
||||||
|
@ -134,7 +134,6 @@ using FloatRef = float;
|
|||||||
#include "addons/trigger_setorigin.h"
|
#include "addons/trigger_setorigin.h"
|
||||||
#include "addons/trigger_random.h"
|
#include "addons/trigger_random.h"
|
||||||
#include "addons/point_command.h"
|
#include "addons/point_command.h"
|
||||||
#include "addons/trigger_bomb_reset.h"
|
|
||||||
|
|
||||||
// Tutor
|
// Tutor
|
||||||
#include "tutor.h"
|
#include "tutor.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user