mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-14 07:34:36 +00:00
Moved
AntiLou TookOut Line108 Merge inventory.cs Moved CollisionTimeout
This commit is contained in:
parent
de970b6f30
commit
43875c56dc
2 changed files with 22 additions and 90 deletions
|
|
@ -105,87 +105,6 @@ function resetBuyVehicle(%client)
|
||||||
// END VEHICLE STATION SPAM FIX
|
// 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
|
// Fix for observer vehicle bug, where observers are drawn to
|
||||||
// a vehicle no matter whether they are observing the client or not
|
// a vehicle no matter whether they are observing the client or not
|
||||||
// Thanks to MT for pointing out.
|
// Thanks to MT for pointing out.
|
||||||
|
|
|
||||||
|
|
@ -483,12 +483,17 @@ function ShapeBase::throwObject(%this,%obj)
|
||||||
%this.flagTossWait = true;
|
%this.flagTossWait = true;
|
||||||
%this.schedule(1000, resetFlagTossWait);
|
%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.setTransform(%pos);
|
||||||
%obj.applyImpulse(%pos,%vec);
|
%obj.applyImpulse(%pos,%vec);
|
||||||
%obj.setCollisionTimeout(%this);
|
|
||||||
%data = %obj.getDatablock();
|
%data = %obj.getDatablock();
|
||||||
|
|
||||||
%data.onThrow(%obj,%this);
|
%data.onThrow(%obj,%this);
|
||||||
|
|
@ -497,6 +502,14 @@ function ShapeBase::throwObject(%this,%obj)
|
||||||
AIThrowObject(%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)
|
function ShapeBase::clearInventory(%this)
|
||||||
{
|
{
|
||||||
// z0dd - ZOD, 5/18/03. Auto cleanup of weapons and ammo. Streamline
|
// z0dd - ZOD, 5/18/03. Auto cleanup of weapons and ammo. Streamline
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue