This is the behaviour I see in game:
When you approach the capturable flag in a vehicle as the driver, you do not grab the flag.
When you are a passenger, certain positions in the vehicle, such as the 2nd seat in a little bird, or 3rd seat in a vodnik, you can do a drive-by of the flag and grab it with out getting out of the vehicle.
This, I believe, is the relevant code, or code I am curious about:
def onCTFUncapTrigger (triggerId, cp, vehicle, enter, cpTeam): if enter: # if cpTeam == 1 and CTF.team1FlagIsTaken: return # elif cpTeam == 2 and CTF.team2FlagIsTaken: return # else: return #...uhh wtf? if cpTeam == 1: if CTF.team1FlagIsTaken: return elif cpTeam == 2: if CTF.team2FlagIsTaken: return else: return #...uhh wtf? for p in vehicle.getOccupyingPlayers(): isOk = not p.isManDown() and p.isAlive() if not isOk: continue playersTeam = p.getTeam() if p.getDefaultVehicle() == p.getVehicle(): if cpTeam == 1: if playersTeam == 2: if CTF.team2Carrier == -1 and CTF.team1FlagIsTaken == 0: CTF.team1FlagIsTaken = 1 CTF.team2Carrier = p.index p.score.cpCaptures += 1 addScore(p, CTF_SCORE_STEAL, RPL) CTF.oppFlagHasPhys.setPosition(CTF.oppFlagHousePos) CTF.oppFlagUnheldRemaining = CTF_RETURN_UNHELD_FLAG_COUNT SendFlagEventMessage(p.getName(), 2, 1) elif playersTeam == 1: if CTF.team1Carrier == p.index: if not (CTF.team2FlagIsTaken == 1): return if not VerifyNoHack(cp, p): return ResetFlagCpos(2) ShowOffObject(CTF.usFlagNoPhys) #print 'SCORED_____________' p.score.cpCaptures += 1 addScore(p, CTF_SCORE_CAPTURE, RPL) onCTFTeamScore(1) SendFlagEventMessage(p.getName(), 1, 2) # name, team, event else: pass elif cpTeam == 2: if playersTeam == 1: if CTF.team1Carrier == -1 and CTF.team2FlagIsTaken == 0: CTF.team2FlagIsTaken = 1 CTF.team1Carrier = p.index p.score.cpCaptures += 1 addScore(p, CTF_SCORE_STEAL, RPL) CTF.usFlagHasPhys.setPosition(CTF.usFlagHousePos) CTF.usFlagUnheldRemaining = CTF_RETURN_UNHELD_FLAG_COUNT SendFlagEventMessage(p.getName(), 1, 1) elif playersTeam == 2: if CTF.team2Carrier == p.index: if not (CTF.team1FlagIsTaken == 1): return if not VerifyNoHack(cp, p): return ResetFlagCpos(1) ShowOffObject(CTF.oppFlagNoPhys) #print 'score ----' p.score.cpCaptures += 1 addScore(p, CTF_SCORE_CAPTURE, RPL) onCTFTeamScore(2) SendFlagEventMessage(p.getName(), 2, 2) # name, team, event else: pass else: pass
I believe this code is triggered when a player comes within the defined radius of the flag (the flags are at the only uncapturable flags on the map).
Isn't the line "if p.getDefaultVehicle() == p.getVehicle()" designed to allow only players outside a vehicle to grab the flag? How would it be different depending on where you are in the vehicle?
Grabbing the flag while driving by at full speed is cheap, and my gaming group would like to see it rectified.
Thanks for any help you can offer!

Sign In
Register
Help

MultiQuote
