Skip to content

Commit

Permalink
Initial implementation of dropping the flag without feigning death.
Browse files Browse the repository at this point in the history
Bind the command 'dropflag' to a key and press it when you want to drop the flag.
  • Loading branch information
utspect committed Jul 20, 2020
1 parent 7879581 commit e9a9693
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions Classes/UTPure.uc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function PreBeginPlay()
if (zzDMP == None)
return;

// toggle first blood so it doesn't get triggered during warmup
zzDMP.bFirstBlood = True;

Spawn(class'NN_SpawnNotify');
Expand Down
17 changes: 16 additions & 1 deletion Classes/bbPlayer.uc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ var bool bClientIsWalking;
var bool bJustRespawned;
var float LastCAPTime; // ServerTime when last CAP was sent
var vector oldClientLoc;
var decoration carriedFlag;

var globalconfig float MinDodgeClickTime;
var float zzLastTimeForward, zzLastTimeBack, zzLastTimeLeft, zzLastTimeRight;
Expand Down Expand Up @@ -358,7 +359,7 @@ replication
xxServerSetForceModels, xxServerSetHitSounds, xxServerSetTeamHitSounds, xxServerDisableForceHitSounds, xxServerSetMinDodgeClickTime, xxServerSetTeamInfo, ShowStats,
xxServerAckScreenshot, xxServerReceiveConsole, xxServerReceiveKeys, xxServerReceiveINT, xxServerReceiveStuff,
xxSendHeadshotToSpecs, xxSendDeathMessageToSpecs, xxSendMultiKillToSpecs, xxSendSpreeToSpecs, xxServerDemoReply,
xxExplodeOther, xxSetNetUpdateRate, xxServerAddVelocity, xxNN_Fire, xxNN_AltFire;
xxExplodeOther, xxSetNetUpdateRate, xxServerAddVelocity, xxNN_Fire, xxNN_AltFire, DropFlag;

reliable if ((Role < ROLE_Authority) && !bClientDemoRecording)
xxNN_ProjExplode, xxNN_TeleFrag, xxNN_TransFrag,
Expand Down Expand Up @@ -7873,6 +7874,20 @@ function xxExplodeOther(Projectile Other)
Other.Explode(Other.Location, Normal(Location-Other.Location));
}

exec function DropFlag() {
local bbPlayer zzbbP;
ForEach AllActors(class'bbPlayer', zzbbP) {
if (zzbbP == Self) {
if (zzbbP.PlayerReplicationInfo.HasFlag != None) {
zzbbP.carriedFlag = zzbbP.PlayerReplicationInfo.HasFlag;
zzbbP.PlayerReplicationInfo.HasFlag = None;
zzbbP.carriedFlag.Drop(Velocity + 10 * VRand());
carriedFlag.SetLocation(zzbbP.Location + vect(0, 60, 0));
}
}
}
}

function DoJump( optional float F )
{
local UT_JumpBoots zzBoots;
Expand Down

0 comments on commit e9a9693

Please sign in to comment.