From e7f1db0543eaba740c161cbb81bc11b3f2590bb3 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Fri, 4 Jan 2019 05:56:14 +0100 Subject: [PATCH] Commited some minor stuff, unimportant --- Source/Server/Bot/Bot.c | 2 + Source/Server/Bot/Way.c | 2 +- Source/Server/Damage.c | 2 + Source/Server/DefsFields.h | 131 ++++++++++++++++++++ Source/Shared/pmove.c | 39 +++--- Source/gs-entbase/server/func_breakable.cpp | 9 +- 6 files changed, 162 insertions(+), 23 deletions(-) create mode 100644 Source/Server/DefsFields.h diff --git a/Source/Server/Bot/Bot.c b/Source/Server/Bot/Bot.c index deffbb5a..81e3619d 100644 --- a/Source/Server/Bot/Bot.c +++ b/Source/Server/Bot/Bot.c @@ -329,4 +329,6 @@ void CBot::Create( int iBotID ) ClientConnect(); PutClientInServer(); + + customphysics = Empty; } diff --git a/Source/Server/Bot/Way.c b/Source/Server/Bot/Way.c index 0aa0aac0..c09cbabe 100644 --- a/Source/Server/Bot/Way.c +++ b/Source/Server/Bot/Way.c @@ -272,7 +272,7 @@ void SV_AddDebugPolygons( void ) { return; } - int nearest = Way_FindClosestWaypoint( self.origin ); + int nearest = Way_FindClosestWaypoint(self.origin); makevectors(self.v_angle); R_BeginPolygon( "waypoint", 0, 0 ); diff --git a/Source/Server/Damage.c b/Source/Server/Damage.c index 1f044633..59467fa8 100755 --- a/Source/Server/Damage.c +++ b/Source/Server/Damage.c @@ -105,6 +105,8 @@ void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos return; } + eTarget.velocity = [0,0,0]; + // Apply the damage finally if ( eTarget.armor ) { float fRatio = 0.5; diff --git a/Source/Server/DefsFields.h b/Source/Server/DefsFields.h new file mode 100644 index 00000000..99970a95 --- /dev/null +++ b/Source/Server/DefsFields.h @@ -0,0 +1,131 @@ +/* + Copyright 2016-2018 Marco "eukara" Hladik + + MIT LICENSE + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +*/ + +// GoldSrc-Rendermode Fields +.vector rendercolor; +.float rendermode; +.float renderamt; +.float alpha; + +// All about +use +.void(void) vUse; +.int iUsable; + +// Generic entity fields +.void() PlayerUse; +.int iBleeds; +.void(int iHitBody) vPain; +.void(int iHitBody) vDeath; +.float fRespawns; +.entity eUser; +.float material; + +/* Respawnable/reset entity fields */ +.string sOldModel; +.float fOldSolid; +.float fOldHealth; +.vector vOldOrigin; +.vector vOldAngle; +.void() vRespawn; +.void() vOldUse; + +// Player specific fields +.float fInBuyZone; +.float fInHostageZone; +.float fInBombZone; +.float fMoney; +.float fStepTime; +.int iInGame; +.float fCharModel; +.float fDeaths; +.int iEquipment; +.float armor; +.float fProgressBar; + +// Weapon specific fields +.int iCurrentMag; +.int iCurrentCaliber; +.float fSlotMelee; +.float fSlotPrimary; +.float fSlotSecondary; +.float fSlotGrenade; +.float fAttackFinished; +.float fRadioFinished; +.float fAccuracy; + +/* Map Entity Specific Fields /* + * They used to be in their respective files, but there is not much point */ + + /* ambient_generic */ +.float pitch; +.float loop; +.float lforate; + +/* armoury_entity */ +.float item; +.float count; + +/* hostage_entity */ +.entity eTargetPoint; +.entity eLastCreated; +.int iHasBeenUsed; + +/* env_sprite */ +.float framerate; + +/* env_explosion */ +.int iMagnitude; + +/* env_spark */ +.float MaxDelay; + +/* func_button || func_door */ +.float speed; +.float lip; +.float dmg; +.float state; +.vector pos1; +.vector pos2; +.float movesnd; +.float stopsnd; + +/* func_door_rotating */ +.float distance; + +/* func_vehicle */ +.entity eDriver; +.entity eVehicle; +.float height; + +/* infodecal */ +.string texture; + +/* light */ +.string pattern; + +/* info_map_parameters */ +.float buying; +.float bombradius; diff --git a/Source/Shared/pmove.c b/Source/Shared/pmove.c index c56b078a..73d032d5 100644 --- a/Source/Shared/pmove.c +++ b/Source/Shared/pmove.c @@ -20,7 +20,7 @@ var float PHY_JUMP_CHAINDECAY = 50; .float waterlevel; .float watertype; .float teleport_time; -//int trace_endcontentsi; +int trace_endcontentsi; .float maxspeed; .vector view_ofs; @@ -73,22 +73,23 @@ void PMove_Categorize(void) } } - // Check water levels, boo - contents = pointcontents(self.origin + self.mins + '0 0 1'); - - //print(sprintf("Contents: %d\n", contents)); - - // Ladder content testing + /*// Check water levels, boo */ int oldhitcontents = self.hitcontentsmaski; - self.hitcontentsmaski = CONTENTBIT_FTELADDER; - tracebox(self.origin, self.mins, self.maxs, self.origin, FALSE, self); + self.hitcontentsmaski = CONTENTBIT_LAVA | CONTENTBIT_SLIME | CONTENTBIT_WATER; + tracebox( self.origin, self.mins, self.maxs, self.origin, FALSE, self ); self.hitcontentsmaski = oldhitcontents; + + print(sprintf( "Contents: %i\n", trace_endcontentsi)); - /*if (trace_endcontentsi & CONTENTBIT_FTELADDER || iContents == CONTENT_LADDER) { - self.flags |= FL_ONLADDER; + if (trace_endcontentsi & CONTENTBIT_WATER) { + contents = CONTENT_WATER; + } else if (trace_endcontentsi & CONTENTBIT_SLIME) { + contents = CONTENT_SLIME; + } else if (trace_endcontentsi & CONTENTBIT_LAVA) { + contents = CONTENT_LAVA; } else { - self.flags &= ~FL_ONLADDER; - }*/ + contents = CONTENT_EMPTY; + } if (contents < CONTENT_SOLID && contents != CONTENT_LADDER) { self.watertype = contents; @@ -630,21 +631,19 @@ void PMove_Run_Move(void) } } - if ((self.flags & FL_ONGROUND) && !(self.velocity[2] > 0)) { - /* try to step down, only if there's something down there */ + /* touch whatever is below */ + if (self.flags & FL_ONGROUND) { vecDestPos = self.origin; vecDestPos[2] -= serverkeyfloat("phy_stepheight"); - tracebox(self.origin, self.mins, self.maxs, vecDestPos, FALSE, self); //try going straight there + tracebox(self.origin, self.mins, self.maxs, vecDestPos, FALSE, self); if (trace_fraction >= 1) { return; } - if (trace_startsolid) { + /*if (trace_startsolid) { if (!PMove_Fix_Origin()) { return; } - } - self.origin = trace_endpos; - + }*/ PMove_DoTouch(trace_ent); } } diff --git a/Source/gs-entbase/server/func_breakable.cpp b/Source/gs-entbase/server/func_breakable.cpp index 70e3b3f7..3135ccfe 100755 --- a/Source/gs-entbase/server/func_breakable.cpp +++ b/Source/gs-entbase/server/func_breakable.cpp @@ -28,6 +28,8 @@ class func_breakable : CBaseTrigger int m_pressType; int m_pressDamage;*/ + void() func_breakable; + virtual void() Respawn; virtual void() Trigger; virtual void() PlayerTouch; /*virtual void() PressureDeath;*/ @@ -112,6 +114,7 @@ void func_breakable :: PlayerTouch ( void ) } if ((spawnflags & SF_PRESSURE) && (other.absmin_z >= maxs_z - 2)) { + touch = __NULL__; think = Trigger; if (m_flDelay == 0) { @@ -125,7 +128,11 @@ void func_breakable :: PlayerTouch ( void ) void func_breakable :: Respawn ( void ) { + setorigin(this, m_oldOrigin); + setmodel(this, m_oldModel); touch = PlayerTouch; + think = __NULL__; + if ( spawnflags & SF_TRIGGER ) { takedamage = DAMAGE_NO; } else { @@ -161,6 +168,4 @@ void func_breakable :: func_breakable( void ) break; } } - - }