AntiLou TookOut Line108
Merge inventory.cs
Moved CollisionTimeout
This commit is contained in:
ChocoTaco1 2022-07-14 11:40:02 -04:00
parent de970b6f30
commit 43875c56dc
2 changed files with 22 additions and 90 deletions

View file

@ -2,7 +2,7 @@
//removed alot of things that were already included in the classic code
//and checked if evo wasnt double overriding functions
package AntiLouExploitFixes
package AntiLouExploitFixes
{
// MPB INSTANT ENERGY FIX
@ -13,7 +13,7 @@ function VehicleData::onRemove(%this, %obj)
{
if(%obj.station.isDestroyed)
%obj.station.isDestroyed = 0;
parent::onRemove(%this, %obj);
}
@ -30,7 +30,7 @@ function serverCmdBuyVehicle(%client, %blockName)
return;
%team = %client.getSensorGroup();
if(vehicleCheck(%blockName, %team))
if(vehicleCheck(%blockName, %team))
{
%station = %client.player.station.pad;
if((%station.ready) && (%station.station.vehicle[%blockName]))
@ -48,7 +48,7 @@ function serverCmdBuyVehicle(%client, %blockName)
InitContainerRadiusSearch(%p, %blockName.checkRadius, %mask);
%clear = 1;
for(%x = 0; (%obj = containerSearchNext()) != 0; %x++)
for(%x = 0; (%obj = containerSearchNext()) != 0; %x++)
{
if((%obj.getType() & $TypeMasks::VehicleObjectType) && (%obj.getDataBlock().checkIfPlayersMounted(%obj)))
{
@ -84,7 +84,7 @@ function serverCmdBuyVehicle(%client, %blockName)
schedule(6500, 0, "resetBuyVehicle", %client);
}
else
MessageClient(%client, "", 'Can\'t create vehicle. A player is on the creation pad.');
MessageClient(%client, "", 'Can\'t create vehicle. A player is on the creation pad.');
}
else
@ -105,87 +105,6 @@ function resetBuyVehicle(%client)
// END VEHICLE STATION SPAM FIX
// ShapeBase::throwObject(%this,%obj)
// Info: Delay on calculating flag stats
function ShapeBase::throwObject(%this,%obj)
{
//------------------------------------------------------------------
// z0dd - ZOD, 4/15/02. Allow respawn switching during tourney wait.
if(!$MatchStarted && $Host::TournamentMode) //Added Tourney check
return;
//------------------------------------------------------------------
// z0dd - ZOD, 5/26/02. Remove anti-hover so flag can be thrown properly
if(%obj.getDataBlock().getName() $= "Flag")
{
%obj.static = false;
// z0dd - ZOD - SquirrelOfDeath, 10/02/02. Hack for flag collision bug.
if(Game.Class $= CTFGame || Game.Class $= PracticeCTFGame || Game.Class $= SCtFGame)
%obj.searchSchedule = Game.schedule(10, "startFlagCollisionSearch", %obj);
}
//------------------------------------------------------------------
%srcCorpse = (%this.getState() $= "Dead"); // z0dd - ZOD, 4/14/02. Flag tossed from corpse
//if the object is being thrown by a corpse, use a random vector
if (%srcCorpse && %obj.getDataBlock().getName() !$= "Flag") // z0dd - ZOD, 4/14/02. Except for flags..
{
%vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom();
%vec = vectorScale(%vec, 10);
}
else // else Initial vel based on the dir the player is looking
{
%eye = %this.getEyeVector();
%vec = vectorScale(%eye, 20);
}
// Add a vertical component to give the item a better arc
%dot = vectorDot("0 0 1",%eye);
if (%dot < 0)
%dot = -%dot;
%vec = vectorAdd(%vec,vectorScale("0 0 12",1 - %dot)); // z0dd - ZOD, 9/10/02. 10 was 8
// Add player's velocity
%vec = vectorAdd(%vec,%this.getVelocity());
%pos = getBoxCenter(%this.getWorldBox());
//since flags have a huge mass (so when you shoot them, they don't bounce too far)
//we need to up the %vec so that you can still throw them...
if (%obj.getDataBlock().getName() $= "Flag")
{
%vec = vectorScale(%vec, (%srcCorpse ? 40 : 75)); // z0dd - ZOD, 4/14/02. Throw flag force. Value was 40
// ------------------------------------------------------------
// z0dd - ZOD, 9/27/02. Delay on grabbing flag after tossing it
%this.flagTossWait = true;
%this.schedule(1000, resetFlagTossWait);
// ------------------------------------------------------------
// Delay on calculating stats
%this.flagStatsWait = true;
%this.schedule(5000, resetFlagStatsWait);
// ------------------------------------------------------------
}
//
%obj.setTransform(%pos);
%obj.applyImpulse(%pos,%vec);
%obj.setCollisionTimeout(%this);
%data = %obj.getDatablock();
%data.onThrow(%obj,%this);
//call the AI hook
AIThrowObject(%obj);
}
// Player::resetFlagStatsWait(%this)
// Info: Delay on calculating the stats
function Player::resetFlagStatsWait(%this)
{
%this.flagStatsWait = false;
}
// Fix for observer vehicle bug, where observers are drawn to
// a vehicle no matter whether they are observing the client or not
// Thanks to MT for pointing out.
@ -225,7 +144,7 @@ function resetObserveFollow( %client, %dismount )
{
continue;
}
%client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
}
}
@ -329,7 +248,7 @@ function Armor::onMount(%this,%obj,%vehicle,%node)
%vehicle.lastPilot = %obj;
%obj.lastVehicle = %vehicle;
if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "")
{
{
setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup());
if( %vehicle.turretObject > 0 ) setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup());
}

View file

@ -483,12 +483,17 @@ function ShapeBase::throwObject(%this,%obj)
%this.flagTossWait = true;
%this.schedule(1000, resetFlagTossWait);
// ------------------------------------------------------------
// From AntiLou
// Delay on calculating stats
%this.flagStatsWait = true;
%this.schedule(5000, resetFlagStatsWait);
// ------------------------------------------------------------
}
//
// Do stuff
%obj.setCollisionTimeout(%this);
%obj.setTransform(%pos);
%obj.applyImpulse(%pos,%vec);
%obj.setCollisionTimeout(%this);
%data = %obj.getDatablock();
%data.onThrow(%obj,%this);
@ -497,6 +502,14 @@ function ShapeBase::throwObject(%this,%obj)
AIThrowObject(%obj);
}
// From AntiLou
// Player::resetFlagStatsWait(%this)
// Info: Delay on calculating the stats
function Player::resetFlagStatsWait(%this)
{
%this.flagStatsWait = false;
}
function ShapeBase::clearInventory(%this)
{
// z0dd - ZOD, 5/18/03. Auto cleanup of weapons and ammo. Streamline