Merge branch 'master' into Mario/bulldozer
authorMario <mario@smbclan.net>
Fri, 13 Nov 2015 14:29:42 +0000 (00:29 +1000)
committerMario <mario@smbclan.net>
Fri, 13 Nov 2015 14:29:42 +0000 (00:29 +1000)
586 files changed:
check-translations.sh
languages.txt
qcsrc/client/announcer.qc
qcsrc/client/announcer.qh
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/controlpoint.qc [deleted file]
qcsrc/client/controlpoint.qh [deleted file]
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc [deleted file]
qcsrc/client/damage.qh [deleted file]
qcsrc/client/defs.qh
qcsrc/client/effects.qc [deleted file]
qcsrc/client/effects.qh [deleted file]
qcsrc/client/generator.qc [deleted file]
qcsrc/client/generator.qh [deleted file]
qcsrc/client/gibs.qc [deleted file]
qcsrc/client/gibs.qh [deleted file]
qcsrc/client/hook.qc
qcsrc/client/hook.qh
qcsrc/client/hud.qc [deleted file]
qcsrc/client/hud.qh [deleted file]
qcsrc/client/hud/all.inc [new file with mode: 0644]
qcsrc/client/hud/all.qc [new file with mode: 0644]
qcsrc/client/hud/all.qh [new file with mode: 0644]
qcsrc/client/hud/hud.qc [new file with mode: 0644]
qcsrc/client/hud/hud.qh [new file with mode: 0644]
qcsrc/client/hud/hud_config.qc [new file with mode: 0644]
qcsrc/client/hud/hud_config.qh [new file with mode: 0644]
qcsrc/client/hud/panel/ammo.qc [new file with mode: 0644]
qcsrc/client/hud/panel/centerprint.qc [new file with mode: 0644]
qcsrc/client/hud/panel/chat.qc [new file with mode: 0644]
qcsrc/client/hud/panel/engineinfo.qc [new file with mode: 0644]
qcsrc/client/hud/panel/healtharmor.qc [new file with mode: 0644]
qcsrc/client/hud/panel/infomessages.qc [new file with mode: 0644]
qcsrc/client/hud/panel/minigame.qc [new file with mode: 0644]
qcsrc/client/hud/panel/modicons.qc [new file with mode: 0644]
qcsrc/client/hud/panel/notify.qc [new file with mode: 0644]
qcsrc/client/hud/panel/physics.qc [new file with mode: 0644]
qcsrc/client/hud/panel/powerups.qc [new file with mode: 0644]
qcsrc/client/hud/panel/pressedkeys.qc [new file with mode: 0644]
qcsrc/client/hud/panel/quickmenu.qc [new file with mode: 0644]
qcsrc/client/hud/panel/racetimer.qc [new file with mode: 0644]
qcsrc/client/hud/panel/radar.qc [new file with mode: 0644]
qcsrc/client/hud/panel/score.qc [new file with mode: 0644]
qcsrc/client/hud/panel/timer.qc [new file with mode: 0644]
qcsrc/client/hud/panel/vote.qc [new file with mode: 0644]
qcsrc/client/hud/panel/weapons.qc [new file with mode: 0644]
qcsrc/client/hud_config.qc [deleted file]
qcsrc/client/hud_config.qh [deleted file]
qcsrc/client/laser.qc [deleted file]
qcsrc/client/laser.qh [deleted file]
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/mapvoting.qh
qcsrc/client/miscfunctions.qc
qcsrc/client/miscfunctions.qh
qcsrc/client/modeleffects.qc [deleted file]
qcsrc/client/modeleffects.qh [deleted file]
qcsrc/client/mutators/events.qh
qcsrc/client/particles.qc [deleted file]
qcsrc/client/particles.qh [deleted file]
qcsrc/client/progs.inc
qcsrc/client/quickmenu.qc
qcsrc/client/rubble.qc [deleted file]
qcsrc/client/rubble.qh [deleted file]
qcsrc/client/scoreboard.qc
qcsrc/client/scoreboard.qh
qcsrc/client/shownames.qc
qcsrc/client/t_items.qc
qcsrc/client/teamradar.qc
qcsrc/client/teamradar.qh
qcsrc/client/tuba.qc
qcsrc/client/tuba.qh
qcsrc/client/view.qc
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/client/weapons/projectile.qc
qcsrc/client/weapons/projectile.qh
qcsrc/common/buffs/all.inc [deleted file]
qcsrc/common/buffs/all.qc [deleted file]
qcsrc/common/buffs/all.qh [deleted file]
qcsrc/common/command/all.qh
qcsrc/common/command/generic.qc
qcsrc/common/command/generic.qh
qcsrc/common/constants.qh
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/deathtypes/all.qc
qcsrc/common/deathtypes/all.qh
qcsrc/common/debug.qh [new file with mode: 0644]
qcsrc/common/effects/all.inc
qcsrc/common/effects/all.qc
qcsrc/common/effects/all.qh
qcsrc/common/effects/effect.qh
qcsrc/common/effects/effectinfo.qc
qcsrc/common/effects/qc/all.inc [new file with mode: 0644]
qcsrc/common/effects/qc/all.qc [new file with mode: 0644]
qcsrc/common/effects/qc/all.qh [new file with mode: 0644]
qcsrc/common/effects/qc/casings.qc [new file with mode: 0644]
qcsrc/common/effects/qc/damageeffects.qc [new file with mode: 0644]
qcsrc/common/effects/qc/gibs.qc [new file with mode: 0644]
qcsrc/common/effects/qc/lightningarc.qc [new file with mode: 0644]
qcsrc/common/effects/qc/modeleffects.qc [new file with mode: 0644]
qcsrc/common/effects/qc/rubble.qh [new file with mode: 0644]
qcsrc/common/gamemodes/all.inc
qcsrc/common/gamemodes/gamemode/nexball/module.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qh
qcsrc/common/gamemodes/gamemode/nexball/weapon.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/module.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qh [new file with mode: 0644]
qcsrc/common/items/all.qh
qcsrc/common/items/inventory.qh
qcsrc/common/items/item/armor.qc
qcsrc/common/items/item/armor.qh
qcsrc/common/items/item/health.qc
qcsrc/common/items/item/health.qh
qcsrc/common/items/item/pickup.qc
qcsrc/common/items/item/pickup.qh
qcsrc/common/items/item/powerup.qc
qcsrc/common/items/item/powerup.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/cl_minigames.qh
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/minigames/minigames.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/minigames/sv_minigames.qh
qcsrc/common/models/all.inc
qcsrc/common/models/all.qh
qcsrc/common/monsters/all.qc
qcsrc/common/monsters/all.qh
qcsrc/common/monsters/monster.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/movetypes/movetypes.qh
qcsrc/common/mutators/all.inc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/events.qh
qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/bloodloss/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/breakablehook/breakablehook.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/breakablehook/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/all.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/all.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/all.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/buffs.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/campcheck/campcheck.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/campcheck/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/casings.qc [deleted file]
qcsrc/common/mutators/mutator/cloaked/cloaked.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/cloaked/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/damagetext.qc [deleted file]
qcsrc/common/mutators/mutator/damagetext/damagetext.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/damagetext/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/dodging/dodging.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/dodging/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/hook/hook.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/hook/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/common/mutators/mutator/instagib/items.qc
qcsrc/common/mutators/mutator/instagib/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/invincibleproj/invincibleproj.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/invincibleproj/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/itemstime.qc
qcsrc/common/mutators/mutator/melee_only/melee_only.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/melee_only/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/midair/midair.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/midair/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/multijump/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/multijump/multijump.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/effects.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/nades.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/nades.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/nades.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/net.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/new_toys/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/new_toys/new_toys.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nix/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nix/nix.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/hmg.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/overkill.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/rpc.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/physical_items/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/physical_items/physical_items.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/pinata/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/pinata/pinata.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/random_gravity/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/random_gravity/random_gravity.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketflying/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketflying/rocketflying.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketminsta/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketminsta/rocketminsta.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/running_guns/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/running_guns/running_guns.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/sandbox/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/sandbox/sandbox.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/spawn_near_teammate/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/superspec/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/superspec/superspec.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/touchexplode/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampire/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampire/vampire.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampirehook/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampirehook/vampirehook.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/waypoints/all.inc
qcsrc/common/mutators/mutator/waypoints/all.qh
qcsrc/common/mutators/mutator/waypoints/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/weaponarena_random/module.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/weaponarena_random/weaponarena_random.qc [new file with mode: 0644]
qcsrc/common/nades/all.inc [deleted file]
qcsrc/common/nades/all.qc [deleted file]
qcsrc/common/nades/all.qh [deleted file]
qcsrc/common/net_notice.qc
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/common/physics.qc
qcsrc/common/physics.qh
qcsrc/common/playerstats.qc
qcsrc/common/playerstats.qh
qcsrc/common/sounds/all.inc
qcsrc/common/sounds/all.qc [new file with mode: 0644]
qcsrc/common/sounds/all.qh
qcsrc/common/sounds/sound.qh
qcsrc/common/stats.qh
qcsrc/common/triggers/func/bobbing.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/conveyor.qh [deleted file]
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door.qh
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/fourier.qc
qcsrc/common/triggers/func/include.qh
qcsrc/common/triggers/func/ladder.qc
qcsrc/common/triggers/func/ladder.qh
qcsrc/common/triggers/func/pendulum.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/plat.qh [deleted file]
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/func/pointparticles.qh [deleted file]
qcsrc/common/triggers/func/rainsnow.qc
qcsrc/common/triggers/func/rainsnow.qh [deleted file]
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/func/train.qh
qcsrc/common/triggers/func/vectormamamam.qc
qcsrc/common/triggers/include.qh
qcsrc/common/triggers/misc/corner.qc
qcsrc/common/triggers/misc/corner.qh [deleted file]
qcsrc/common/triggers/misc/include.qc
qcsrc/common/triggers/misc/include.qh [deleted file]
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/misc/laser.qh [deleted file]
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/music.qh
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/teleporters.qh
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/triggers/trigger/impulse.qh
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/jumppads.qh
qcsrc/common/triggers/trigger/keylock.qc
qcsrc/common/triggers/trigger/keylock.qh
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/swamp.qc
qcsrc/common/triggers/trigger/swamp.qh
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/triggers/trigger/viewloc.qh
qcsrc/common/triggers/triggers.qc
qcsrc/common/turrets/all.qc
qcsrc/common/turrets/all.qh
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/cl_turrets.qh [deleted file]
qcsrc/common/turrets/config.qc
qcsrc/common/turrets/config.qh
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret.qh
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/fusionreactor.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/tesla.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/turrets/util.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/vehicles/all.qc
qcsrc/common/vehicles/all.qh
qcsrc/common/vehicles/cl_vehicles.qc
qcsrc/common/vehicles/cl_vehicles.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/bumblebee.qh
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/weapons/all.inc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/config.qh
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hmg.qc [deleted file]
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/rpc.qc [deleted file]
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/dpdefs/dpextensions.qh
qcsrc/dpdefs/progsdefs.qh
qcsrc/lib/_all.inc
qcsrc/lib/accumulate.qh
qcsrc/lib/bits.qh
qcsrc/lib/bool.qh
qcsrc/lib/color.qh
qcsrc/lib/compiler.qh
qcsrc/lib/counting.qh
qcsrc/lib/csqcmodel/cl_model.qc
qcsrc/lib/csqcmodel/cl_model.qh
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/lib/csqcmodel/common.qh
qcsrc/lib/csqcmodel/sv_model.qc
qcsrc/lib/cvar.qh
qcsrc/lib/defer.qh
qcsrc/lib/draw.qh
qcsrc/lib/file.qh
qcsrc/lib/functional.qh
qcsrc/lib/i18n.qh
qcsrc/lib/int.qh
qcsrc/lib/iter.qh
qcsrc/lib/lazy.qh
qcsrc/lib/linkedlist.qh
qcsrc/lib/log.qh
qcsrc/lib/map.qc [new file with mode: 0644]
qcsrc/lib/math.qh
qcsrc/lib/misc.qh
qcsrc/lib/net.qh
qcsrc/lib/nil.qh
qcsrc/lib/noise.qc
qcsrc/lib/oo.qh
qcsrc/lib/p2mathlib.qc
qcsrc/lib/p2mathlib.qh
qcsrc/lib/player.qh
qcsrc/lib/progname.qh
qcsrc/lib/random.qc
qcsrc/lib/random.qh
qcsrc/lib/registry.qh
qcsrc/lib/registry_net.qh [new file with mode: 0644]
qcsrc/lib/replicate.qh
qcsrc/lib/self.qh
qcsrc/lib/sort.qh
qcsrc/lib/sortlist.qc
qcsrc/lib/sortlist.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/static.qh
qcsrc/lib/stats.qh [new file with mode: 0644]
qcsrc/lib/string.qh
qcsrc/lib/struct.qh
qcsrc/lib/test.qc
qcsrc/lib/test.qh
qcsrc/lib/urllib.qc
qcsrc/lib/urllib.qh
qcsrc/lib/vector.qh
qcsrc/lib/warpzone/client.qc
qcsrc/lib/warpzone/client.qh
qcsrc/lib/warpzone/common.qc
qcsrc/lib/warpzone/mathlib.qc
qcsrc/lib/warpzone/mathlib.qh
qcsrc/lib/warpzone/server.qc
qcsrc/lib/warpzone/server.qh
qcsrc/menu/anim/animation.qc
qcsrc/menu/anim/animhost.qc
qcsrc/menu/anim/easing.qc
qcsrc/menu/anim/keyframe.qc
qcsrc/menu/classes.qc [new file with mode: 0644]
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/draw.qc
qcsrc/menu/draw.qh
qcsrc/menu/gamesettings.qh
qcsrc/menu/item.qc
qcsrc/menu/item/borderimage.qc
qcsrc/menu/item/button.qc
qcsrc/menu/item/checkbox.qc
qcsrc/menu/item/container.qc
qcsrc/menu/item/dialog.qc
qcsrc/menu/item/image.qc
qcsrc/menu/item/inputbox.qc
qcsrc/menu/item/inputcontainer.qc
qcsrc/menu/item/label.qc
qcsrc/menu/item/listbox.qc
qcsrc/menu/item/modalcontroller.qc
qcsrc/menu/item/nexposee.qc
qcsrc/menu/item/radiobutton.qc
qcsrc/menu/item/slider.qc
qcsrc/menu/item/tab.qc
qcsrc/menu/item/textslider.qc
qcsrc/menu/menu.qc
qcsrc/menu/menu.qh
qcsrc/menu/mutators/events.qh [new file with mode: 0644]
qcsrc/menu/oo/classes.qc [deleted file]
qcsrc/menu/progs.inc
qcsrc/menu/sys-post.qh [deleted file]
qcsrc/menu/sys-pre.qh [deleted file]
qcsrc/menu/xonotic/crosshairpicker.qc
qcsrc/menu/xonotic/datasource.qc
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc
qcsrc/menu/xonotic/dialog_settings_game.qc
qcsrc/menu/xonotic/gametypelist.qc
qcsrc/menu/xonotic/languagelist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/menu/xonotic/weaponslist.qc
qcsrc/server/_all.qh
qcsrc/server/autocvars.qh
qcsrc/server/bot/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/bot.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_impulse.qh
qcsrc/server/cl_player.qc
qcsrc/server/cl_player.qh
qcsrc/server/command/banning.qc
qcsrc/server/command/banning.qh
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/getreplies.qc
qcsrc/server/command/getreplies.qh
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/sv_cmd.qh
qcsrc/server/command/vote.qc
qcsrc/server/command/vote.qh
qcsrc/server/constants.qh
qcsrc/server/controlpoint.qc [deleted file]
qcsrc/server/controlpoint.qh [deleted file]
qcsrc/server/csqceffects.qc [deleted file]
qcsrc/server/csqceffects.qh [deleted file]
qcsrc/server/defs.qh
qcsrc/server/ent_cs.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_models.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_subs.qh
qcsrc/server/g_violence.qc [deleted file]
qcsrc/server/g_violence.qh [deleted file]
qcsrc/server/g_world.qc
qcsrc/server/generator.qc [deleted file]
qcsrc/server/generator.qh [deleted file]
qcsrc/server/ipban.qc
qcsrc/server/item_key.qc
qcsrc/server/mapvoting.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/all.inc
qcsrc/server/mutators/all.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_deathmatch.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_onslaught.qc [deleted file]
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/mutators/mutator/mutator_bloodloss.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_breakablehook.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_buffs.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_campcheck.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_dodging.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_hook.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_invincibleproj.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_melee_only.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_midair.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_multijump.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_nades.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_new_toys.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_nix.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_overkill.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_physical_items.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_pinata.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_random_gravity.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_rocketflying.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_rocketminsta.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_spawn_near_teammate.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_superspec.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_touchexplode.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_vampire.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_vampirehook.qc [deleted file]
qcsrc/server/mutators/mutator/mutator_weaponarena_random.qc [deleted file]
qcsrc/server/mutators/mutator/sandbox.qc [deleted file]
qcsrc/server/pathlib/main.qc
qcsrc/server/portals.qc
qcsrc/server/progs.inc
qcsrc/server/race.qc
qcsrc/server/round_handler.qc
qcsrc/server/scores.qc
qcsrc/server/scores_rules.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/steerlib.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/t_items.qh
qcsrc/server/t_quake3.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/accuracy.qh
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/csqcprojectile.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/spawning.qh
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh
qcsrc/server/weapons/weaponsystem.qc
qcsrc/server/weapons/weaponsystem.qh
qcsrc/uncrustify.cfg
qcsrc/uncrustify.sh
quickmenu_example.txt [new file with mode: 0644]

