When I was modifying Tribes from an existing mod I found loads of interestingly dumb code, particularly some of it relating to simulated "timed" effects. One of the better examples was a recursive function simulating EMP effects (
no energy for flight or energy weapons) where the author had neglected to include a check to reset the time to 0 if the player died, but had set it up to stop checking if they were dead. What this meant was that if you died while you were EMP'd you effectively became EMP-immune. Good way to unbalance the game.
A similar effect created problems with a speed and strength boost effect that was in reality just an armor change. Because the timed effect provided a minimal boost of health at a set interval a dead boosted player's body would wind up re-animating, though they wouldn't be able to control it and the game would still consider it "dead". This meant that in 30 seconds the body would disappear, but it
also meant if you could get it to hold something within those 30 seconds whatever it was holding would disappear as well. And the number one thing people threw to a re-animated corpse? The Flag, when playing Capture the Flag. Sure, it would reset to the flagstand in a few minutes, but for those few minutes the other team couldn't make a flag capture.
The best one though was the way the guy coded in "lockjaw" missiles. (
Where you locked onto someone once and for the next 15 seconds every missile you shot sought them out) He used a specific type of projectile, but instead of creating an emitter to shoot it he used the generic "spawnprojectile" command. The problem with this was that for that projectile type "spawnprojectile" didn't return the ID of the projectile, which wouldn't expire and remove itself.
Ever. (
It was normally handled by the emitter) After 5 or 6 people used lockjaw the game would get incredibly laggy whenever you viewed an area where a lock took place, as your computer attempted to calculate collision details for dozens of invisible, hundred-unit-long projectiles.
Yes, stupid code is fun.