index facee4a..a740653 100755 (executable)
@@ -36,7 +36,8 @@ fi
 
 if [ x"$mode" = x"txt" ]; then
        {
-               echo "en English \"English\""
+               item=`grep "^en " languages.txt`
+               echo "$item"
                for X in common.*.po; do
                        [ -f "$X" ] || continue
                        if [ -n "$language" ]; then
@@ -67,9 +68,9 @@ if [ x"$mode" = x"txt" ]; then
                                if [ "$p" -lt 50 ]; then
                                        continue
                                fi
-                               item="$l $l \"$l (0%)\""
+                               item="$l $l \"$l\" 0%"
                        fi
-                       printf "%s\n" "$item" | sed -e "s/([0-9][0-9]*%)/($p%)/"
+                       printf "%s\n" "$item" | sed -e "s/[0-9][0-9]*%/$p%/"
                done
        } | tr '"' '\t' | sort -k3 | tr '\t' '"'
 fi
index a43c6cf..9f0d174 100644 (file)
@@ -1,19 +1,19 @@
-ast Asturian "Asturianu (60%)"
-de German "Deutsch (90%)"
-de_CH German "Deutsch (Schweiz) (90%)"
-en_AU en_AU "en_AU (77%)"
-en English "English"
-es Spanish "Español (68%)"
-fr French "Français (98%)"
-it Italian "Italiano (97%)"
-hu Hungarian "Magyar (50%)"
-nl Dutch "Nederlands (45%)"
-pl Polish "Polski (60%)"
-pt Portuguese "Português (42%)"
-ro Romanian "Romana (90%)"
-fi Finnish "Suomi (35%)"
-el Greek "Ελληνική (25%)"
-be Belarusian "Беларуская (65%)"
-bg Bulgarian "Български (65%)"
-ru Russian "Русский (93%)"
-uk Ukrainian "Українська (60%)"
+ast   Asturian "Asturianu" 60%
+de    German "Deutsch" 90%
+de_CH German "Deutsch (Schweiz)" 90%
+en    English "English"
+en_AU English "English (Australia)" 77%
+es    Spanish "Español" 68%
+fr    French "Français" 98%
+it    Italian "Italiano" 97%
+hu    Hungarian "Magyar" 50%
+nl    Dutch "Nederlands" 45%
+pl    Polish "Polski" 60%
+pt    Portuguese "Português" 42%
+ro    Romanian "Romana" 90%
+fi    Finnish "Suomi" 35%
+el    Greek "Ελληνική" 25%
+be    Belarusian "Беларуская" 65%
+bg    Bulgarian "Български" 65%
+ru    Russian "Русский" 93%
+uk    Ukrainian "Українська" 60%
\ No newline at end of file
index e20557f..fa8f2b0 100644 (file)
@@ -1,14 +1,24 @@
 #include "announcer.qh"
 
+#include "mutators/events.qh"
+
 #include "../common/notifications.qh"
 #include "../common/stats.qh"
 
 bool announcer_1min;
 bool announcer_5min;
+string AnnouncerOption()
+{
+       string ret = autocvar_cl_announcer;
+       MUTATOR_CALLHOOK(AnnouncerOption, ret);
+       ret = ret_string;
+       return ret;
+}
+
 void Announcer_Countdown()
 {
        SELFPARAM();
-       float starttime = getstatf(STAT_GAMESTARTTIME);
+       float starttime = STAT(GAMESTARTTIME);
        float roundstarttime = getstatf(STAT_ROUNDSTARTTIME);
        if(roundstarttime == -1)
        {
@@ -59,7 +69,7 @@ void Announcer_Countdown()
  float previous_game_starttime;
 void Announcer_Gamestart()
 {
-       float startTime = getstatf(STAT_GAMESTARTTIME);
+       float startTime = STAT(GAMESTARTTIME);
        float roundstarttime = getstatf(STAT_ROUNDSTARTTIME);
        if(roundstarttime > startTime)
                startTime = roundstarttime;
@@ -68,19 +78,18 @@ void Announcer_Gamestart()
        {
                if(time < startTime)
                {
-                       entity e = find(world, classname, "announcer_countdown");
-                       if (!e)
+                       static entity announcer_countdown;
+                       if (!announcer_countdown)
                        {
-                               e = spawn();
-                               e.classname = "announcer_countdown";
-                               e.think = Announcer_Countdown;
+                               announcer_countdown = new(announcer_countdown);
+                               announcer_countdown.think = Announcer_Countdown;
                        }
 
                        if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
-                       if(time > e.nextthink) // don't play it again if countdown was already going
+                       if(time > announcer_countdown.nextthink) // don't play it again if countdown was already going
                                Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
 
-                       e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
+                       announcer_countdown.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
                }
        }
 
@@ -92,12 +101,12 @@ void Announcer_Gamestart()
 void Announcer_Time()
 {
        float timelimit = getstatf(STAT_TIMELIMIT);
-       float timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
+       float timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
        float warmup_timeleft = 0;
 
        if(warmup_stage)
                if(autocvar_g_warmup_limit > 0)
-                       warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time);
+                       warmup_timeleft = max(0, autocvar_g_warmup_limit + STAT(GAMESTARTTIME) - time);
 
        // 5 minute check
        if(autocvar_cl_announcer_maptime >= 2)
index 64be143..314c660 100644 (file)
@@ -3,4 +3,6 @@
 
 void Announcer();
 
+string AnnouncerOption();
+
 #endif
index bed70f5..63e0c56 100644 (file)
@@ -8,8 +8,7 @@
 
 #include "../autocvars.qh"
 #include "../defs.qh"
-#include "../hud.qh"
-#include "../hud_config.qh"
+#include "../hud/all.qh"
 #include "../main.qh"
 #include "../mapvoting.qh"
 #include "../miscfunctions.qh"
@@ -22,7 +21,7 @@
 
 void DrawDebugModel(entity this)
 {
-       if(time - floor(time) > 0.5)
+       if (time - floor(time) > 0.5)
        {
                PolyDrawModel(self);
                self.drawmask = 0;
@@ -45,7 +44,7 @@ void LocalCommand_blurtest(int request)
        // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
 
        #ifdef BLURTEST
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
@@ -66,7 +65,7 @@ void LocalCommand_blurtest(int request)
                }
        }
        #else
-       if(request)
+       if (request)
        {
                LOG_INFO("Blurtest is not enabled on this client.\n");
                return;
@@ -76,7 +75,7 @@ void LocalCommand_blurtest(int request)
 
 void LocalCommand_boxparticles(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
@@ -87,7 +86,7 @@ void LocalCommand_boxparticles(int request, int argc)
                                {
                                        int index = stoi(argv(2));
                                        entity own;
-                                       if(index <= 0)
+                                       if (index <= 0)
                                                own = entitybyindex(-index);
                                        else
                                                own = findfloat(world, entnum, index);
@@ -104,7 +103,9 @@ void LocalCommand_boxparticles(int request, int argc)
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
@@ -127,14 +128,14 @@ void LocalCommand_boxparticles(int request, int argc)
 
 void LocalCommand_create_scrshot_ent(int request)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
                        string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
                        int fh = fopen(filename, FILE_WRITE);
 
-                       if(fh >= 0)
+                       if (fh >= 0)
                        {
                                fputs(fh, "{\n");
                                fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
@@ -165,20 +166,18 @@ void LocalCommand_create_scrshot_ent(int request)
 
 void LocalCommand_debugmodel(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
                        string modelname = argv(1);
-                       entity debugmodel_entity;
 
-                       debugmodel_entity = spawn();
+                       entity debugmodel_entity = new(debugmodel);
                        precache_model(modelname);
                        _setmodel(debugmodel_entity, modelname);
                        setorigin(debugmodel_entity, view_origin);
                        debugmodel_entity.angles = view_angles;
                        debugmodel_entity.draw = DrawDebugModel;
-                       debugmodel_entity.classname = "debugmodel";
 
                        return;
                }
@@ -195,14 +194,14 @@ void LocalCommand_debugmodel(int request, int argc)
 
 void LocalCommand_handlevote(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
                        int vote_selection;
                        string vote_string;
 
-                       if(InterpretBoolean(argv(1)))
+                       if (InterpretBoolean(argv(1)))
                        {
                                vote_selection = 2;
                                vote_string = "yes";
@@ -213,9 +212,9 @@ void LocalCommand_handlevote(int request, int argc)
                                vote_string = "no";
                        }
 
-                       if(vote_selection)
+                       if (vote_selection)
                        {
-                               if(uid2name_dialog) // handled by "uid2name" option
+                               if (uid2name_dialog)  // handled by "uid2name" option
                                {
                                        vote_active = 0;
                                        vote_prev = 0;
@@ -230,7 +229,9 @@ void LocalCommand_handlevote(int request, int argc)
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
@@ -252,11 +253,11 @@ void HUD_Radar_Show_Maximized(bool doshow, bool clickable);
 
 void LocalCommand_hud(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       switch(argv(1))
+                       switch (argv(1))
                        {
                                case "configure":
                                {
@@ -266,16 +267,23 @@ void LocalCommand_hud(int request, int argc)
 
                                case "quickmenu":
                                {
-                                       if(QuickMenu_IsOpened())
+                                       if (argv(2) == "help")
+                                       {
+                                               LOG_INFO(" quickmenu [[default | file | \"\"] submenu]\n");
+                                               LOG_INFO("Called without options (or with \"\") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
+                                               LOG_INFO("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.\n");
+                                               return;
+                                       }
+                                       if (QuickMenu_IsOpened())
                                                QuickMenu_Close();
                                        else
-                                               QuickMenu_Open(argv(2), argv(3)); // mode, submenu
+                                               QuickMenu_Open(argv(2), argv(3));  // mode, submenu
                                        return;
                                }
 
                                case "minigame":
                                {
-                                       if(HUD_MinigameMenu_IsOpened())
+                                       if (HUD_MinigameMenu_IsOpened())
                                                HUD_MinigameMenu_Close();
                                        else
                                                HUD_MinigameMenu_Open();
@@ -284,14 +292,14 @@ void LocalCommand_hud(int request, int argc)
 
                                case "save":
                                {
-                                       if(argv(2))
+                                       if (argv(2))
                                        {
                                                HUD_Panel_ExportCfg(argv(2));
                                                return;
                                        }
                                        else
                                        {
-                                               break; // go to usage, we're missing the paramater needed here.
+                                               break;  // go to usage, we're missing the paramater needed here.
                                        }
                                }
 
@@ -309,23 +317,25 @@ void LocalCommand_hud(int request, int argc)
 
                                case "radar":
                                {
-                                       if(argv(2))
-                                               HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)),0);
+                                       if (argv(2))
+                                               HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)), 0);
                                        else
-                                               HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
+                                               HUD_Radar_Show_Maximized(!hud_panel_radar_maximized, 0);
                                        return;
                                }
 
                                case "clickradar":
                                {
-                                       HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
+                                       HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
                                        return;
                                }
                        }
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2hud^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
@@ -333,10 +343,7 @@ void LocalCommand_hud(int request, int argc)
                        LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
                        LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
                        LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       LOG_INFO("  quickmenu [[default | file | \"\"] submenu]\n");
-                       LOG_INFO("    Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
-                       LOG_INFO("    Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
-                       LOG_INFO("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       LOG_INFO("  Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
                        return;
                }
        }
@@ -344,11 +351,11 @@ void LocalCommand_hud(int request, int argc)
 
 void LocalCommand_localprint(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       if(argv(1))
+                       if (argv(1))
                        {
                                centerprint_hud(argv(1));
                                return;
@@ -356,7 +363,9 @@ void LocalCommand_localprint(int request, int argc)
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2localprint^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
@@ -368,11 +377,11 @@ void LocalCommand_localprint(int request, int argc)
 
 void LocalCommand_mv_download(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       if(argv(1))
+                       if (argv(1))
                        {
                                Cmd_MapVote_MapDownload(argc);
                                return;
@@ -380,7 +389,9 @@ void LocalCommand_mv_download(int request, int argc)
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
@@ -392,20 +403,22 @@ void LocalCommand_mv_download(int request, int argc)
 
 void LocalCommand_find(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
                        entity client;
 
-                       for(client = world; (client = find(client, classname, argv(1))); )
+                       for (client = world; (client = find(client, classname, argv(1))); )
                                LOG_INFO(etos(client), "\n");
 
                        return;
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2find^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
@@ -417,19 +430,19 @@ void LocalCommand_find(int request, int argc)
 
 void LocalCommand_sendcvar(int request, int argc)
 {
-       switch(request)
+       switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       if(argv(1))
+                       if (argv(1))
                        {
                                // W_FixWeaponOrder will trash argv, so save what we need.
                                string thiscvar = strzone(argv(1));
                                string s = cvar_string(thiscvar);
 
-                               if(thiscvar == "cl_weaponpriority")
+                               if (thiscvar == "cl_weaponpriority")
                                        s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
-                               else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
+                               else if (substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
                                        s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
 
                                localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
@@ -439,7 +452,9 @@ void LocalCommand_sendcvar(int request, int argc)
                }
 
                default:
+               {
                        LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
+               }
                case CMD_REQUEST_USAGE:
                {
                        LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
@@ -453,22 +468,22 @@ void LocalCommand_sendcvar(int request, int argc)
 ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
 void LocalCommand_(int request)
 {
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-
-                       return;
-               }
-
-               default:
-               case CMD_REQUEST_USAGE:
-               {
-                       print("\nUsage:^3 cl_cmd \n");
-                       print("  No arguments required.\n");
-                       return;
-               }
-       }
+    switch(request)
+    {
+        case CMD_REQUEST_COMMAND:
+        {
+
+            return;
+        }
+
+        default:
+        case CMD_REQUEST_USAGE:
+        {
+            print("\nUsage:^3 cl_cmd \n");
+            print("  No arguments required.\n");
+            return;
+        }
+    }
 }
 */
 
@@ -478,7 +493,7 @@ void LocalCommand_(int request)
 // ==================================
 
 // Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-#define CLIENT_COMMANDS(request,arguments) \
+#define CLIENT_COMMANDS(request, arguments) \
        CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
        CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
        CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
@@ -493,19 +508,17 @@ void LocalCommand_(int request)
 
 void LocalCommand_macro_help()
 {
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
+       #define CLIENT_COMMAND(name, function, description) \
+               { if (strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
 
        CLIENT_COMMANDS(0, 0);
        #undef CLIENT_COMMAND
-
-       return;
 }
 
 bool LocalCommand_macro_command(int argc)
 {
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(name == strtolower(argv(0))) { function; return true; } }
+       #define CLIENT_COMMAND(name, function, description) \
+               { if (name == strtolower(argv(0))) { function; return true; } }
 
        CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
        #undef CLIENT_COMMAND
@@ -515,8 +528,8 @@ bool LocalCommand_macro_command(int argc)
 
 bool LocalCommand_macro_usage(int argc)
 {
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(name == strtolower(argv(1))) { function; return true; } }
+       #define CLIENT_COMMAND(name, function, description) \
+               { if (name == strtolower(argv(1))) { function; return true; } }
 
        CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
        #undef CLIENT_COMMAND
@@ -526,13 +539,11 @@ bool LocalCommand_macro_usage(int argc)
 
 void LocalCommand_macro_write_aliases(int fh)
 {
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
+       #define CLIENT_COMMAND(name, function, description) \
+               { if (strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
 
        CLIENT_COMMANDS(0, 0);
        #undef CLIENT_COMMAND
-
-       return;
 }
 
 
@@ -552,7 +563,7 @@ void GameCommand(string command)
        string s = strtolower(argv(0));
        if (s == "help")
        {
-               if(argc == 1)
+               if (argc == 1)
                {
                        LOG_INFO("\nClient console commands:\n");
                        LocalCommand_macro_help();
@@ -565,25 +576,23 @@ void GameCommand(string command)
 
                        return;
                }
-               else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
+               else if (GenericCommand_macro_usage(argc))  // Instead of trying to call a command, we're going to see detailed information about it
                {
                        return;
                }
-               else if(LocalCommand_macro_usage(argc)) // now try for normal commands too
+               else if (LocalCommand_macro_usage(argc))  // now try for normal commands too
                {
                        return;
                }
        }
        // continue as usual and scan for normal commands
-       if (GenericCommand(command)// handled by common/command/generic.qc
-       || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
-       || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
-       ) return;
+       if (GenericCommand(command)                                    // handled by common/command/generic.qc
+           || LocalCommand_macro_command(argc)                        // handled by one of the above LocalCommand_* functions
+           || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
+          ) return;
 
        // nothing above caught the command, must be invalid
        LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
-
-       return;
 }
 
 
@@ -622,7 +631,7 @@ void GameCommand(string command)
 void ConsoleCommand_macro_init()
 {
        // first init normal commands
-       #define CONSOLE_COMMAND(name,execution) \
+       #define CONSOLE_COMMAND(name, execution) \
                { registercommand(name); }
 
        CONSOLE_COMMANDS_NORMAL();
@@ -630,22 +639,22 @@ void ConsoleCommand_macro_init()
 
        // then init movement commands
        #ifndef CAMERATEST
-       if(isdemo())
+       if (isdemo())
        {
        #endif
-               #define CONSOLE_COMMAND(name,execution) \
-                       { registercommand(name); }
+       #define CONSOLE_COMMAND(name, execution) \
+               registercommand(name);
 
-               CONSOLE_COMMANDS_MOVEMENT();
+       CONSOLE_COMMANDS_MOVEMENT();
                #undef CONSOLE_COMMAND
        #ifndef CAMERATEST
-       }
+}
        #endif
 }
 
 bool ConsoleCommand_macro_normal(string s, int argc)
 {
-       #define CONSOLE_COMMAND(name,execution) \
+       #define CONSOLE_COMMAND(name, execution) \
                { if (name == s) { { execution } return true; } }
 
        CONSOLE_COMMANDS_NORMAL();
@@ -656,9 +665,9 @@ bool ConsoleCommand_macro_normal(string s, int argc)
 
 bool ConsoleCommand_macro_movement(string s, int argc)
 {
-       if(camera_active)
+       if (camera_active)
        {
-               #define CONSOLE_COMMAND(name,execution) \
+               #define CONSOLE_COMMAND(name, execution) \
                        { if (name == s) { { execution } return true; } }
 
                CONSOLE_COMMANDS_MOVEMENT();
@@ -679,7 +688,7 @@ bool CSQC_ConsoleCommand(string command)
        int argc = tokenize_console(command);
        string s = strtolower(argv(0));
        // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
-       return (ConsoleCommand_macro_normal(s, argc)
-       || ConsoleCommand_macro_movement(s, argc)
-       );
+       return ConsoleCommand_macro_normal(s, argc)
+              || ConsoleCommand_macro_movement(s, argc)
+       ;
 }
diff --git a/qcsrc/client/controlpoint.qc b/qcsrc/client/controlpoint.qc
deleted file mode 100644 (file)
index 575bce5..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-#include "controlpoint.qh"
-
-#include "teamradar.qh"
-#include "../common/movetypes/movetypes.qh"
-
-.vector colormod;
-.float alpha;
-.int count;
-.float pain_finished;
-
-.bool iscaptured;
-
-.vector cp_origin, cp_bob_origin;
-.float cp_bob_spd;
-
-.vector cp_bob_dmg;
-
-.vector punchangle;
-
-.float max_health;
-
-.entity icon_realmodel;
-
-void cpicon_draw(entity this)
-{
-       if(time < this.move_time) { return; }
-
-       if(this.cp_bob_dmg_z > 0)
-               this.cp_bob_dmg_z = this.cp_bob_dmg_z - 3 * frametime;
-       else
-               this.cp_bob_dmg_z = 0;
-       this.cp_bob_origin_z = 4 * PI * (1 - cos(this.cp_bob_spd));
-       this.cp_bob_spd = this.cp_bob_spd + 1.875 * frametime;
-       this.colormod = '1 1 1' * (2 - bound(0, (this.pain_finished - time) / 10, 1));
-
-       if(!this.iscaptured) this.alpha = this.health / this.max_health;
-
-       if(this.iscaptured)
-       {
-               if (this.punchangle_x > 0)
-               {
-                       this.punchangle_x = this.punchangle_x - 60 * frametime;
-                       if (this.punchangle_x < 0)
-                               this.punchangle_x = 0;
-               }
-               else if (this.punchangle_x < 0)
-               {
-                       this.punchangle_x = this.punchangle_x + 60 * frametime;
-                       if (this.punchangle_x > 0)
-                               this.punchangle_x = 0;
-               }
-
-               if (this.punchangle_y > 0)
-               {
-                       this.punchangle_y = this.punchangle_y - 60 * frametime;
-                       if (this.punchangle_y < 0)
-                               this.punchangle_y = 0;
-               }
-               else if (this.punchangle_y < 0)
-               {
-                       this.punchangle_y = this.punchangle_y + 60 * frametime;
-                       if (this.punchangle_y > 0)
-                               this.punchangle_y = 0;
-               }
-
-               if (this.punchangle_z > 0)
-               {
-                       this.punchangle_z = this.punchangle_z - 60 * frametime;
-                       if (this.punchangle_z < 0)
-                               this.punchangle_z = 0;
-               }
-               else if (this.punchangle_z < 0)
-               {
-                       this.punchangle_z = this.punchangle_z + 60 * frametime;
-                       if (this.punchangle_z > 0)
-                               this.punchangle_z = 0;
-               }
-
-               this.angles_x = this.punchangle_x;
-               this.angles_y = this.punchangle_y + this.move_angles_y;
-               this.angles_z = this.punchangle_z;
-               this.move_angles_y = this.move_angles_y + 45 * frametime;
-       }
-
-       setorigin(this, this.cp_origin + this.cp_bob_origin + this.cp_bob_dmg);
-}
-
-void cpicon_damage(entity this, float hp)
-{
-       if(!this.iscaptured) { return; }
-
-       if(hp < this.max_health * 0.25)
-               setmodel(this, MDL_ONS_CP3);
-       else if(hp < this.max_health * 0.50)
-               setmodel(this, MDL_ONS_CP2);
-       else if(hp < this.max_health * 0.75)
-               setmodel(this, MDL_ONS_CP1);
-       else if(hp <= this.max_health || hp >= this.max_health)
-               setmodel(this, MDL_ONS_CP);
-
-       this.punchangle = (2 * randomvec() - '1 1 1') * 45;
-
-       this.cp_bob_dmg_z = (2 * random() - 1) * 15;
-       this.pain_finished = time + 1;
-       this.colormod = '2 2 2';
-
-       setsize(this, CPICON_MIN, CPICON_MAX);
-}
-
-void cpicon_construct(entity this)
-{
-       this.netname = "Control Point Icon";
-
-       setmodel(this, MDL_ONS_CP);
-       setsize(this, CPICON_MIN, CPICON_MAX);
-
-       if(this.icon_realmodel == world)
-       {
-               this.icon_realmodel = spawn();
-               setmodel(this.icon_realmodel, MDL_Null);
-               setorigin(this.icon_realmodel, this.origin);
-               setsize(this.icon_realmodel, CPICON_MIN, CPICON_MAX);
-               this.icon_realmodel.movetype = MOVETYPE_NOCLIP;
-               this.icon_realmodel.solid = SOLID_NOT;
-               this.icon_realmodel.move_origin = this.icon_realmodel.origin;
-       }
-
-       if(this.iscaptured) { this.icon_realmodel.solid = SOLID_BBOX; }
-
-       this.move_movetype      = MOVETYPE_NOCLIP;
-       this.solid                      = SOLID_NOT;
-       this.movetype           = MOVETYPE_NOCLIP;
-       this.move_origin        = this.origin;
-       this.move_time          = time;
-       this.drawmask           = MASK_NORMAL;
-       this.alpha                      = 1;
-       this.draw                       = cpicon_draw;
-       this.cp_origin          = this.origin;
-       this.cp_bob_origin      = '0 0 0.1';
-       this.cp_bob_spd         = 0;
-}
-
-.vector glowmod;
-void cpicon_changeteam(entity this)
-{
-       if(this.team)
-       {
-               this.glowmod = Team_ColorRGB(this.team - 1);
-               this.teamradar_color = Team_ColorRGB(this.team - 1);
-               this.colormap = 1024 + (this.team - 1) * 17;
-       }
-       else
-       {
-               this.colormap = 1024;
-               this.glowmod = '1 1 0';
-               this.teamradar_color = '1 1 0';
-       }
-}
-
-void ent_cpicon(entity this)
-{
-       int sf = ReadByte();
-
-       if(sf & CPSF_SETUP)
-       {
-               this.origin_x = ReadCoord();
-               this.origin_y = ReadCoord();
-               this.origin_z = ReadCoord();
-               setorigin(this, this.origin);
-
-               this.health = ReadByte();
-               this.max_health = ReadByte();
-               this.count = ReadByte();
-               this.team = ReadByte();
-               this.iscaptured = ReadByte();
-
-               if(!this.count)
-                       this.count = (this.health - this.max_health) * frametime;
-
-               cpicon_changeteam(this);
-               cpicon_construct(this);
-       }
-
-       if(sf & CPSF_STATUS)
-       {
-               int _tmp = ReadByte();
-               if(_tmp != this.team)
-               {
-                       this.team = _tmp;
-                       cpicon_changeteam(this);
-               }
-
-               _tmp = ReadByte();
-
-               if(_tmp != this.health)
-                       cpicon_damage(this, _tmp);
-
-               this.health = _tmp;
-       }
-}
diff --git a/qcsrc/client/controlpoint.qh b/qcsrc/client/controlpoint.qh
deleted file mode 100644 (file)
index 5f2e89b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef CLIENT_CONTROLPOINT_H
-#define CLIENT_CONTROLPOINT_H
-
-const vector CPICON_MIN = '-32 -32 -9';
-const vector CPICON_MAX = '32 32 25';
-
-const int CPSF_STATUS = 4;
-const int CPSF_SETUP = 8;
-
-void ent_cpicon(entity this);
-
-#endif
index e2e0e93..7eb672b 100644 (file)
@@ -19,7 +19,7 @@ void CSQCModel_Hook_PreDraw(bool isplayer);
 .int lodmodelindex0;
 .int lodmodelindex1;
 .int lodmodelindex2;
-void CSQCPlayer_LOD_Apply(void)
+void CSQCPlayer_LOD_Apply()
 {SELFPARAM();
        // LOD model loading
        if(self.lodmodelindex0 != self.modelindex)
@@ -108,14 +108,14 @@ int forceplayermodels_goodmodelindex;
 .vector glowmod;
 .vector old_glowmod;
 
-void CSQCPlayer_ModelAppearance_PreUpdate(void)
+void CSQCPlayer_ModelAppearance_PreUpdate()
 {SELFPARAM();
        self.model = self.forceplayermodels_savemodel;
        self.modelindex = self.forceplayermodels_savemodelindex;
        self.skin = self.forceplayermodels_saveskin;
        self.colormap = self.forceplayermodels_savecolormap;
 }
-void CSQCPlayer_ModelAppearance_PostUpdate(void)
+void CSQCPlayer_ModelAppearance_PostUpdate()
 {SELFPARAM();
        self.forceplayermodels_savemodel = self.model;
        self.forceplayermodels_savemodelindex = self.modelindex;
@@ -136,8 +136,7 @@ void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
        // which one is ALWAYS good?
        if (!forceplayermodels_goodmodel)
        {
-               entity e;
-               e = spawn();
+               entity e = spawn();
                precache_model(cvar_defstring("_cl_playermodel"));
                _setmodel(e, cvar_defstring("_cl_playermodel"));
                forceplayermodels_goodmodel = e.model;
@@ -168,8 +167,7 @@ void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
                forceplayermodels_attempted = 1;
 
                // only if this failed, find it out on our own
-               entity e;
-               e = spawn();
+               entity e = spawn();
                _setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
                forceplayermodels_modelisgoodmodel = fexists(e.model);
                forceplayermodels_model = e.model;
@@ -180,8 +178,7 @@ void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
 
        if(autocvar_cl_forcemyplayermodel != "" && autocvar_cl_forcemyplayermodel != forceplayermodels_mymodel)
        {
-               entity e;
-               e = spawn();
+               entity e = spawn();
                _setmodel(e, autocvar_cl_forcemyplayermodel); // this is harmless, see below
                forceplayermodels_myisgoodmodel = fexists(e.model);
                forceplayermodels_mymodel = e.model;
@@ -313,7 +310,7 @@ void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
 .int csqcmodel_framecount;
 
 #define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
-void CSQCPlayer_FallbackFrame_PreUpdate(void)
+void CSQCPlayer_FallbackFrame_PreUpdate()
 {SELFPARAM();
        self.frame = self.csqcmodel_saveframe;
        self.frame2 = self.csqcmodel_saveframe2;
@@ -372,7 +369,7 @@ int CSQCPlayer_FallbackFrame(int f)
        LOG_INFOF("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
        return f;
 }
-void CSQCPlayer_FallbackFrame_Apply(void)
+void CSQCPlayer_FallbackFrame_Apply()
 {SELFPARAM();
        self.frame = CSQCPlayer_FallbackFrame(self.frame);
        self.frame2 = CSQCPlayer_FallbackFrame(self.frame2);
@@ -386,7 +383,7 @@ void CSQCPlayer_FallbackFrame_Apply(void)
 .entity tag_entity;
 .int tag_entity_lastmodelindex;
 .int tag_index;
-void CSQCModel_AutoTagIndex_Apply(void)
+void CSQCModel_AutoTagIndex_Apply()
 {SELFPARAM();
        if(self.tag_entity && wasfreed(self.tag_entity))
                self.tag_entity = world;
@@ -481,14 +478,14 @@ const int MF_TRACER3 = BIT(7); // purple trail
 .int csqcmodel_effects;
 .int csqcmodel_modelflags;
 .int csqcmodel_traileffect;
-void CSQCModel_Effects_PreUpdate(void)
+void CSQCModel_Effects_PreUpdate()
 {SELFPARAM();
        self.effects = self.csqcmodel_effects;
        self.modelflags = self.csqcmodel_modelflags;
        self.traileffect = self.csqcmodel_traileffect;
 }
-void Reset_ArcBeam(void);
-void CSQCModel_Effects_PostUpdate(void)
+void Reset_ArcBeam();
+void CSQCModel_Effects_PostUpdate()
 {SELFPARAM();
        if (self == csqcplayer) {
                if (self.csqcmodel_teleported) {
@@ -504,7 +501,7 @@ void CSQCModel_Effects_PostUpdate(void)
                Projectile_ResetTrail(self, self.origin);
 }
 .int snd_looping;
-void CSQCModel_Effects_Apply(void)
+void CSQCModel_Effects_Apply()
 {SELFPARAM();
        int eff = self.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
        int tref = self.csqcmodel_traileffect;
@@ -532,9 +529,9 @@ void CSQCModel_Effects_Apply(void)
        if(eff & EF_FULLBRIGHT)
                self.renderflags |= RF_FULLBRIGHT;
        if(eff & EF_FLAME)
-               pointparticles(particleeffectnum(EFFECT_EF_FLAME), self.origin, '0 0 0', bound(0, frametime, 0.1));
+               pointparticles(EFFECT_EF_FLAME, self.origin, '0 0 0', bound(0, frametime, 0.1));
        if(eff & EF_STARDUST)
-               pointparticles(particleeffectnum(EFFECT_EF_STARDUST), self.origin, '0 0 0', bound(0, frametime, 0.1));
+               pointparticles(EFFECT_EF_STARDUST, self.origin, '0 0 0', bound(0, frametime, 0.1));
        if(eff & EF_NOSHADOW)
                self.renderflags |= RF_NOSHADOW;
        if(eff & EF_NODEPTHTEST)
diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc
deleted file mode 100644 (file)
index 34890e0..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-#include "damage.qh"
-
-#include "gibs.qh"
-#include "../common/deathtypes/all.qh"
-#include "../common/movetypes/movetypes.qh"
-#include "../common/vehicles/all.qh"
-#include "../common/weapons/all.qh"
-
-.entity tag_entity;
-
-.float cnt;
-.int state;
-.bool isplayermodel;
-
-void DamageEffect_Think()
-{SELFPARAM();
-       // if particle distribution is enabled, slow ticrate by total number of damages
-       if(autocvar_cl_damageeffect_distribute)
-               self.nextthink = time + autocvar_cl_damageeffect_ticrate * self.owner.total_damages;
-       else
-               self.nextthink = time + autocvar_cl_damageeffect_ticrate;
-
-       if(time >= self.cnt || !self.owner || !self.owner.modelindex || !self.owner.drawmask)
-       {
-               // time is up or the player got gibbed / disconnected
-               self.owner.total_damages = max(0, self.owner.total_damages - 1);
-               remove(self);
-               return;
-       }
-       if(self.state && !self.owner.csqcmodel_isdead)
-       {
-               // if the player was dead but is now alive, it means he respawned
-               // if so, clear his damage effects, or damages from his dead body will be copied back
-               self.owner.total_damages = max(0, self.owner.total_damages - 1);
-               remove(self);
-               return;
-       }
-       self.state = self.owner.csqcmodel_isdead;
-       if(self.owner.isplayermodel && (self.owner.entnum == player_localentnum) && !autocvar_chase_active)
-               return; // if we aren't using a third person camera, hide our own effects
-
-       // now generate the particles
-       vector org;
-       org = gettaginfo(self, 0); // origin at attached location
-       pointparticles(self.team, org, '0 0 0', 1);
-}
-
-void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
-{SELFPARAM();
-       // particle effects for players and objects damaged by weapons (eg: flames coming out of victims shot with rockets)
-
-       int nearestbone = 0;
-       float life;
-       string specstr, effectname;
-       entity e;
-
-       if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage)
-               return;
-       if(!self || !self.modelindex || !self.drawmask)
-               return;
-
-       // if this is a rigged mesh, the effect will show on the bone where damage was dealt
-       // we do this by choosing the skeletal bone closest to the impact, and attaching our entity to it
-       // if there's no skeleton, object origin will automatically be selected
-       FOR_EACH_TAG(self)
-       {
-               if(!tagnum)
-                       continue; // skip empty bones
-               // blacklist bones positioned outside the mesh, or the effect will be floating
-               // TODO: Do we have to do it this way? Why do these bones exist at all?
-               if(gettaginfo_name == "master" || gettaginfo_name == "knee_L" || gettaginfo_name == "knee_R" || gettaginfo_name == "leg_L" || gettaginfo_name == "leg_R")
-                       continue; // player model bone blacklist
-
-               // now choose the bone closest to impact origin
-               if(nearestbone == 0 || vlen(hitorg - gettaginfo(self, tagnum)) <= vlen(hitorg - gettaginfo(self, nearestbone)))
-                       nearestbone = tagnum;
-       }
-       gettaginfo(self, nearestbone); // set gettaginfo_name
-
-       // return if we reached our damage effect limit or damages are disabled
-       // TODO: When the limit is reached, it would be better if the oldest damage was removed instead of not adding a new one
-       if(nearestbone)
-       {
-               if(self.total_damages >= autocvar_cl_damageeffect_bones)
-                       return; // allow multiple damages on skeletal models
-       }
-       else
-       {
-               if(autocvar_cl_damageeffect < 2 || self.total_damages)
-                       return; // allow a single damage on non-skeletal models
-       }
-
-       life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
-
-       effectname = DEATH_WEAPONOF(type).netname;
-
-       if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD")
-       {
-               if(self.isplayermodel)
-               {
-                       specstr = species_prefix(specnum);
-                       specstr = substring(specstr, 0, strlen(specstr) - 1);
-                       effectname = strreplace("BLOOD", specstr, effectname);
-               }
-               else { return; } // objects don't bleed
-       }
-
-       e = spawn();
-       setmodel(e, MDL_Null); // necessary to attach and read origin
-       setattachment(e, self, gettaginfo_name); // attach to the given bone
-       e.classname = "damage";
-       e.owner = self;
-       e.cnt = time + life;
-       e.team = _particleeffectnum(effectname);
-       e.think = DamageEffect_Think;
-       e.nextthink = time;
-       self.total_damages += 1;
-}
-
-void Ent_DamageInfo(float isNew)
-{SELFPARAM();
-       float thedamage, rad, edge, thisdmg;
-       bool hitplayer = false;
-       int species, forcemul;
-       vector force, thisforce;
-
-       w_deathtype = ReadShort();
-       w_issilent = (w_deathtype & 0x8000);
-       w_deathtype = (w_deathtype & 0x7FFF);
-
-       w_org.x = ReadCoord();
-       w_org.y = ReadCoord();
-       w_org.z = ReadCoord();
-
-       thedamage = ReadByte();
-       rad = ReadByte();
-       edge = ReadByte();
-       force = decompressShortVector(ReadShort());
-       species = ReadByte();
-
-       if (!isNew)
-               return;
-
-       if(rad < 0)
-       {
-               rad = -rad;
-               forcemul = -1;
-       }
-       else
-               forcemul = 1;
-
-       for(entity e = findradius(w_org, rad + MAX_DAMAGEEXTRARADIUS); e; e = e.chain)
-       {
-               setself(e);
-               // attached ents suck
-               if(self.tag_entity)
-                       continue;
-
-               vector nearest = NearestPointOnBox(self, w_org);
-               if(rad)
-               {
-                       thisdmg = ((vlen (nearest - w_org) - bound(MIN_DAMAGEEXTRARADIUS, self.damageextraradius, MAX_DAMAGEEXTRARADIUS)) / rad);
-                       if(thisdmg >= 1)
-                               continue;
-                       if(thisdmg < 0)
-                               thisdmg = 0;
-                       if(thedamage)
-                       {
-                               thisdmg = thedamage + (edge - thedamage) * thisdmg;
-                               thisforce = forcemul * vlen(force) * (thisdmg / thedamage) * normalize(self.origin - w_org);
-                       }
-                       else
-                       {
-                               thisdmg = 0;
-                               thisforce = forcemul * vlen(force) * normalize(self.origin - w_org);
-                       }
-               }
-               else
-               {
-                       if(vlen(nearest - w_org) > bound(MIN_DAMAGEEXTRARADIUS, self.damageextraradius, MAX_DAMAGEEXTRARADIUS))
-                               continue;
-
-                       thisdmg = thedamage;
-                       thisforce = forcemul * force;
-               }
-
-               if(self.damageforcescale)
-                       if(vlen(thisforce))
-                       {
-                               self.move_velocity = self.move_velocity + damage_explosion_calcpush(self.damageforcescale * thisforce, self.move_velocity, autocvar_g_balance_damagepush_speedfactor);
-                               self.move_flags &= ~FL_ONGROUND;
-                       }
-
-               if(w_issilent)
-                       self.silent = 1;
-
-               if(self.event_damage)
-                       self.event_damage(thisdmg, w_deathtype, w_org, thisforce);
-
-               DamageEffect(w_org, thisdmg, w_deathtype, species);
-
-               if(self.isplayermodel)
-                       hitplayer = true; // this impact damaged a player
-       }
-       setself(this);
-
-       if(DEATH_ISVEHICLE(w_deathtype))
-       {
-               traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-               if(trace_plane_normal != '0 0 0')
-                       w_backoff = trace_plane_normal;
-               else
-                       w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
-
-               setorigin(self, w_org + w_backoff * 2); // for sound() calls
-
-               switch(DEATH_ENT(w_deathtype))
-               {
-                       case DEATH_VH_CRUSH:
-                               break;
-
-                       // spiderbot
-                       case DEATH_VH_SPID_MINIGUN:
-                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_SPID_ROCKET:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_SPIDERBOT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_SPID_DEATH:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                       case DEATH_VH_WAKI_GUN:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_RACER_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_WAKI_ROCKET:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_RACER_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_WAKI_DEATH:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                       case DEATH_VH_RAPT_CANNON:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_RAPTOR_CANNON_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_RAPT_FRAGMENT:
-                               float i;
-                               vector ang, vel;
-                               for(i = 1; i < 4; ++i)
-                               {
-                                       vel = normalize(w_org - (w_org + normalize(force) * 16)) + randomvec() * 128;
-                                       ang = vectoangles(vel);
-                                       RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i));
-                               }
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_SPREAD), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_RAPT_BOMB:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_RAPT_DEATH:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
-                               break;
-                       case DEATH_VH_BUMB_GUN:
-                               sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_BIGPLASMA_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-               }
-       }
-
-
-       if(DEATH_ISTURRET(w_deathtype))
-       {
-               traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-               if(trace_plane_normal != '0 0 0')
-                       w_backoff = trace_plane_normal;
-               else
-                       w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
-
-               setorigin(self, w_org + w_backoff * 2); // for sound() calls
-
-               switch(DEATH_ENT(w_deathtype))
-               {
-                        case DEATH_TURRET_EWHEEL:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                        case DEATH_TURRET_FLAC:
-                               pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), w_org, '0 0 0', 1);
-                               sound(self, CH_SHOTS, SND_HAGEXP_RANDOM(), VOL_BASE, ATTEN_NORM);
-                               break;
-
-                        case DEATH_TURRET_MLRS:
-                        case DEATH_TURRET_HK:
-                        case DEATH_TURRET_WALK_ROCKET:
-                        case DEATH_TURRET_HELLION:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                        case DEATH_TURRET_MACHINEGUN:
-                        case DEATH_TURRET_WALK_GUN:
-                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                        case DEATH_TURRET_PLASMA:
-                               sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                        case DEATH_TURRET_WALK_MELEE:
-                               sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum(EFFECT_TE_SPARK), self.origin, w_backoff * 1000, 1);
-                               break;
-
-                        case DEATH_TURRET_PHASER:
-                               break;
-
-                        case DEATH_TURRET_TESLA:
-                               te_smallflash(self.origin);
-                               break;
-
-               }
-       }
-
-       // TODO spawn particle effects and sounds based on w_deathtype
-       if(!DEATH_ISSPECIAL(w_deathtype))
-       if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
-       {
-               Weapon hitwep = DEATH_WEAPONOF(w_deathtype);
-               w_random = prandom();
-
-               traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-               if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER)
-                       w_backoff = trace_plane_normal;
-               else
-                       w_backoff = -1 * normalize(force);
-               setorigin(self, w_org + w_backoff * 2); // for sound() calls
-
-               if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) {
-                       hitwep.wr_impacteffect(hitwep);
-               }
-       }
-}
diff --git a/qcsrc/client/damage.qh b/qcsrc/client/damage.qh
deleted file mode 100644 (file)
index 3f11b9a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CLIENT_DAMAGE_H
-#define CLIENT_DAMAGE_H
-
-.float total_damages; // number of effects which currently are attached to a player
-
-void Ent_DamageInfo(float isNew);
-
-#endif
index 6325a8a..98f25cc 100644 (file)
@@ -23,8 +23,8 @@ float         dmg_take;
 #endif
 
 // Basic variables
-.float enttype; // entity type sent from server
-.int   sv_entnum; // entity number sent from server
+.int enttype; // entity type sent from server
+.int sv_entnum; // entity number sent from server
 .int team;
 .int team_size;
 
diff --git a/qcsrc/client/effects.qc b/qcsrc/client/effects.qc
deleted file mode 100644 (file)
index 21fa1ce..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#include "effects.qh"
-
-/*
-.vector fx_start;
-.vector fx_end;
-.float  fx_with;
-.string fx_texture;
-.float  fx_lifetime;
-
-void b_draw()
-{
-    //Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE, view_origin);
-    Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, (self.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE, view_origin);
-
-}
-void b_make(vector s,vector e, string t,float l,float z)
-{
-    entity b;
-    b = spawn();
-    b.fx_texture = t;
-    b.fx_start = s;
-    b.fx_end = e;
-    b.fx_with = z;
-    b.think = SUB_Remove;
-    b.nextthink = time + l;
-       b.draw = b_draw;
-
-       //b.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
-}
-*/
-
-void cl_effects_lightningarc(vector from, vector to,float seglength,float drifts,float drifte,float branchfactor,float branchfactor_add)
-{
-    vector direction,dirnew, pos, pos_l;
-    float length, steps, steplength, i,drift;
-
-    length     = vlen(from - to);
-    if(length < 1)
-        return;
-
-    // Use at most 16 te_lightning1 segments, as these eat up beam list segments.
-    // TODO: Change this to R_BeginPolygon code, then we no longer have this limit.
-    steps      = min(16, floor(length / seglength));
-    if(steps < 1)
-    {
-        te_lightning1(world,from,to);
-        return;
-    }
-
-    steplength = length / steps;
-    direction  = normalize(to - from);
-    pos_l = from;
-    if(length > seglength)
-    {
-        for(i = 1; i < steps; i += 1)
-        {
-            drift = drifts * (1 - (i / steps)) + drifte * (i / steps);
-            dirnew = normalize(direction * (1 - drift) + randomvec() * drift);
-            pos = pos_l +  dirnew * steplength;
-            te_lightning1(world,pos_l,pos);
-            // WTF endless recursion if branchfactor is 1.0 (possibly due to adding branchfactor_add). FIXME
-            // if(random() < branchfactor)
-            //     cl_effects_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add);
-
-            pos_l = pos;
-        }
-        te_lightning1(world,pos_l,to);
-
-    }
-    else
-        te_lightning1(world,from,to);
-
-}
-
-void Net_ReadLightningarc()
-{
-       vector from, to;
-
-    from.x = ReadCoord(); from.y = ReadCoord(); from.z = ReadCoord();
-    to.x = ReadCoord(); to.y = ReadCoord(); to.z = ReadCoord();
-
-    if(autocvar_cl_effects_lightningarc_simple)
-    {
-        te_lightning1(world,from,to);
-    }
-    else
-    {
-        float seglength, drifts, drifte, branchfactor, branchfactor_add;
-
-        seglength        = autocvar_cl_effects_lightningarc_segmentlength;
-        drifts           = autocvar_cl_effects_lightningarc_drift_start;
-        drifte           = autocvar_cl_effects_lightningarc_drift_end;
-        branchfactor     = autocvar_cl_effects_lightningarc_branchfactor_start;
-        branchfactor_add = autocvar_cl_effects_lightningarc_branchfactor_add;
-
-        cl_effects_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
-    }
-
-}
-void Net_ReadArc() { Net_ReadLightningarc(); }
diff --git a/qcsrc/client/effects.qh b/qcsrc/client/effects.qh
deleted file mode 100644 (file)
index 2d93f41..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CLIENT_EFFECTS_H
-#define CLIENT_EFFECTS_H
-
-void Net_ReadArc();
-
-#endif
diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc
deleted file mode 100644 (file)
index d7114d1..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-#include "generator.qh"
-
-#include "teamradar.qh"
-#include "../common/movetypes/movetypes.qh"
-
-.float alpha;
-.float scale;
-.int count;
-.float max_health;
-
-void ons_generator_ray_draw(entity this)
-{
-       if(time < self.move_time)
-               return;
-
-       self.move_time = time + 0.05;
-
-       if(self.count > 10)
-       {
-               remove(self);
-               return;
-       }
-
-       if(self.count > 5)
-               self.alpha -= 0.1;
-       else
-               self.alpha += 0.1;
-
-       self.scale += 0.2;
-       self.count +=1;
-}
-
-void ons_generator_ray_spawn(vector org)
-{
-       entity e;
-       e = spawn();
-       e.classname = "ons_ray";
-       setmodel(e, MDL_ONS_RAY);
-       setorigin(e, org);
-       e.angles = randomvec() * 360;
-       e.move_origin = org;
-       e.movetype = MOVETYPE_NONE;
-       e.alpha = 0;
-       e.scale = random() * 5 + 8;
-       e.move_time = time + 0.05;
-       e.drawmask = MASK_NORMAL;
-       e.draw = ons_generator_ray_draw;
-}
-
-void generator_draw(entity this)
-{
-       if(time < self.move_time)
-               return;
-
-       if(self.health > 0)
-       {
-               // damaged fx (less probable the more damaged is the generator)
-               if(random() < 0.9 - self.health / self.max_health)
-               if(random() < 0.01)
-               {
-                       pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
-                       sound(self, CH_TRIGGER, SND_ONS_ELECTRICITY_EXPLODE, VOL_BASE, ATTEN_NORM);
-               }
-               else
-                       pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_DAMAGED), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
-
-               self.move_time = time + 0.1;
-
-               return;
-       }
-
-       if(self.count <= 0)
-               return;
-
-       vector org;
-       int i;
-
-       // White shockwave
-       if(self.count==40||self.count==20)
-       {
-               sound(self, CH_TRIGGER, SND_ONS_SHOCKWAVE, VOL_BASE, ATTEN_NORM);
-               pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), self.origin, '0 0 0', 6);
-       }
-
-       // rays
-       if(random() > 0.25)
-       {
-               ons_generator_ray_spawn(self.origin);
-       }
-
-       // Spawn fire balls
-       for(i=0;i < 10;++i)
-       {
-               org = self.origin + randompos('-30 -30 -30' * i + '0 0 -20', '30 30 30' * i + '0 0 20');
-               pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_GIB), org, '0 0 0', 1);
-       }
-
-       // Short explosion sound + small explosion
-       if(random() < 0.25)
-       {
-               te_explosion(self.origin);
-               sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
-       }
-
-       // Particles
-       org = self.origin + randompos(self.mins + '8 8 8', self.maxs + '-8 -8 -8');
-       pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE), org, '0 0 0', 1);
-
-       // Final explosion
-       if(self.count==1)
-       {
-               org = self.origin;
-               te_explosion(org);
-               pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE2), org, '0 0 0', 1);
-               sound(self, CH_TRIGGER, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-       }
-
-       self.move_time = time + 0.05;
-
-       self.count -= 1;
-}
-
-void generator_damage(float hp)
-{SELFPARAM();
-       if(hp <= 0)
-               setmodel(self, MDL_ONS_GEN_DEAD);
-       else if(hp < self.max_health * 0.10)
-               setmodel(self, MDL_ONS_GEN9);
-       else if(hp < self.max_health * 0.20)
-               setmodel(self, MDL_ONS_GEN8);
-       else if(hp < self.max_health * 0.30)
-               setmodel(self, MDL_ONS_GEN7);
-       else if(hp < self.max_health * 0.40)
-               setmodel(self, MDL_ONS_GEN6);
-       else if(hp < self.max_health * 0.50)
-               setmodel(self, MDL_ONS_GEN5);
-       else if(hp < self.max_health * 0.60)
-               setmodel(self, MDL_ONS_GEN4);
-       else if(hp < self.max_health * 0.70)
-               setmodel(self, MDL_ONS_GEN3);
-       else if(hp < self.max_health * 0.80)
-               setmodel(self, MDL_ONS_GEN2);
-       else if(hp < self.max_health * 0.90)
-               setmodel(self, MDL_ONS_GEN1);
-       else if(hp <= self.max_health || hp >= self.max_health)
-               setmodel(self, MDL_ONS_GEN);
-
-       setsize(self, GENERATOR_MIN, GENERATOR_MAX);
-}
-
-void generator_construct()
-{SELFPARAM();
-       self.netname = "Generator";
-       self.classname = "onslaught_generator";
-
-       setorigin(self, self.origin);
-       setmodel(self, MDL_ONS_GEN);
-       setsize(self, GENERATOR_MIN, GENERATOR_MAX);
-
-       self.move_movetype      = MOVETYPE_NOCLIP;
-       self.solid                      = SOLID_BBOX;
-       self.movetype           = MOVETYPE_NOCLIP;
-       self.move_origin        = self.origin;
-       self.move_time          = time;
-       self.drawmask           = MASK_NORMAL;
-       self.alpha                      = 1;
-       self.draw                       = generator_draw;
-}
-
-.vector glowmod;
-void generator_changeteam()
-{SELFPARAM();
-       if(self.team)
-       {
-               self.glowmod = Team_ColorRGB(self.team - 1);
-               self.teamradar_color = Team_ColorRGB(self.team - 1);
-               self.colormap = 1024 + (self.team - 1) * 17;
-       }
-       else
-       {
-               self.colormap = 1024;
-               self.glowmod = '1 1 0';
-               self.teamradar_color = '1 1 0';
-       }
-}
-
-void ent_generator()
-{SELFPARAM();
-       int sf = ReadByte();
-
-       if(sf & GSF_SETUP)
-       {
-               self.origin_x = ReadCoord();
-               self.origin_y = ReadCoord();
-               self.origin_z = ReadCoord();
-               setorigin(self, self.origin);
-
-               self.health = ReadByte();
-               self.max_health = ReadByte();
-               self.count = ReadByte();
-               self.team = ReadByte();
-
-               if(!self.count)
-                       self.count = 40;
-
-               generator_changeteam();
-               generator_construct();
-       }
-
-       if(sf & GSF_STATUS)
-       {
-               int _tmp;
-               _tmp = ReadByte();
-               if(_tmp != self.team)
-               {
-                       self.team = _tmp;
-                       generator_changeteam();
-               }
-
-               _tmp = ReadByte();
-
-               if(_tmp != self.health)
-                       generator_damage(_tmp);
-
-               self.health = _tmp;
-       }
-}
diff --git a/qcsrc/client/generator.qh b/qcsrc/client/generator.qh
deleted file mode 100644 (file)
index c60aff4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef CLIENT_GENERATOR_H
-#define CLIENT_GENERATOR_H
-const vector GENERATOR_MIN = '-52 -52 -14';
-const vector GENERATOR_MAX = '52 52 75';
-
-const int GSF_STATUS = 4;
-const int GSF_SETUP = 8;
-
-void ent_generator();
-#endif
diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc
deleted file mode 100644 (file)
index 4afa5eb..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-#include "gibs.qh"
-
-#include "rubble.qh"
-#include "../common/movetypes/movetypes.qh"
-
-.float scale;
-.float alpha;
-.float cnt;
-.float gravity;
-
-void Gib_Delete()
-{SELFPARAM();
-       remove(self);
-}
-
-string species_prefix(int specnum)
-{
-       switch(specnum)
-       {
-               case SPECIES_HUMAN:       return "";
-               case SPECIES_ALIEN:       return "alien_";
-               case SPECIES_ROBOT_SHINY: return "robot_";
-               case SPECIES_ROBOT_RUSTY: return "robot_"; // use the same effects, only different gibs
-               case SPECIES_ROBOT_SOLID: return "robot_"; // use the same effects, only different gibs
-               case SPECIES_ANIMAL:      return "animal_";
-               case SPECIES_RESERVED:    return "reserved_";
-               default:         return "";
-       }
-}
-
-void Gib_setmodel(entity gib, string mdlname, int specnum)
-{
-       switch(specnum)
-       {
-               case SPECIES_ROBOT_RUSTY:
-               case SPECIES_ROBOT_SHINY:
-               case SPECIES_ROBOT_SOLID:
-                       if(specnum != SPECIES_ROBOT_SOLID || mdlname == "models/gibs/chunk.mdl")
-                       {
-                               if(mdlname == "models/gibs/bloodyskull.md3")
-                                       setmodel(gib, MDL_GIB_ROBO);
-                               else
-                                       setmodel(gib, MDL_GIB_ROBO_RANDOM());
-                               if(specnum == SPECIES_ROBOT_SHINY)
-                               {
-                                       gib.skin = 1;
-                                       gib.colormod = '2 2 2';
-                               }
-                               gib.scale = 1;
-                               break;
-                       }
-               default:
-                       _setmodel(gib, mdlname);
-                       gib.skin = specnum;
-                       break;
-       }
-}
-
-void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany)
-{
-       float i, pmod;
-       pmod = autocvar_cl_particles_quality;
-       for (i = 0; i < 50 * pmod; ++i)
-               pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
-}
-
-void SUB_RemoveOnNoImpact()
-{
-       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
-               Gib_Delete();
-}
-
-void Gib_Touch()
-{SELFPARAM();
-       // TODO maybe bounce of walls, make more gibs, etc.
-
-       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
-       {
-               Gib_Delete();
-               return;
-       }
-
-       if(!self.silent)
-               sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
-       pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
-
-       Gib_Delete();
-}
-
-void Gib_Draw(entity this)
-{
-       vector oldorg;
-       oldorg = self.origin;
-
-       Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
-       if(wasfreed(self))
-               return;
-
-       if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie...
-               // TODO somehow make it spray in a direction dependent on self.angles
-               trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
-       else
-               trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
-
-       self.renderflags = 0;
-
-       // make gibs die faster at low view quality
-       // if view_quality is 0.5, we want to have them die twice as fast
-       self.nextthink -= frametime * (1 / bound(0.01, view_quality, 1.00) - 1);
-
-       self.alpha = bound(0, self.nextthink - time, 1);
-
-       if(self.alpha < ALPHA_MIN_VISIBLE)
-       {
-               self.drawmask = 0;
-               Gib_Delete();
-       }
-}
-
-void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, int specnum, bool destroyontouch, bool issilent)
-{
-       entity gib;
-
-       // TODO remove some gibs according to cl_nogibs
-       gib = RubbleNew("gib");
-       gib.classname = "gib";
-       gib.move_movetype = MOVETYPE_BOUNCE;
-       gib.gravity = 1;
-       gib.solid = SOLID_CORPSE;
-       gib.cnt = specnum;
-       gib.silent = issilent;
-       Gib_setmodel(gib, mdlname, specnum);
-
-       setsize (gib, '-8 -8 -8', '8 8 8');
-
-       gib.draw = Gib_Draw;
-       if(destroyontouch)
-               gib.move_touch = Gib_Touch;
-       else
-               gib.move_touch = SUB_RemoveOnNoImpact;
-
-       // don't spawn gibs inside solid - just don't
-       if(org != safeorg)
-       {
-               tracebox(safeorg, gib.mins, gib.maxs, org, MOVE_NOMONSTERS, gib);
-               org = trace_endpos;
-       }
-
-       gib.move_origin = org;
-       setorigin(gib, org);
-       gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
-       gib.move_avelocity = prandomvec() * vlen(gib.move_velocity) * autocvar_cl_gibs_avelocity_scale;
-       gib.move_time = time;
-       gib.damageforcescale = autocvar_cl_gibs_damageforcescale;
-
-       gib.nextthink = time + autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15);
-       gib.drawmask = MASK_NORMAL;
-
-       RubbleLimit("gib", autocvar_cl_gibs_maxcount, Gib_Delete);
-}
-
-void Ent_GibSplash(bool isNew)
-{SELFPARAM();
-       int amount, type, specnum;
-       vector org, vel;
-       string specstr;
-       bool issilent;
-       string gentle_prefix = "morphed_";
-
-       float randomvalue;
-       int c;
-
-       type = ReadByte(); // gibbage type
-       amount = ReadByte() / 16.0; // gibbage amount
-       org.x = ReadShort() * 4 + 2;
-       org.y = ReadShort() * 4 + 2;
-       org.z = ReadShort() * 4 + 2;
-       vel = decompressShortVector(ReadShort());
-
-       float cl_gentle_gibs = autocvar_cl_gentle_gibs;
-       if(cl_gentle_gibs || autocvar_cl_gentle)
-               type |= 0x80; // set gentle bit
-
-       if(type & 0x80)
-       {
-               if(cl_gentle_gibs == 2)
-                       gentle_prefix = "";
-               else if(cl_gentle_gibs == 3)
-                       gentle_prefix = "happy_";
-       }
-       else if(autocvar_cl_particlegibs)
-       {
-               type |= 0x80;
-               gentle_prefix = "particlegibs_";
-       }
-
-       if (!(cl_gentle_gibs || autocvar_cl_gentle))
-               amount *= 1 - autocvar_cl_nogibs;
-
-       if(autocvar_ekg)
-               amount *= 5;
-
-       if(amount <= 0 || !isNew)
-               return;
-
-       setorigin(self, org); // for the sounds
-
-       specnum = (type & 0x78) / 8; // blood/gibmodel type: using four bits (0..7, bit indexes 3,4,5)
-       issilent = (type & 0x40);
-       type = type & 0x87; // remove the species bits: bit 7 = gentle, bit 0,1,2 = kind of gib
-       specstr = species_prefix(specnum);
-
-       switch(type)
-       {
-               case 0x01:
-                       if(!issilent)
-                               sound (self, CH_PAIN, SND_GIB, VOL_BASE, ATTEN_NORM);
-
-                       if(prandom() < amount)
-                               TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
-                       new_te_bloodshower(_particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount);
-                       if(prandom() < amount)
-                               TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent);
-
-                       for(c = 0; c < amount; ++c)
-                       {
-                               randomvalue = amount - c;
-
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/chest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/smallchest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/leg1.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/leg2.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent);
-
-                               // these splat on impact
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
-                               if(prandom() < randomvalue)
-                                       TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);
-                       }
-                       break;
-               case 0x02:
-                       pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
-                       break;
-               case 0x03:
-                       if(prandom() < amount)
-                               TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization?
-                       break;
-               case 0x81:
-                       pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
-                       break;
-               case 0x82:
-                       pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
-                       break;
-               case 0x83:
-                       // no gibs in gentle mode, sorry
-                       break;
-       }
-}
diff --git a/qcsrc/client/gibs.qh b/qcsrc/client/gibs.qh
deleted file mode 100644 (file)
index eb63aa1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef CLIENT_GIBS_H
-#define CLIENT_GIBS_H
-
-.vector colormod;
-
-.bool silent;
-
-void Gib_Delete();
-
-string species_prefix(int specnum);
-
-void Gib_setmodel(entity gib, string mdlname, int specnum);
-
-void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany);
-
-void SUB_RemoveOnNoImpact();
-
-void Gib_Touch();
-
-void Gib_Draw(entity this);
-
-void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, int specnum, bool destroyontouch, bool issilent);
-
-void Ent_GibSplash(bool isNew);
-
-#endif
index 5b8d093..cee2a0c 100644 (file)
@@ -4,7 +4,7 @@
 #include "../lib/warpzone/common.qh"
 
 entityclass(Hook);
-class(Hook) .float HookType; // ENT_CLIENT_*
+class(Hook) .entity HookType; // ENT_CLIENT_*
 class(Hook) .vector origin;
 class(Hook) .vector velocity;
 class(Hook) .float HookSilent;
@@ -48,10 +48,10 @@ void Draw_GrapplingHook(entity this)
        switch(self.HookType)
        {
                default:
-               case ENT_CLIENT_HOOK:
+               case NET_ENT_CLIENT_HOOK:
                        vs = hook_shotorigin[s];
                        break;
-               case ENT_CLIENT_ARC_BEAM:
+               case NET_ENT_CLIENT_ARC_BEAM:
                        vs = lightning_shotorigin[s];
                        break;
        }
@@ -61,11 +61,11 @@ void Draw_GrapplingHook(entity this)
                switch(self.HookType)
                {
                        default:
-                       case ENT_CLIENT_HOOK:
+                       case NET_ENT_CLIENT_HOOK:
                                a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
                                b = self.origin;
                                break;
-                       case ENT_CLIENT_ARC_BEAM:
+                       case NET_ENT_CLIENT_ARC_BEAM:
                                if(self.HookRange)
                                        b = view_origin + view_forward * self.HookRange;
                                else
@@ -81,11 +81,11 @@ void Draw_GrapplingHook(entity this)
                switch(self.HookType)
                {
                        default:
-                       case ENT_CLIENT_HOOK:
+                       case NET_ENT_CLIENT_HOOK:
                                a = self.velocity;
                                b = self.origin;
                                break;
-                       case ENT_CLIENT_ARC_BEAM:
+                       case NET_ENT_CLIENT_ARC_BEAM:
                                a = self.origin;
                                b = self.velocity;
                                break;
@@ -97,7 +97,7 @@ void Draw_GrapplingHook(entity this)
        switch(self.HookType)
        {
                default:
-               case ENT_CLIENT_HOOK:
+               case NET_ENT_CLIENT_HOOK:
                        intensity = 1;
                        offset = 0;
                        switch(t)
@@ -109,7 +109,7 @@ void Draw_GrapplingHook(entity this)
                                default: tex = "particles/hook_white"; rgb = getcsqcplayercolor(self.sv_entnum); break;
                        }
                        break;
-               case ENT_CLIENT_ARC_BEAM: // todo
+               case NET_ENT_CLIENT_ARC_BEAM: // todo
                        intensity = bound(0.2, 1 + Noise_Pink(self, frametime) * 1 + Noise_Burst(self, frametime, 0.03) * 0.3, 2);
                        offset = Noise_Brown(self, frametime) * 10;
                        tex = "particles/lgbeam";
@@ -121,7 +121,7 @@ void Draw_GrapplingHook(entity this)
        Draw_GrapplingHook_trace_callback_rnd = offset;
        Draw_GrapplingHook_trace_callback_rgb = rgb;
        Draw_GrapplingHook_trace_callback_a = intensity;
-       WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((self.HookType == ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), world, world, Draw_GrapplingHook_trace_callback);
+       WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((self.HookType == NET_ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), world, world, Draw_GrapplingHook_trace_callback);
        Draw_GrapplingHook_trace_callback_tex = string_null;
 
        atrans = WarpZone_TransformOrigin(WarpZone_trace_transform, a);
@@ -129,7 +129,7 @@ void Draw_GrapplingHook(entity this)
        switch(self.HookType)
        {
                default:
-               case ENT_CLIENT_HOOK:
+               case NET_ENT_CLIENT_HOOK:
                        if(vlen(trace_endpos - atrans) > 0.5)
                        {
                                setorigin(self, trace_endpos); // hook endpoint!
@@ -141,7 +141,7 @@ void Draw_GrapplingHook(entity this)
                                self.drawmask = 0;
                        }
                        break;
-               case ENT_CLIENT_ARC_BEAM:
+               case NET_ENT_CLIENT_ARC_BEAM:
                        setorigin(self, a); // beam origin!
                        break;
        }
@@ -149,10 +149,10 @@ void Draw_GrapplingHook(entity this)
        switch(self.HookType)
        {
                default:
-               case ENT_CLIENT_HOOK:
+               case NET_ENT_CLIENT_HOOK:
                        break;
-               case ENT_CLIENT_ARC_BEAM:
-                       pointparticles(particleeffectnum(EFFECT_ARC_LIGHTNING2), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
+               case NET_ENT_CLIENT_ARC_BEAM:
+                       pointparticles(EFFECT_ARC_LIGHTNING2, trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
                        break;
        }
 }
@@ -162,9 +162,9 @@ void Remove_GrapplingHook()
        sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
 }
 
-void Ent_ReadHook(float bIsNew, float type)
-{SELFPARAM();
-       self.HookType = type;
+NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
+{
+       self.HookType = NET_ENT_CLIENT_HOOK;
 
        int sf = ReadByte();
 
@@ -181,10 +181,10 @@ void Ent_ReadHook(float bIsNew, float type)
                switch(self.HookType)
                {
                        default:
-                       case ENT_CLIENT_HOOK:
+                       case NET_ENT_CLIENT_HOOK:
                                self.HookRange = 0;
                                break;
-                       case ENT_CLIENT_ARC_BEAM:
+                       case NET_ENT_CLIENT_ARC_BEAM:
                                self.HookRange = ReadCoord();
                                break;
                }
@@ -213,18 +213,19 @@ void Ent_ReadHook(float bIsNew, float type)
                switch(self.HookType)
                {
                        default:
-                       case ENT_CLIENT_HOOK:
+                       case NET_ENT_CLIENT_HOOK:
                                // for the model
                                setmodel(self, MDL_HOOK);
                                self.drawmask = MASK_NORMAL;
                                break;
-                       case ENT_CLIENT_ARC_BEAM:
+                       case NET_ENT_CLIENT_ARC_BEAM:
                                sound (self, CH_SHOTS_SINGLE, SND_LGBEAM_FLY, VOL_BASE, ATTEN_NORM);
                                break;
                }
        }
 
        self.teleport_time = time + 10;
+       return true;
 }
 
 // TODO: hook: temporarily transform self.origin for drawing the model along warpzones!
index 9e6ee54..3662425 100644 (file)
@@ -3,6 +3,4 @@
 
 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
 
-void Ent_ReadHook(float bIsNew, float type);
-
 #endif
diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc
deleted file mode 100644 (file)
index a00a9c3..0000000
+++ /dev/null
@@ -1,4855 +0,0 @@
-#include "hud.qh"
-
-#include "hud_config.qh"
-#include "mapvoting.qh"
-#include "scoreboard.qh"
-#include "teamradar.qh"
-#include "t_items.qh"
-#include "../common/buffs/all.qh"
-#include "../common/deathtypes/all.qh"
-#include "../common/items/all.qc"
-#include "../common/mapinfo.qh"
-#include "../common/mutators/mutator/waypoints/all.qh"
-#include "../common/nades/all.qh"
-#include "../common/stats.qh"
-#include "../lib/csqcmodel/cl_player.qh"
-// TODO: remove
-#include "../server/mutators/mutator/gamemode_ctf.qc"
-
-
-/*
-==================
-Misc HUD functions
-==================
-*/
-
-vector HUD_Get_Num_Color (float x, float maxvalue)
-{
-       float blinkingamt;
-       vector color;
-       if(x >= maxvalue) {
-               color.x = sin(2*M_PI*time);
-               color.y = 1;
-               color.z = sin(2*M_PI*time);
-       }
-       else if(x > maxvalue * 0.75) {
-               color.x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0
-               color.y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1
-               color.z = 0;
-       }
-       else if(x > maxvalue * 0.5) {
-               color.x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4
-               color.y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9
-               color.z = 1 - (x-100)*0.02; // blue value between 1 -> 0
-       }
-       else if(x > maxvalue * 0.25) {
-               color.x = 1;
-               color.y = 1;
-               color.z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1
-       }
-       else if(x > maxvalue * 0.1) {
-               color.x = 1;
-               color.y = (x-20)*90/27/100; // green value between 0 -> 1
-               color.z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2
-       }
-       else {
-               color.x = 1;
-               color.y = 0;
-               color.z = 0;
-       }
-
-       blinkingamt = (1 - x/maxvalue/0.25);
-       if(blinkingamt > 0)
-       {
-               color.x = color.x - color.x * blinkingamt * sin(2*M_PI*time);
-               color.y = color.y - color.y * blinkingamt * sin(2*M_PI*time);
-               color.z = color.z - color.z * blinkingamt * sin(2*M_PI*time);
-       }
-       return color;
-}
-
-float HUD_GetRowCount(int item_count, vector size, float item_aspect)
-{
-       float aspect = size_y / size_x;
-       return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) / 2), item_count);
-}
-
-vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect)
-{
-       float columns, rows;
-       float ratio, best_ratio = 0;
-       float best_columns = 1, best_rows = 1;
-       bool vertical = (psize.x / psize.y >= item_aspect);
-       if(vertical)
-       {
-               psize = eX * psize.y + eY * psize.x;
-               item_aspect = 1 / item_aspect;
-       }
-
-       rows = ceil(sqrt(item_count));
-       columns = ceil(item_count/rows);
-       while(columns >= 1)
-       {
-               ratio = (psize.x/columns) / (psize.y/rows);
-               if(ratio > item_aspect)
-                       ratio = item_aspect * item_aspect / ratio;
-
-               if(ratio <= best_ratio)
-                       break; // ratio starts decreasing by now, skip next configurations
-
-               best_columns = columns;
-               best_rows = rows;
-               best_ratio = ratio;
-
-               if(columns == 1)
-                       break;
-
-               --columns;
-               rows = ceil(item_count/columns);
-       }
-
-       if(vertical)
-               return eX * best_rows + eY * best_columns;
-       else
-               return eX * best_columns + eY * best_rows;
-}
-
-// return the string of the onscreen race timer
-string MakeRaceString(int cp, float mytime, float theirtime, float lapdelta, string theirname)
-{
-       string col;
-       string timestr;
-       string cpname;
-       string lapstr;
-       lapstr = "";
-
-       if(theirtime == 0) // goal hit
-       {
-               if(mytime > 0)
-               {
-                       timestr = strcat("+", ftos_decimals(+mytime, TIME_DECIMALS));
-                       col = "^1";
-               }
-               else if(mytime == 0)
-               {
-                       timestr = "+0.0";
-                       col = "^3";
-               }
-               else
-               {
-                       timestr = strcat("-", ftos_decimals(-mytime, TIME_DECIMALS));
-                       col = "^2";
-               }
-
-               if(lapdelta > 0)
-               {
-                       lapstr = sprintf(_(" (-%dL)"), lapdelta);
-                       col = "^2";
-               }
-               else if(lapdelta < 0)
-               {
-                       lapstr = sprintf(_(" (+%dL)"), -lapdelta);
-                       col = "^1";
-               }
-       }
-       else if(theirtime > 0) // anticipation
-       {
-               if(mytime >= theirtime)
-                       timestr = strcat("+", ftos_decimals(mytime - theirtime, TIME_DECIMALS));
-               else
-                       timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(theirtime));
-               col = "^3";
-       }
-       else
-       {
-               col = "^7";
-               timestr = "";
-       }
-
-       if(cp == 254)
-               cpname = _("Start line");
-       else if(cp == 255)
-               cpname = _("Finish line");
-       else if(cp)
-               cpname = sprintf(_("Intermediate %d"), cp);
-       else
-               cpname = _("Finish line");
-
-       if(theirtime < 0)
-               return strcat(col, cpname);
-       else if(theirname == "")
-               return strcat(col, sprintf("%s (%s)", cpname, timestr));
-       else
-               return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(theirname, col, lapstr)));
-}
-
-// Check if the given name already exist in race rankings? In that case, where? (otherwise return 0)
-int race_CheckName(string net_name)
-{
-       int i;
-       for (i=RANKINGS_CNT-1;i>=0;--i)
-               if(grecordholder[i] == net_name)
-                       return i+1;
-       return 0;
-}
-
-/*
-==================
-HUD panels
-==================
-*/
-
-//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
-void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
-{
-       if(!length_ratio || !theAlpha)
-               return;
-       if(length_ratio > 1)
-               length_ratio = 1;
-       if (baralign == 3)
-       {
-               if(length_ratio < -1)
-                       length_ratio = -1;
-       }
-       else if(length_ratio < 0)
-               return;
-
-       vector square;
-       vector width, height;
-       if(vertical) {
-               pic = strcat(hud_skin_path, "/", pic, "_vertical");
-               if(precache_pic(pic) == "") {
-                       pic = "gfx/hud/default/progressbar_vertical";
-               }
-
-        if (baralign == 1) // bottom align
-                       theOrigin.y += (1 - length_ratio) * theSize.y;
-        else if (baralign == 2) // center align
-            theOrigin.y += 0.5 * (1 - length_ratio) * theSize.y;
-        else if (baralign == 3) // center align, positive values down, negative up
-               {
-                       theSize.y *= 0.5;
-                       if (length_ratio > 0)
-                               theOrigin.y += theSize.y;
-                       else
-                       {
-                               theOrigin.y += (1 + length_ratio) * theSize.y;
-                               length_ratio = -length_ratio;
-                       }
-               }
-               theSize.y *= length_ratio;
-
-               vector bH;
-               width = eX * theSize.x;
-               height = eY * theSize.y;
-               if(theSize.y <= theSize.x * 2)
-               {
-                       // button not high enough
-                       // draw just upper and lower part then
-                       square = eY * theSize.y * 0.5;
-                       bH = eY * (0.25 * theSize.y / (theSize.x * 2));
-                       drawsubpic(theOrigin,          square + width, pic, '0 0 0', eX + bH, theColor, theAlpha, drawflag);
-                       drawsubpic(theOrigin + square, square + width, pic, eY - bH, eX + bH, theColor, theAlpha, drawflag);
-               }
-               else
-               {
-                       square = eY * theSize.x;
-                       drawsubpic(theOrigin,                   width   +     square, pic, '0 0    0', '1 0.25 0', theColor, theAlpha, drawflag);
-                       drawsubpic(theOrigin +          square, theSize - 2 * square, pic, '0 0.25 0', '1 0.5  0', theColor, theAlpha, drawflag);
-                       drawsubpic(theOrigin + height - square, width   +     square, pic, '0 0.75 0', '1 0.25 0', theColor, theAlpha, drawflag);
-               }
-       } else {
-               pic = strcat(hud_skin_path, "/", pic);
-               if(precache_pic(pic) == "") {
-                       pic = "gfx/hud/default/progressbar";
-               }
-
-               if (baralign == 1) // right align
-                       theOrigin.x += (1 - length_ratio) * theSize.x;
-        else if (baralign == 2) // center align
-            theOrigin.x += 0.5 * (1 - length_ratio) * theSize.x;
-        else if (baralign == 3) // center align, positive values on the right, negative on the left
-               {
-                       theSize.x *= 0.5;
-                       if (length_ratio > 0)
-                               theOrigin.x += theSize.x;
-                       else
-                       {
-                               theOrigin.x += (1 + length_ratio) * theSize.x;
-                               length_ratio = -length_ratio;
-                       }
-               }
-               theSize.x *= length_ratio;
-
-               vector bW;
-               width = eX * theSize.x;
-               height = eY * theSize.y;
-               if(theSize.x <= theSize.y * 2)
-               {
-                       // button not wide enough
-                       // draw just left and right part then
-                       square = eX * theSize.x * 0.5;
-                       bW = eX * (0.25 * theSize.x / (theSize.y * 2));
-                       drawsubpic(theOrigin,          square + height, pic, '0 0 0', eY + bW, theColor, theAlpha, drawflag);
-                       drawsubpic(theOrigin + square, square + height, pic, eX - bW, eY + bW, theColor, theAlpha, drawflag);
-               }
-               else
-               {
-                       square = eX * theSize.y;
-                       drawsubpic(theOrigin,                  height  +     square, pic, '0    0 0', '0.25 1 0', theColor, theAlpha, drawflag);
-                       drawsubpic(theOrigin +         square, theSize - 2 * square, pic, '0.25 0 0', '0.5  1 0', theColor, theAlpha, drawflag);
-                       drawsubpic(theOrigin + width - square, height  +     square, pic, '0.75 0 0', '0.25 1 0', theColor, theAlpha, drawflag);
-               }
-       }
-}
-
-void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
-{
-       if(!theAlpha)
-               return;
-
-       string pic;
-       pic = strcat(hud_skin_path, "/num_leading");
-       if(precache_pic(pic) == "") {
-               pic = "gfx/hud/default/num_leading";
-       }
-
-       drawsubpic(pos, eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0 0 0', '0.25 1 0', color, theAlpha, drawflag);
-       if(mySize.x/mySize.y > 2)
-               drawsubpic(pos + eX * mySize.y, eX * (mySize.x - 2 * mySize.y) + eY * mySize.y, pic, '0.25 0 0', '0.5 1 0', color, theAlpha, drawflag);
-       drawsubpic(pos + eX * mySize.x - eX * min(mySize.x * 0.5, mySize.y), eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0.75 0 0', '0.25 1 0', color, theAlpha, drawflag);
-}
-
-// Weapon icons (#0)
-//
-entity weaponorder[Weapons_MAX];
-void weaponorder_swap(int i, int j, entity pass)
-{
-       entity h = weaponorder[i];
-       weaponorder[i] = weaponorder[j];
-       weaponorder[j] = h;
-}
-
-string weaponorder_cmp_str;
-int weaponorder_cmp(int i, int j, entity pass)
-{
-       int ai, aj;
-       ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].weapon), 0);
-       aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].weapon), 0);
-       return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
-}
-
-void HUD_Weapons(void)
-{SELFPARAM();
-       // declarations
-       WepSet weapons_stat = WepSet_GetFromStat();
-       int i;
-       float f, a;
-       float screen_ar;
-       vector center = '0 0 0';
-       int weapon_count, weapon_id;
-       int row, column, rows = 0, columns = 0;
-       bool vertical_order = true;
-       float aspect = autocvar_hud_panel_weapons_aspect;
-
-       float timeout = autocvar_hud_panel_weapons_timeout;
-       float timein_effect_length = autocvar_hud_panel_weapons_timeout_speed_in; //? 0.375 : 0);
-       float timeout_effect_length = autocvar_hud_panel_weapons_timeout_speed_out; //? 0.75 : 0);
-
-       vector barsize = '0 0 0', baroffset = '0 0 0';
-       vector ammo_color = '1 0 1';
-       float ammo_alpha = 1;
-
-       float when = max(1, autocvar_hud_panel_weapons_complainbubble_time);
-       float fadetime = max(0, autocvar_hud_panel_weapons_complainbubble_fadetime);
-
-       vector weapon_pos, weapon_size = '0 0 0';
-       vector color;
-
-       // check to see if we want to continue
-       if(hud != HUD_NORMAL) return;
-
-       if(!autocvar__hud_configure)
-       {
-               if((!autocvar_hud_panel_weapons) || (spectatee_status == -1))
-                       return;
-               if(timeout && time >= weapontime + timeout + timeout_effect_length)
-               if(autocvar_hud_panel_weapons_timeout_effect == 3 || (autocvar_hud_panel_weapons_timeout_effect == 1 && !(autocvar_hud_panel_weapons_timeout_fadebgmin + autocvar_hud_panel_weapons_timeout_fadefgmin)))
-               {
-                       weaponprevtime = time;
-                       return;
-               }
-       }
-
-       // update generic hud functions
-       HUD_Panel_UpdateCvars();
-
-       // figure out weapon order (how the weapons are sorted) // TODO make this configurable
-       if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
-       {
-               int weapon_cnt;
-               if(weaponorder_bypriority)
-                       strunzone(weaponorder_bypriority);
-               if(weaponorder_byimpulse)
-                       strunzone(weaponorder_byimpulse);
-
-               weaponorder_bypriority = strzone(autocvar_cl_weaponpriority);
-               weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(W_FixWeaponOrder_ForceComplete(W_NumberWeaponOrder(weaponorder_bypriority))));
-               weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
-
-               weapon_cnt = 0;
-               for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-               {
-                       setself(get_weaponinfo(i));
-                       if(self.impulse >= 0)
-                       {
-                               weaponorder[weapon_cnt] = self;
-                               ++weapon_cnt;
-                       }
-               }
-               for(i = weapon_cnt; i < Weapons_MAX; ++i)
-                       weaponorder[i] = world;
-               heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world);
-
-               weaponorder_cmp_str = string_null;
-       }
-
-       if(!autocvar_hud_panel_weapons_complainbubble || autocvar__hud_configure || time - complain_weapon_time >= when + fadetime)
-               complain_weapon = 0;
-
-       if(autocvar__hud_configure)
-       {
-               if(!weapons_stat)
-                       for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
-                               weapons_stat |= WepSet_FromWeapon(i);
-
-               #if 0
-               /// debug code
-               if(cvar("wep_add"))
-               {
-                       weapons_stat = '0 0 0';
-                       float countw = 1 + floor((floor(time * cvar("wep_add"))) % (Weapons_COUNT - 1));
-                       for(i = WEP_FIRST; i <= countw; ++i)
-                               weapons_stat |= WepSet_FromWeapon(i);
-               }
-               #endif
-       }
-
-       // determine which weapons are going to be shown
-       if (autocvar_hud_panel_weapons_onlyowned)
-       {
-               if(autocvar__hud_configure)
-               {
-                       if(menu_enabled != 2)
-                               HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
-               }
-
-               // do we own this weapon?
-               weapon_count = 0;
-               for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-                       if((weapons_stat & WepSet_FromWeapon(weaponorder[i].weapon)) || (weaponorder[i].weapon == complain_weapon))
-                               ++weapon_count;
-
-
-               // might as well commit suicide now, no reason to live ;)
-               if (weapon_count == 0)
-                       return;
-
-               vector old_panel_size = panel_size;
-               vector padded_panel_size = panel_size - '2 2 0' * panel_bg_padding;
-
-               // get the all-weapons layout
-               int nHidden = 0;
-               WepSet weapons_stat = WepSet_GetFromStat();
-               for (int i = WEP_FIRST; i <= WEP_LAST; ++i) {
-                       WepSet weapons_wep = WepSet_FromWeapon(i);
-                       if (weapons_stat & weapons_wep) continue;
-                       Weapon w = get_weaponinfo(i);
-                       if (w.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1;
-               }
-               vector table_size = HUD_GetTableSize_BestItemAR((Weapons_COUNT - 1) - nHidden, padded_panel_size, aspect);
-               columns = table_size.x;
-               rows = table_size.y;
-               weapon_size.x = padded_panel_size.x / columns;
-               weapon_size.y = padded_panel_size.y / rows;
-
-               // NOTE: although weapons should aways look the same even if onlyowned is enabled,
-               // we enlarge them a bit when possible to better match the desired aspect ratio
-               if(padded_panel_size.x / padded_panel_size.y < aspect)
-               {
-                       // maximum number of rows that allows to display items with the desired aspect ratio
-                       int max_rows = floor(padded_panel_size.y / (weapon_size.x / aspect));
-                       columns = min(columns, ceil(weapon_count / max_rows));
-                       rows = ceil(weapon_count / columns);
-                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
-                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
-                       vertical_order = false;
-               }
-               else
-               {
-                       int max_columns = floor(padded_panel_size.x / (weapon_size.y * aspect));
-                       rows = min(rows, ceil(weapon_count / max_columns));
-                       columns = ceil(weapon_count / rows);
-                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
-                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
-                       vertical_order = true;
-               }
-
-               // reduce size of the panel
-               panel_size.x = columns * weapon_size.x;
-               panel_size.y = rows * weapon_size.y;
-               panel_size += '2 2 0' * panel_bg_padding;
-
-               // center the resized panel, or snap it to the screen edge when close enough
-               if(panel_pos.x > vid_conwidth * 0.001)
-               {
-                       if(panel_pos.x + old_panel_size.x > vid_conwidth * 0.999)
-                               panel_pos.x += old_panel_size.x - panel_size.x;
-                       else
-                               panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
-               }
-               else if(old_panel_size.x > vid_conwidth * 0.999)
-                       panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
-
-               if(panel_pos.y > vid_conheight * 0.001)
-               {
-                       if(panel_pos.y + old_panel_size.y > vid_conheight * 0.999)
-                               panel_pos.y += old_panel_size.y - panel_size.y;
-                       else
-                               panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
-               }
-               else if(old_panel_size.y > vid_conheight * 0.999)
-                       panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
-       }
-       else
-               weapon_count = (Weapons_COUNT - 1);
-
-       // animation for fading in/out the panel respectively when not in use
-       if(!autocvar__hud_configure)
-       {
-               if (timeout && time >= weapontime + timeout) // apply timeout effect if needed
-               {
-                       f = bound(0, (time - (weapontime + timeout)) / timeout_effect_length, 1);
-
-                       // fade the panel alpha
-                       if(autocvar_hud_panel_weapons_timeout_effect == 1)
-                       {
-                               panel_bg_alpha *= (autocvar_hud_panel_weapons_timeout_fadebgmin * f + (1 - f));
-                               panel_fg_alpha *= (autocvar_hud_panel_weapons_timeout_fadefgmin * f + (1 - f));
-                       }
-                       else if(autocvar_hud_panel_weapons_timeout_effect == 3)
-                       {
-                               panel_bg_alpha *= (1 - f);
-                               panel_fg_alpha *= (1 - f);
-                       }
-
-                       // move the panel off the screen
-                       if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
-                       {
-                               f *= f; // for a cooler movement
-                               center.x = panel_pos.x + panel_size.x/2;
-                               center.y = panel_pos.y + panel_size.y/2;
-                               screen_ar = vid_conwidth/vid_conheight;
-                               if (center.x/center.y < screen_ar) //bottom left
-                               {
-                                       if ((vid_conwidth - center.x)/center.y < screen_ar) //bottom
-                                               panel_pos.y += f * (vid_conheight - panel_pos.y);
-                                       else //left
-                                               panel_pos.x -= f * (panel_pos.x + panel_size.x);
-                               }
-                               else //top right
-                               {
-                                       if ((vid_conwidth - center.x)/center.y < screen_ar) //right
-                                               panel_pos.x += f * (vid_conwidth - panel_pos.x);
-                                       else //top
-                                               panel_pos.y -= f * (panel_pos.y + panel_size.y);
-                               }
-                               if(f == 1)
-                                       center.x = -1; // mark the panel as off screen
-                       }
-                       weaponprevtime = time - (1 - f) * timein_effect_length;
-               }
-               else if (timeout && time < weaponprevtime + timein_effect_length) // apply timein effect if needed
-               {
-                       f = bound(0, (time - weaponprevtime) / timein_effect_length, 1);
-
-                       // fade the panel alpha
-                       if(autocvar_hud_panel_weapons_timeout_effect == 1)
-                       {
-                               panel_bg_alpha *= (autocvar_hud_panel_weapons_timeout_fadebgmin * (1 - f) + f);
-                               panel_fg_alpha *= (autocvar_hud_panel_weapons_timeout_fadefgmin * (1 - f) + f);
-                       }
-                       else if(autocvar_hud_panel_weapons_timeout_effect == 3)
-                       {
-                               panel_bg_alpha *= (f);
-                               panel_fg_alpha *= (f);
-                       }
-
-                       // move the panel back on screen
-                       if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
-                       {
-                               f *= f; // for a cooler movement
-                               f = 1 - f;
-                               center.x = panel_pos.x + panel_size.x/2;
-                               center.y = panel_pos.y + panel_size.y/2;
-                               screen_ar = vid_conwidth/vid_conheight;
-                               if (center.x/center.y < screen_ar) //bottom left
-                               {
-                                       if ((vid_conwidth - center.x)/center.y < screen_ar) //bottom
-                                               panel_pos.y += f * (vid_conheight - panel_pos.y);
-                                       else //left
-                                               panel_pos.x -= f * (panel_pos.x + panel_size.x);
-                               }
-                               else //top right
-                               {
-                                       if ((vid_conwidth - center.x)/center.y < screen_ar) //right
-                                               panel_pos.x += f * (vid_conwidth - panel_pos.x);
-                                       else //top
-                                               panel_pos.y -= f * (panel_pos.y + panel_size.y);
-                               }
-                       }
-               }
-       }
-
-       // draw the background, then change the virtual size of it to better fit other items inside
-       HUD_Panel_DrawBg(1);
-
-       if(center.x == -1)
-               return;
-
-       if(panel_bg_padding)
-       {
-               panel_pos += '1 1 0' * panel_bg_padding;
-               panel_size -= '2 2 0' * panel_bg_padding;
-       }
-
-       // after the sizing and animations are done, update the other values
-
-       if(!rows) // if rows is > 0 onlyowned code has already updated these vars
-       {
-               vector table_size = HUD_GetTableSize_BestItemAR((Weapons_COUNT - 1), panel_size, aspect);
-               columns = table_size.x;
-               rows = table_size.y;
-               weapon_size.x = panel_size.x / columns;
-               weapon_size.y = panel_size.y / rows;
-               vertical_order = (panel_size.x / panel_size.y >= aspect);
-       }
-
-       // calculate position/size for visual bar displaying ammount of ammo status
-       if (autocvar_hud_panel_weapons_ammo)
-       {
-               ammo_color = stov(autocvar_hud_panel_weapons_ammo_color);
-               ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha;
-
-               if(weapon_size.x/weapon_size.y > aspect)
-               {
-                       barsize.x = aspect * weapon_size.y;
-                       barsize.y = weapon_size.y;
-                       baroffset.x = (weapon_size.x - barsize.x) / 2;
-               }
-               else
-               {
-                       barsize.y = 1/aspect * weapon_size.x;
-                       barsize.x = weapon_size.x;
-                       baroffset.y = (weapon_size.y - barsize.y) / 2;
-               }
-       }
-       if(autocvar_hud_panel_weapons_accuracy)
-               Accuracy_LoadColors();
-
-       // draw items
-       row = column = 0;
-       vector label_size = '1 1 0' * min(weapon_size.x, weapon_size.y) * bound(0, autocvar_hud_panel_weapons_label_scale, 1);
-       vector noncurrent_pos = '0 0 0';
-       vector noncurrent_size = weapon_size * bound(0, autocvar_hud_panel_weapons_noncurrent_scale, 1);
-       float noncurrent_alpha = panel_fg_alpha * bound(0, autocvar_hud_panel_weapons_noncurrent_alpha, 1);
-       bool isCurrent;
-
-       for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-       {
-               // retrieve information about the current weapon to be drawn
-               setself(weaponorder[i]);
-               weapon_id = self.impulse;
-               isCurrent = (self.weapon == switchweapon);
-
-               // skip if this weapon doesn't exist
-               if(!self || weapon_id < 0) { continue; }
-
-               // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
-               if(autocvar_hud_panel_weapons_onlyowned)
-               if (!((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon)))
-                       continue;
-
-               // figure out the drawing position of weapon
-               weapon_pos = (panel_pos + eX * column * weapon_size.x + eY * row * weapon_size.y);
-               noncurrent_pos.x = weapon_pos.x + (weapon_size.x - noncurrent_size.x) / 2;
-               noncurrent_pos.y = weapon_pos.y + (weapon_size.y - noncurrent_size.y) / 2;
-
-               // draw background behind currently selected weapon
-               if(isCurrent)
-                       drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-
-               // draw the weapon accuracy
-               if(autocvar_hud_panel_weapons_accuracy)
-               {
-                       float panel_weapon_accuracy = weapon_accuracy[self.weapon-WEP_FIRST];
-                       if(panel_weapon_accuracy >= 0)
-                       {
-                               color = Accuracy_GetColor(panel_weapon_accuracy);
-                               drawpic_aspect_skin(weapon_pos, "weapon_accuracy", weapon_size, color, panel_fg_alpha, DRAWFLAG_NORMAL);
-                       }
-               }
-
-               // drawing all the weapon items
-               if(weapons_stat & WepSet_FromWeapon(self.weapon))
-               {
-                       // draw the weapon image
-                       if(isCurrent)
-                               drawpic_aspect_skin(weapon_pos, self.model2, weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                       else
-                               drawpic_aspect_skin(noncurrent_pos, self.model2, noncurrent_size, '1 1 1', noncurrent_alpha, DRAWFLAG_NORMAL);
-
-                       // draw weapon label string
-                       switch(autocvar_hud_panel_weapons_label)
-                       {
-                               case 1: // weapon number
-                                       drawstring(weapon_pos, ftos(weapon_id), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                                       break;
-
-                               case 2: // bind
-                                       drawstring(weapon_pos, getcommandkey(ftos(weapon_id), strcat("weapon_group_", ftos(weapon_id))), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                                       break;
-
-                               case 3: // weapon name
-                                       drawstring(weapon_pos, strtolower(self.message), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                                       break;
-
-                               default: // nothing
-                                       break;
-                       }
-
-                       // draw ammo status bar
-                       if(autocvar_hud_panel_weapons_ammo && (self.ammo_field != ammo_none))
-                       {
-                               float ammo_full;
-                               a = getstati(GetAmmoStat(self.ammo_field)); // how much ammo do we have?
-
-                               if(a > 0)
-                               {
-                                       switch(self.ammo_field)
-                                       {
-                                               case ammo_shells:  ammo_full = autocvar_hud_panel_weapons_ammo_full_shells;  break;
-                                               case ammo_nails:   ammo_full = autocvar_hud_panel_weapons_ammo_full_nails;   break;
-                                               case ammo_rockets: ammo_full = autocvar_hud_panel_weapons_ammo_full_rockets; break;
-                                               case ammo_cells:   ammo_full = autocvar_hud_panel_weapons_ammo_full_cells;   break;
-                                               case ammo_plasma:  ammo_full = autocvar_hud_panel_weapons_ammo_full_plasma;  break;
-                                               case ammo_fuel:    ammo_full = autocvar_hud_panel_weapons_ammo_full_fuel;    break;
-                                               default: ammo_full = 60;
-                                       }
-
-                                       drawsetcliparea(
-                                               weapon_pos.x + baroffset.x,
-                                               weapon_pos.y + baroffset.y,
-                                               barsize.x * bound(0, a/ammo_full, 1),
-                                               barsize.y
-                                       );
-
-                                       drawpic_aspect_skin(
-                                               weapon_pos,
-                                               "weapon_ammo",
-                                               weapon_size,
-                                               ammo_color,
-                                               ammo_alpha,
-                                               DRAWFLAG_NORMAL
-                                       );
-
-                                       drawresetcliparea();
-                               }
-                       }
-               }
-               else // draw a "ghost weapon icon" if you don't have the weapon
-               {
-                       drawpic_aspect_skin(noncurrent_pos, self.model2, noncurrent_size, '0.2 0.2 0.2', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
-               }
-
-               // draw the complain message
-               if(self.weapon == complain_weapon)
-               {
-                       if(fadetime)
-                               a = ((complain_weapon_time + when > time) ? 1 : bound(0, (complain_weapon_time + when + fadetime - time) / fadetime, 1));
-                       else
-                               a = ((complain_weapon_time + when > time) ? 1 : 0);
-
-                       string s;
-                       if(complain_weapon_type == 0) {
-                               s = _("Out of ammo");
-                               color = stov(autocvar_hud_panel_weapons_complainbubble_color_outofammo);
-                       }
-                       else if(complain_weapon_type == 1) {
-                               s = _("Don't have");
-                               color = stov(autocvar_hud_panel_weapons_complainbubble_color_donthave);
-                       }
-                       else {
-                               s = _("Unavailable");
-                               color = stov(autocvar_hud_panel_weapons_complainbubble_color_unavailable);
-                       }
-                       float padding = autocvar_hud_panel_weapons_complainbubble_padding;
-                       drawpic_aspect_skin(weapon_pos + '1 1 0' * padding, "weapon_complainbubble", weapon_size - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(weapon_pos + '1 1 0' * padding, s, weapon_size - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
-               }
-
-               #if 0
-               /// debug code
-               if(!autocvar_hud_panel_weapons_onlyowned)
-               {
-                       drawfill(weapon_pos + '1 1 0', weapon_size - '2 2 0', '1 1 1', panel_fg_alpha * 0.2, DRAWFLAG_NORMAL);
-                       drawstring(weapon_pos, ftos(i + 1), label_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               }
-               #endif
-
-               // continue with new position for the next weapon
-               if(vertical_order)
-               {
-                       ++column;
-                       if(column >= columns)
-                       {
-                               column = 0;
-                               ++row;
-                       }
-               }
-               else
-               {
-                       ++row;
-                       if(row >= rows)
-                       {
-                               row = 0;
-                               ++column;
-                       }
-               }
-       }
-}
-
-// Ammo (#1)
-void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
-{
-       HUD_Panel_DrawProgressBar(
-               myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x,
-               mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x,
-               autocvar_hud_panel_ammo_progressbar_name,
-               progress, 0, 0, color,
-               autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-}
-
-void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time)
-{
-       float bonusNades    = getstatf(STAT_NADE_BONUS);
-       float bonusProgress = getstatf(STAT_NADE_BONUS_SCORE);
-       float bonusType     = getstati(STAT_NADE_BONUS_TYPE);
-       vector nadeColor    = Nades[bonusType].m_color;
-       string nadeIcon     = Nades[bonusType].m_icon;
-
-       vector iconPos, textPos;
-
-       if(autocvar_hud_panel_ammo_iconalign)
-       {
-               iconPos = myPos + eX * 2 * mySize.y;
-               textPos = myPos;
-       }
-       else
-       {
-               iconPos = myPos;
-               textPos = myPos + eX * mySize.y;
-       }
-
-       if(bonusNades > 0 || bonusProgress > 0)
-       {
-               DrawNadeProgressBar(myPos, mySize, bonusProgress, nadeColor);
-
-               if(autocvar_hud_panel_ammo_text)
-                       drawstring_aspect(textPos, ftos(bonusNades), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-
-               if(draw_expanding)
-                       drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
-
-               drawpic_aspect_skin(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       }
-}
-
-void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
-{
-       if(ammoType == ammo_none)
-               return;
-
-       // Initialize variables
-
-       int ammo;
-       if(autocvar__hud_configure)
-       {
-               isCurrent = (ammoType == ammo_rockets); // Rockets always current
-               ammo = 60;
-       }
-       else
-               ammo = getstati(GetAmmoStat(ammoType));
-
-       if(!isCurrent)
-       {
-               float scale = bound(0, autocvar_hud_panel_ammo_noncurrent_scale, 1);
-               myPos = myPos + (mySize - mySize * scale) * 0.5;
-               mySize = mySize * scale;
-       }
-
-       vector iconPos, textPos;
-       if(autocvar_hud_panel_ammo_iconalign)
-       {
-               iconPos = myPos + eX * 2 * mySize.y;
-               textPos = myPos;
-       }
-       else
-       {
-               iconPos = myPos;
-               textPos = myPos + eX * mySize.y;
-       }
-
-       bool isShadowed = (ammo <= 0 && !isCurrent && !isInfinite);
-
-       vector iconColor = isShadowed ? '0 0 0' : '1 1 1';
-       vector textColor;
-       if(isInfinite)
-               textColor = '0.2 0.95 0';
-       else if(isShadowed)
-               textColor = '0 0 0';
-       else if(ammo < 10)
-               textColor = '0.8 0.04 0';
-       else
-               textColor = '1 1 1';
-
-       float alpha;
-       if(isCurrent)
-               alpha = panel_fg_alpha;
-       else if(isShadowed)
-               alpha = panel_fg_alpha * bound(0, autocvar_hud_panel_ammo_noncurrent_alpha, 1) * 0.5;
-       else
-               alpha = panel_fg_alpha * bound(0, autocvar_hud_panel_ammo_noncurrent_alpha, 1);
-
-       string text = isInfinite ? "\xE2\x88\x9E" : ftos(ammo); // Use infinity symbol (U+221E)
-
-       // Draw item
-
-       if(isCurrent)
-               drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-
-       if(ammo > 0 && autocvar_hud_panel_ammo_progressbar)
-               HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x, autocvar_hud_panel_ammo_progressbar_name, ammo/autocvar_hud_panel_ammo_maxammo, 0, 0, textColor, autocvar_hud_progressbar_alpha * alpha, DRAWFLAG_NORMAL);
-
-       if(autocvar_hud_panel_ammo_text)
-               drawstring_aspect(textPos, text, eX * (2/3) * mySize.x + eY * mySize.y, textColor, alpha, DRAWFLAG_NORMAL);
-
-       drawpic_aspect_skin(iconPos, GetAmmoPicture(ammoType), '1 1 0' * mySize.y, iconColor, alpha, DRAWFLAG_NORMAL);
-}
-
-int nade_prevstatus;
-int nade_prevframe;
-float nade_statuschange_time;
-void HUD_Ammo(void)
-{
-       if(hud != HUD_NORMAL) return;
-       if(!autocvar__hud_configure)
-       {
-               if(!autocvar_hud_panel_ammo) return;
-               if(spectatee_status == -1) return;
-       }
-
-       HUD_Panel_UpdateCvars();
-
-       draw_beginBoldFont();
-
-       vector pos, mySize;
-       pos = panel_pos;
-       mySize = panel_size;
-
-       HUD_Panel_DrawBg(1);
-       if(panel_bg_padding)
-       {
-               pos += '1 1 0' * panel_bg_padding;
-               mySize -= '2 2 0' * panel_bg_padding;
-       }
-
-       int rows = 0, columns, row, column;
-       float nade_cnt = getstatf(STAT_NADE_BONUS), nade_score = getstatf(STAT_NADE_BONUS_SCORE);
-       bool draw_nades = (nade_cnt > 0 || nade_score > 0);
-       float nade_statuschange_elapsedtime;
-       int total_ammo_count;
-
-       vector ammo_size;
-       if (autocvar_hud_panel_ammo_onlycurrent)
-               total_ammo_count = 1;
-       else
-               total_ammo_count = AMMO_COUNT;
-
-       if(draw_nades)
-       {
-               ++total_ammo_count;
-               if (nade_cnt != nade_prevframe)
-               {
-                       nade_statuschange_time = time;
-                       nade_prevstatus = nade_prevframe;
-                       nade_prevframe = nade_cnt;
-               }
-       }
-       else
-               nade_prevstatus = nade_prevframe = nade_statuschange_time = 0;
-
-       rows = HUD_GetRowCount(total_ammo_count, mySize, 3);
-       columns = ceil((total_ammo_count)/rows);
-       ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
-
-       vector offset = '0 0 0'; // fteqcc sucks
-       float newSize;
-       if(ammo_size.x/ammo_size.y > 3)
-       {
-               newSize = 3 * ammo_size.y;
-               offset.x = ammo_size.x - newSize;
-               pos.x += offset.x/2;
-               ammo_size.x = newSize;
-       }
-       else
-       {
-               newSize = 1/3 * ammo_size.x;
-               offset.y = ammo_size.y - newSize;
-               pos.y += offset.y/2;
-               ammo_size.y = newSize;
-       }
-
-       int i;
-       bool infinite_ammo = (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_WEAPON_AMMO);
-       row = column = 0;
-       if(autocvar_hud_panel_ammo_onlycurrent)
-       {
-               if(autocvar__hud_configure)
-               {
-                       DrawAmmoItem(pos, ammo_size, ammo_rockets, true, false);
-               }
-               else
-               {
-                       DrawAmmoItem(
-                               pos,
-                               ammo_size,
-                               (get_weaponinfo(switchweapon)).ammo_field,
-                               true,
-                               infinite_ammo
-                       );
-               }
-
-               ++row;
-               if(row >= rows)
-               {
-                       row = 0;
-                       column = column + 1;
-               }
-       }
-       else
-       {
-               .int ammotype;
-               row = column = 0;
-               for(i = 0; i < AMMO_COUNT; ++i)
-               {
-                       ammotype = GetAmmoFieldFromNum(i);
-                       DrawAmmoItem(
-                               pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y),
-                               ammo_size,
-                               ammotype,
-                               ((get_weaponinfo(switchweapon)).ammo_field == ammotype),
-                               infinite_ammo
-                       );
-
-                       ++row;
-                       if(row >= rows)
-                       {
-                               row = 0;
-                               column = column + 1;
-                       }
-               }
-       }
-
-       if (draw_nades)
-       {
-               nade_statuschange_elapsedtime = time - nade_statuschange_time;
-
-               float f = bound(0, nade_statuschange_elapsedtime*2, 1);
-
-               DrawAmmoNades(pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f);
-       }
-
-       draw_endBoldFont();
-}
-
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha, float fadelerp)
-{
-       vector newPos = '0 0 0', newSize = '0 0 0';
-       vector picpos, numpos;
-
-       if (vertical)
-       {
-               if(mySize.y/mySize.x > 2)
-               {
-                       newSize.y = 2 * mySize.x;
-                       newSize.x = mySize.x;
-
-                       newPos.y = myPos.y + (mySize.y - newSize.y) / 2;
-                       newPos.x = myPos.x;
-               }
-               else
-               {
-                       newSize.x = 1/2 * mySize.y;
-                       newSize.y = mySize.y;
-
-                       newPos.x = myPos.x + (mySize.x - newSize.x) / 2;
-                       newPos.y = myPos.y;
-               }
-
-               if(icon_right_align)
-               {
-                       numpos = newPos;
-                       picpos = newPos + eY * newSize.x;
-               }
-               else
-               {
-                       picpos = newPos;
-                       numpos = newPos + eY * newSize.x;
-               }
-
-               newSize.y /= 2;
-               drawpic_aspect_skin(picpos, icon, newSize, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
-               // make number smaller than icon, it looks better
-               // reduce only y to draw numbers with different number of digits with the same y size
-               numpos.y += newSize.y * ((1 - 0.7) / 2);
-               newSize.y *= 0.7;
-               drawstring_aspect(numpos, ftos(x), newSize, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
-               return;
-       }
-
-       if(mySize.x/mySize.y > 3)
-       {
-               newSize.x = 3 * mySize.y;
-               newSize.y = mySize.y;
-
-               newPos.x = myPos.x + (mySize.x - newSize.x) / 2;
-               newPos.y = myPos.y;
-       }
-       else
-       {
-               newSize.y = 1/3 * mySize.x;
-               newSize.x = mySize.x;
-
-               newPos.y = myPos.y + (mySize.y - newSize.y) / 2;
-               newPos.x = myPos.x;
-       }
-
-       if(icon_right_align) // right align
-       {
-               numpos = newPos;
-               picpos = newPos + eX * 2 * newSize.y;
-       }
-       else // left align
-       {
-               numpos = newPos + eX * newSize.y;
-               picpos = newPos;
-       }
-
-       // NOTE: newSize_x is always equal to 3 * mySize_y so we can use
-       // '2 1 0' * newSize_y instead of eX * (2/3) * newSize_x + eY * newSize_y
-       drawstring_aspect_expanding(numpos, ftos(x), '2 1 0' * newSize.y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
-       drawpic_aspect_skin_expanding(picpos, icon, '1 1 0' * newSize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
-}
-
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha)
-{
-       DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
-}
-
-// Powerups (#2)
-//
-
-// Powerup item fields (reusing existing fields)
-.string message;  // Human readable name
-.string netname;  // Icon name
-.vector colormod; // Color
-.float count;     // Time left
-.float lifetime;  // Maximum time
-
-entity powerupItems;
-int powerupItemsCount;
-
-void resetPowerupItems()
-{
-       entity item;
-       for(item = powerupItems; item; item = item.chain)
-               item.count = 0;
-
-       powerupItemsCount = 0;
-}
-
-void addPowerupItem(string name, string icon, vector color, float currentTime, float lifeTime)
-{
-       if(!powerupItems)
-               powerupItems = spawn();
-
-       entity item;
-       for(item = powerupItems; item.count; item = item.chain)
-               if(!item.chain)
-                       item.chain = spawn();
-
-       item.message  = name;
-       item.netname  = icon;
-       item.colormod = color;
-       item.count    = currentTime;
-       item.lifetime = lifeTime;
-
-       ++powerupItemsCount;
-}
-
-int getPowerupItemAlign(int align, int column, int row, int columns, int rows, bool isVertical)
-{
-       if(align < 2)
-               return align;
-
-       bool isTop    =  isVertical && rows > 1 && row == 0;
-       bool isBottom =  isVertical && rows > 1 && row == rows-1;
-       bool isLeft   = !isVertical && columns > 1 && column == 0;
-       bool isRight  = !isVertical && columns > 1 && column == columns-1;
-
-       if(isTop    || isLeft)  return (align == 2) ? 1 : 0;
-       if(isBottom || isRight) return (align == 2) ? 0 : 1;
-
-       return 2;
-}
-
-void HUD_Powerups()
-{
-       int allItems = getstati(STAT_ITEMS, 0, 24);
-       int allBuffs = getstati(STAT_BUFFS, 0, 24);
-       int strengthTime, shieldTime, superTime;
-
-       // Initialize items
-       if(!autocvar__hud_configure)
-       {
-               if(!autocvar_hud_panel_powerups) return;
-               if(spectatee_status == -1) return;
-               if(getstati(STAT_HEALTH) <= 0) return;
-               if(!(allItems & (ITEM_Strength.m_itemid | ITEM_Shield.m_itemid | IT_SUPERWEAPON)) && !allBuffs) return;
-
-               strengthTime = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
-               shieldTime = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
-               superTime = bound(0, getstatf(STAT_SUPERWEAPONS_FINISHED) - time, 99);
-
-               if(allItems & IT_UNLIMITED_SUPERWEAPONS)
-                       superTime = 99;
-
-               // Prevent stuff to show up on mismatch that will be fixed next frame
-               if(!(allItems & IT_SUPERWEAPON))
-                       superTime = 0;
-       }
-       else
-       {
-               strengthTime = 15;
-               shieldTime = 27;
-               superTime = 13;
-               allBuffs = 0;
-       }
-
-       // Add items to linked list
-       resetPowerupItems();
-
-       if(strengthTime)
-               addPowerupItem("Strength", "strength", autocvar_hud_progressbar_strength_color, strengthTime, 30);
-       if(shieldTime)
-               addPowerupItem("Shield", "shield", autocvar_hud_progressbar_shield_color, shieldTime, 30);
-       if(superTime)
-               addPowerupItem("Superweapons", "superweapons", autocvar_hud_progressbar_superweapons_color, superTime, 30);
-
-       FOREACH(Buffs, it.m_itemid & allBuffs, LAMBDA(
-               addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, getstatf(STAT_BUFF_TIME) - time, 99), 60);
-       ));
-
-       if(!powerupItemsCount)
-               return;
-
-       // Draw panel background
-       HUD_Panel_UpdateCvars();
-       HUD_Panel_DrawBg(1);
-
-       // Set drawing area
-       vector pos = panel_pos;
-       vector size = panel_size;
-       bool isVertical = size.y > size.x;
-
-       if(panel_bg_padding)
-       {
-               pos += '1 1 0' * panel_bg_padding;
-               size -= '2 2 0' * panel_bg_padding;
-       }
-
-       // Find best partitioning of the drawing area
-       const float DESIRED_ASPECT = 6;
-       float aspect = 0, a;
-       int columns = 0, c;
-       int rows = 0, r;
-       int i = 1;
-
-       do
-       {
-               c = floor(powerupItemsCount / i);
-               r = ceil(powerupItemsCount / c);
-               a = isVertical ? (size.y/r) / (size.x/c) : (size.x/c) / (size.y/r);
-
-               if(i == 1 || fabs(DESIRED_ASPECT - a) < fabs(DESIRED_ASPECT - aspect))
-               {
-                       aspect = a;
-                       columns = c;
-                       rows = r;
-               }
-       }
-       while(++i <= powerupItemsCount);
-
-       // Prevent single items from getting too wide
-       if(powerupItemsCount == 1 && aspect > DESIRED_ASPECT)
-       {
-               if(isVertical)
-               {
-                       size.y *= 0.5;
-                       pos.y += size.y * 0.5;
-               }
-               else
-               {
-                       size.x *= 0.5;
-                       pos.x += size.x * 0.5;
-               }
-       }
-
-       // Draw items from linked list
-       vector itemPos = pos;
-       vector itemSize = eX * (size.x / columns) + eY * (size.y / rows);
-       vector textColor = '1 1 1';
-
-       int fullSeconds = 0;
-       int align = 0;
-       int column = 0;
-       int row = 0;
-
-       draw_beginBoldFont();
-       for(entity item = powerupItems; item.count; item = item.chain)
-       {
-               itemPos = eX * (pos.x + column * itemSize.x) + eY * (pos.y + row * itemSize.y);
-
-               // Draw progressbar
-               if(autocvar_hud_panel_powerups_progressbar)
-               {
-                       align = getPowerupItemAlign(autocvar_hud_panel_powerups_baralign, column, row, columns, rows, isVertical);
-                       HUD_Panel_DrawProgressBar(itemPos, itemSize, "progressbar", item.count / item.lifetime, isVertical, align, item.colormod, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-               }
-
-               // Draw icon and text
-               if(autocvar_hud_panel_powerups_text)
-               {
-                       align = getPowerupItemAlign(autocvar_hud_panel_powerups_iconalign, column, row, columns, rows, isVertical);
-                       fullSeconds = ceil(item.count);
-                       textColor = '0.6 0.6 0.6' + (item.colormod * 0.4);
-
-                       if(item.count > 1)
-                               DrawNumIcon(itemPos, itemSize, fullSeconds, item.netname, isVertical, align, textColor, panel_fg_alpha);
-                       if(item.count <= 5)
-                               DrawNumIcon_expanding(itemPos, itemSize, fullSeconds, item.netname, isVertical, align, textColor, panel_fg_alpha, bound(0, (fullSeconds - item.count) / 0.5, 1));
-               }
-
-               // Determine next section
-               if(isVertical)
-               {
-                       if(++column >= columns)
-                       {
-                               column = 0;
-                               ++row;
-                       }
-               }
-               else
-               {
-                       if(++row >= rows)
-                       {
-                               row = 0;
-                               ++column;
-                       }
-               }
-       }
-       draw_endBoldFont();
-}
-
-// Health/armor (#3)
-//
-
-
-void HUD_HealthArmor(void)
-{
-       int armor, health, fuel;
-       if(!autocvar__hud_configure)
-       {
-               if(!autocvar_hud_panel_healtharmor) return;
-               if(hud != HUD_NORMAL) return;
-               if(spectatee_status == -1) return;
-
-               health = getstati(STAT_HEALTH);
-               if(health <= 0)
-               {
-                       prev_health = -1;
-                       return;
-               }
-               armor = getstati(STAT_ARMOR);
-
-               // code to check for spectatee_status changes is in Ent_ClientData()
-               // prev_p_health and prev_health can be set to -1 there
-
-               if (prev_p_health == -1)
-               {
-                       // no effect
-                       health_beforedamage = 0;
-                       armor_beforedamage = 0;
-                       health_damagetime = 0;
-                       armor_damagetime = 0;
-                       prev_health = health;
-                       prev_armor = armor;
-                       old_p_health = health;
-                       old_p_armor = armor;
-                       prev_p_health = health;
-                       prev_p_armor = armor;
-               }
-               else if (prev_health == -1)
-               {
-                       //start the load effect
-                       health_damagetime = 0;
-                       armor_damagetime = 0;
-                       prev_health = 0;
-                       prev_armor = 0;
-               }
-               fuel = getstati(STAT_FUEL);
-       }
-       else
-       {
-               health = 150;
-               armor = 75;
-               fuel = 20;
-       }
-
-       HUD_Panel_UpdateCvars();
-
-       draw_beginBoldFont();
-
-       vector pos, mySize;
-       pos = panel_pos;
-       mySize = panel_size;
-
-       HUD_Panel_DrawBg(1);
-       if(panel_bg_padding)
-       {
-               pos += '1 1 0' * panel_bg_padding;
-               mySize -= '2 2 0' * panel_bg_padding;
-       }
-
-       int baralign = autocvar_hud_panel_healtharmor_baralign;
-       int iconalign = autocvar_hud_panel_healtharmor_iconalign;
-
-    int maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
-    int maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
-       if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
-       {
-               vector v;
-               v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id);
-
-               float x;
-               x = floor(v.x + 1);
-
-        float maxtotal = maxhealth + maxarmor;
-               string biggercount;
-               if(v.z) // NOT fully armored
-               {
-                       biggercount = "health";
-                       if(autocvar_hud_panel_healtharmor_progressbar)
-                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, x/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       if(armor)
-            if(autocvar_hud_panel_healtharmor_text)
-                               drawpic_aspect_skin(pos + eX * mySize.x - eX * 0.5 * mySize.y, "armor", '0.5 0.5 0' * mySize.y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
-               }
-               else
-               {
-                       biggercount = "armor";
-                       if(autocvar_hud_panel_healtharmor_progressbar)
-