]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/dynamic_hud
authorterencehill <piuntn@gmail.com>
Sat, 26 Mar 2016 23:30:20 +0000 (00:30 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 26 Mar 2016 23:30:20 +0000 (00:30 +0100)
Conflicts:
qcsrc/client/quickmenu.qc

299 files changed:
.gitlab-ci.yml
bal-wep-nexuiz25.cfg
bal-wep-overkill.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
defaultXonotic.cfg
qcsrc/Makefile
qcsrc/client/_mod.inc [new file with mode: 0644]
qcsrc/client/autocvars.qh
qcsrc/client/commands/_mod.inc [new file with mode: 0644]
qcsrc/client/commands/all.qc
qcsrc/client/hud/_mod.inc [new file with mode: 0644]
qcsrc/client/hud/all.qc [deleted file]
qcsrc/client/hud/hud.qc
qcsrc/client/hud/panel/_mod.inc [new file with mode: 0644]
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/quickmenu.qc
qcsrc/client/hud/panel/quickmenu.qh
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/main.qc
qcsrc/client/mutators/_mod.inc [new file with mode: 0644]
qcsrc/client/progs.inc
qcsrc/client/quickmenu.qc [deleted file]
qcsrc/client/quickmenu.qh [deleted file]
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/view.qc
qcsrc/client/view.qh
qcsrc/client/weapons/_mod.inc [new file with mode: 0644]
qcsrc/common/_all.inc
qcsrc/common/_mod.inc [new file with mode: 0644]
qcsrc/common/command/_mod.inc [new file with mode: 0644]
qcsrc/common/deathtypes/_mod.inc [new file with mode: 0644]
qcsrc/common/effects/_mod.inc [new file with mode: 0644]
qcsrc/common/effects/qc/_mod.inc [new file with mode: 0644]
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/_mod.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/_mod.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/nexball/_mod.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/_mod.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/impulses/_mod.inc [new file with mode: 0644]
qcsrc/common/items/_mod.inc [new file with mode: 0644]
qcsrc/common/items/all.inc [deleted file]
qcsrc/common/items/all.qc
qcsrc/common/items/all.qh
qcsrc/common/items/inventory.qh
qcsrc/common/items/item.qh
qcsrc/common/items/item/_mod.inc [new file with mode: 0644]
qcsrc/common/minigames/_mod.inc [new file with mode: 0644]
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/_mod.inc [new file with mode: 0644]
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/models/_mod.inc [new file with mode: 0644]
qcsrc/common/monsters/_mod.inc [new file with mode: 0644]
qcsrc/common/monsters/all.inc [deleted file]
qcsrc/common/monsters/all.qc
qcsrc/common/monsters/all.qh
qcsrc/common/monsters/monster.qh
qcsrc/common/monsters/monster/_mod.inc [new file with mode: 0644]
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/bloodloss/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/breakablehook/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/bugrigs/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/campcheck/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/cloaked/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/damagetext/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/dodging/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/doublejump/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/hook/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/instagib/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/common/mutators/mutator/invincibleproj/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/melee_only/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/midair/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/multijump/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/multijump/multijump.qc
qcsrc/common/mutators/mutator/nades/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/new_toys/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/nix/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/hmg.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/mutators/mutator/physical_items/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/physical_items/physical_items.qc
qcsrc/common/mutators/mutator/pinata/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/random_gravity/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketflying/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketminsta/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/running_guns/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/sandbox/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/superspec/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/touchexplode/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampire/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampirehook/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/waypoints/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/weaponarena_random/_mod.inc [new file with mode: 0644]
qcsrc/common/notifications/_mod.inc [new file with mode: 0644]
qcsrc/common/physics/_mod.inc [new file with mode: 0644]
qcsrc/common/physics/movelib.qc
qcsrc/common/physics/movelib.qh
qcsrc/common/physics/movetypes/_mod.inc [new file with mode: 0644]
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/push.qc
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/sounds/_mod.inc [new file with mode: 0644]
qcsrc/common/state.qc
qcsrc/common/t_items.qc
qcsrc/common/triggers/_mod.inc [new file with mode: 0644]
qcsrc/common/triggers/func/_mod.inc [new file with mode: 0644]
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/misc/_mod.inc [new file with mode: 0644]
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/_mod.inc [new file with mode: 0644]
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/trigger/_mod.inc [new file with mode: 0644]
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/secret.qc
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/common/triggers/triggers.qc
qcsrc/common/turrets/_mod.inc [new file with mode: 0644]
qcsrc/common/turrets/all.inc [deleted file]
qcsrc/common/turrets/all.qc
qcsrc/common/turrets/all.qh
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/_mod.inc [new file with mode: 0644]
qcsrc/common/turrets/turret/ewheel.qc
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/ewheel_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/flac.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/flac_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/hellion.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hellion_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/hk.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/machinegun.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/machinegun_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/mlrs.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/mlrs_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/phaser.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/plasma_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/tesla.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/tesla_weapon.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/turrets/turret/walker_weapon.qh [new file with mode: 0644]
qcsrc/common/vehicles/_mod.inc [new file with mode: 0644]
qcsrc/common/vehicles/all.inc [deleted file]
qcsrc/common/vehicles/all.qc
qcsrc/common/vehicles/all.qh
qcsrc/common/vehicles/cl_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh
qcsrc/common/vehicles/vehicle/_mod.inc [new file with mode: 0644]
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/bumblebee.qh
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh [new file with mode: 0644]
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qh [new file with mode: 0644]
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qh [new file with mode: 0644]
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh [new file with mode: 0644]
qcsrc/common/weapons/_mod.inc [new file with mode: 0644]
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/_mod.inc [new file with mode: 0644]
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
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/seeker.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/lib/_all.inc
qcsrc/lib/_mod.inc [new file with mode: 0644]
qcsrc/lib/csqcmodel/_mod.inc [new file with mode: 0644]
qcsrc/lib/defer.qh
qcsrc/lib/iter.qh
qcsrc/lib/log.qh
qcsrc/lib/net.qh
qcsrc/lib/oo.qh
qcsrc/lib/registry.qh
qcsrc/lib/self.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/warpzone/_mod.inc [new file with mode: 0644]
qcsrc/lib/warpzone/client.qc
qcsrc/lib/warpzone/common.qc
qcsrc/lib/warpzone/server.qc
qcsrc/lib/warpzone/server.qh
qcsrc/lib/warpzone/util_server.qc
qcsrc/menu/_mod.inc [new file with mode: 0644]
qcsrc/menu/anim/_mod.inc [new file with mode: 0644]
qcsrc/menu/classes.inc
qcsrc/menu/command/_mod.inc [new file with mode: 0644]
qcsrc/menu/command/all.qc [new file with mode: 0644]
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/item.qc
qcsrc/menu/item/_mod.inc [new file with mode: 0644]
qcsrc/menu/menu.qc
qcsrc/menu/mutators/_mod.inc [new file with mode: 0644]
qcsrc/menu/progs.inc
qcsrc/menu/xonotic/_mod.inc [new file with mode: 0644]
qcsrc/server/_all.qh
qcsrc/server/_mod.inc [new file with mode: 0644]
qcsrc/server/antilag.qc
qcsrc/server/bot/_all.inc [deleted file]
qcsrc/server/bot/_mod.inc [new file with mode: 0644]
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/_all.inc [deleted file]
qcsrc/server/bot/havocbot/_mod.inc [new file with mode: 0644]
qcsrc/server/bot/scripting.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/_mod.inc [new file with mode: 0644]
qcsrc/server/command/all.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_damage.qh
qcsrc/server/g_lights.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/_mod.inc [new file with mode: 0644]
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/_mod.inc [new file with mode: 0644]
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/pathlib/_mod.inc [new file with mode: 0644]
qcsrc/server/playerdemo.qc
qcsrc/server/progs.inc
qcsrc/server/race.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/sv_main.qc
qcsrc/server/tests.qc
qcsrc/server/tests.qh
qcsrc/server/weapons/_mod.inc [new file with mode: 0644]
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh
qcsrc/server/weapons/weaponsystem.qc
qcsrc/server/weapons/weaponsystem.qh
qcsrc/tools/compilationunits.sh
qcsrc/tools/genmod.sh [new file with mode: 0755]
turrets.cfg

index e345c88d9f086b41b825523f6468e07919cf3cd4..77d421436fd236b2ec9944b2b6aee7fc1a8e7bb9 100644 (file)
@@ -5,6 +5,11 @@ before_script:
   - cd gmqcc && make -j $(nproc) && export QCC="$PWD/gmqcc"
   - cd ..
 
+test_compilation_units:
+  stage: test
+  script:
+    - ./qcsrc/tools/compilationunits.sh
+
 test_sv_game:
   stage: test
   script:
@@ -14,7 +19,7 @@ test_sv_game:
 
     - wget -O data/g-23.pk3 http://beta.xonotic.org/autobuild-bsp/latest/g-23.pk3
     - make
-    - EXPECT=8573348372f9b9f82183b01598950eb5
+    - EXPECT=07fdfd9a19025920a599995730eb2a78
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
@@ -41,11 +46,6 @@ test_sv_unit:
       done < <(${ENGINE} +developer 1 +map gitlab-ci +sv_cmd runtest +exit)
     - exit 1
 
-test_compilation_units:
-  stage: test
-  script:
-    - ./qcsrc/tools/compilationunits.sh
-
 doxygen:  # rename to 'pages' when gitlab.com allows pages to exceed 100MiB
   stage: deploy
   script:
index bb7ab5f6780738b28e140ba39d829e2725e84206..97707a7255789ab49f96602d9b5a5373a8f673d1 100644 (file)
@@ -43,7 +43,7 @@ set g_balance_shotgun_primary_spread 0.07
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 2
-set g_balance_shotgun_secondary_animtime 1
+set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 80
 set g_balance_shotgun_secondary_force 200
 set g_balance_shotgun_secondary_melee_delay 0.25
index 626ada04eab958e36e003f4ec0f0b8fbe04f2ff9..d0cfa361d269c1aae66c89cefc2e3e660f65dd24 100644 (file)
@@ -45,7 +45,7 @@ set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_alt_animtime 0.2
 set g_balance_shotgun_secondary_alt_refire 1.2
-set g_balance_shotgun_secondary_animtime 1
+set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 70
 set g_balance_shotgun_secondary_force 200
 set g_balance_shotgun_secondary_melee_delay 0.25
index 5545c6502cf6bdd38e11c80c7ea0cc852b87241c..af2234f0d6c898c02d110d98273a46019bdb7c9d 100644 (file)
@@ -751,7 +751,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_animtime 1
+set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 80
 set g_balance_shotgun_secondary_force 200
 set g_balance_shotgun_secondary_melee_delay 0.25
index cf7a05f6b5b0787fc13555bdc7ce2b8b601d1acf..931a63c6a2264d068110f90817f63be68fc5ac64 100644 (file)
@@ -43,7 +43,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_animtime 1
+set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 80
 set g_balance_shotgun_secondary_force 200
 set g_balance_shotgun_secondary_melee_delay 0.25
index 7cb9d9f4c9b29c5b58ec430244227574d91b19c8..779c7129c68009e6493df50b05af29aef33c6581 100644 (file)
@@ -43,7 +43,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_animtime 1
+set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 70
 set g_balance_shotgun_secondary_force 200
 set g_balance_shotgun_secondary_melee_delay 0.25
index 7cb9d9f4c9b29c5b58ec430244227574d91b19c8..779c7129c68009e6493df50b05af29aef33c6581 100644 (file)
@@ -43,7 +43,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_reload_ammo 0
 set g_balance_shotgun_reload_time 2
 set g_balance_shotgun_secondary 1
-set g_balance_shotgun_secondary_animtime 1
+set g_balance_shotgun_secondary_animtime 1.15
 set g_balance_shotgun_secondary_damage 70
 set g_balance_shotgun_secondary_force 200
 set g_balance_shotgun_secondary_melee_delay 0.25
index b25b17ccd5418bd6de228a195ac8dd498e45b19f..7ed41440f88ebbc56a349ee841a6194804cda7fe 100644 (file)
@@ -1340,7 +1340,7 @@ set g_frozen_damage_trigger 1 "if 1, frozen players falling into the void will d
 set g_frozen_force 0.6 "How much to multiply the force on a frozen player with"
 
 // player statistics server URI
-set g_playerstats_uri "" "Output player statistics information to either: URL (with ://), console (with a dash like this: -), or supply a filename to output to data directory."
+set g_playerstats_gamereport_uri "http://stats.xonotic.org/stats/submit" "Output player statistics information to either: URL (with ://), console (with a dash like this: -), or supply a filename to output to data directory."
 
 // autoscreenshots
 set g_max_info_autoscreenshot 3 "how many info_autoscreenshot entities are allowed"
index 9b492efb41aec377fe2c8411a7f30ddfd462049e..ee335d9b0013817edf041d88082c9d8a8a9d2cea 100644 (file)
@@ -4,7 +4,7 @@ QCC ?= gmqcc
 PROGS_OUT ?= $(CURDIR)/..
 WORKDIR ?= ../.tmp
 
-QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='*')
+QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~')
 VER = $(subst *,\*,$(QCCFLAGS_WATERMARK))
 NDEBUG ?= 1
 BUILD_MOD ?= 0
diff --git a/qcsrc/client/_mod.inc b/qcsrc/client/_mod.inc
new file mode 100644 (file)
index 0000000..acb6977
--- /dev/null
@@ -0,0 +1,13 @@
+// generated file; do not modify
+#include "announcer.qc"
+#include "bgmscript.qc"
+#include "csqcmodel_hooks.qc"
+#include "main.qc"
+#include "mapvoting.qc"
+#include "miscfunctions.qc"
+#include "player_skeleton.qc"
+#include "scoreboard.qc"
+#include "shownames.qc"
+#include "teamradar.qc"
+#include "view.qc"
+#include "wall.qc"
index f7db0e30a0b8e0fa51ad3171ddb758e7b0f660d4..558a7f393fe8b027afcc8689588027337d76be55 100644 (file)
@@ -82,6 +82,7 @@ bool autocvar_cl_vehicles_hud_tactical = true;
 float autocvar_cl_vehicles_hudscale = 0.5;
 float autocvar_cl_vehicles_notify_time = 15;
 float autocvar_cl_vehicles_crosshair_size = 0.5;
+bool autocvar_cl_vehicles_crosshair_colorize = true;
 bool autocvar__vehicles_shownchasemessage;
 bool autocvar_cl_velocityzoom_enabled;
 float autocvar_cl_velocityzoom_factor;
diff --git a/qcsrc/client/commands/_mod.inc b/qcsrc/client/commands/_mod.inc
new file mode 100644 (file)
index 0000000..d9220c6
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qc"
+#include "cl_cmd.qc"
index 8a40a3b14656d3b726c7434fba651298259ebaea..bc15eeb689560fbaa07b91647cbd6cbe15ff1bdd 100644 (file)
@@ -1,4 +1,2 @@
 #include "all.qh"
 #include <common/command/all.qc>
-
-#include "cl_cmd.qc"
diff --git a/qcsrc/client/hud/_mod.inc b/qcsrc/client/hud/_mod.inc
new file mode 100644 (file)
index 0000000..73066c3
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "hud.qc"
+#include "hud_config.qc"
diff --git a/qcsrc/client/hud/all.qc b/qcsrc/client/hud/all.qc
deleted file mode 100644 (file)
index 1e4b558..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "all.qh"
-#include "hud.qc"
-#include "hud_config.qc"
index 795b84998a7d5ef6a5d5ba8389eaa7796f805f37..0be0f47351de4ee4dc4e2586cefca90546061134 100644 (file)
@@ -114,86 +114,6 @@ vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspe
                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)
-{
-    TC(int, cp);
-       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
diff --git a/qcsrc/client/hud/panel/_mod.inc b/qcsrc/client/hud/panel/_mod.inc
new file mode 100644 (file)
index 0000000..2995164
--- /dev/null
@@ -0,0 +1,20 @@
+// generated file; do not modify
+#include "ammo.qc"
+#include "centerprint.qc"
+#include "chat.qc"
+#include "engineinfo.qc"
+#include "healtharmor.qc"
+#include "infomessages.qc"
+#include "minigame.qc"
+#include "modicons.qc"
+#include "notify.qc"
+#include "physics.qc"
+#include "powerups.qc"
+#include "pressedkeys.qc"
+#include "quickmenu.qc"
+#include "racetimer.qc"
+#include "radar.qc"
+#include "score.qc"
+#include "timer.qc"
+#include "vote.qc"
+#include "weapons.qc"
index 479c594db56e5ad07b5b9187df84c9568f7f05c7..957fe1f3941d2823d75b7ac8a4d4f16e0995c0a6 100644 (file)
@@ -491,13 +491,33 @@ float srecordtime_change_time; // time when srecordtime last changed
 float race_status_time;
 int race_status_prev;
 string race_status_name_prev;
+
+// 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;
+}
+
+void race_showTime(string text, vector pos, vector timeText_ofs, float theTime, vector textSize, float f)
+{
+       drawstring_aspect(pos, text, textSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawstring_aspect(pos + timeText_ofs, TIME_ENCODED_TOSTRING(theTime), textSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       if (f < 1) {
+               drawstring_aspect_expanding(pos, text, textSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
+               drawstring_aspect_expanding(pos + timeText_ofs, TIME_ENCODED_TOSTRING(theTime), textSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
+       }
+}
+
 void HUD_Mod_Race(vector pos, vector mySize)
 {
        mod_active = 1; // race should never hide the mod icons panel
        entity me;
        me = playerslots[player_localnum];
        float score;
-       float f; // yet another function has this
        score = me.(scores[ps_primary]);
 
        if(!(scores_flags[ps_primary] & SFL_TIME) || teamplay) // race/cts record display on HUD
@@ -515,7 +535,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
                db_put(ClientProgsDB, strcat(shortmapname, rr, "time"), ftos(score));
                if(autocvar_cl_autodemo_delete_keeprecords)
                {
-                       f = autocvar_cl_autodemo_delete;
+                       float f = autocvar_cl_autodemo_delete;
                        f &= ~1;
                        cvar_set("cl_autodemo_delete", ftos(f)); // don't delete demo with new record!
                }
@@ -539,18 +559,9 @@ void HUD_Mod_Race(vector pos, vector mySize)
                textPos = pos + eY * 0.5 * max(0, mySize.y/2 - squareSize) + eX * 0.5 * (mySize.x - squareSize);
                medalPos = pos + eY * 0.5 * max(0, mySize.y/2 - squareSize) + eY * 0.5 * mySize.y + eX * 0.5 * (mySize.x - squareSize);
        }
+       vector textSize = eX * squareSize + eY * 0.25 * squareSize;
 
-       f = time - crecordtime_change_time;
-
-       if (f > 1) {
-               drawstring_aspect(textPos, _("Personal best"), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(textPos + eY * 0.25 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       } else {
-               drawstring_aspect(textPos, _("Personal best"), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(textPos + eY * 0.25 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect_expanding(pos, _("Personal best"), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
-               drawstring_aspect_expanding(pos + eY * 0.25 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
-       }
+       race_showTime(_("Personal best"), textPos, eY * 0.25 * squareSize, t, textSize, time - crecordtime_change_time);
 
        // server record
        t = race_server_record;
@@ -558,17 +569,9 @@ void HUD_Mod_Race(vector pos, vector mySize)
                srecordtime_prev = t;
                srecordtime_change_time = time;
        }
-       f = time - srecordtime_change_time;
 
-       if (f > 1) {
-               drawstring_aspect(textPos + eY * 0.5 * squareSize, _("Server best"), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(textPos + eY * 0.75 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       } else {
-               drawstring_aspect(textPos + eY * 0.5 * squareSize, _("Server best"), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(textPos + eY * 0.75 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect_expanding(textPos + eY * 0.5 * squareSize, _("Server best"), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
-               drawstring_aspect_expanding(textPos + eY * 0.75 * squareSize, TIME_ENCODED_TOSTRING(t), eX * squareSize + eY * 0.25 * squareSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, f);
-       }
+       textPos += eY * 0.5 * squareSize;
+       race_showTime(_("Server best"), textPos, eY * 0.25 * squareSize, t, textSize, time - srecordtime_change_time);
 
        if (race_status != race_status_prev || race_status_name != race_status_name_prev) {
                race_status_time = time + 5;
index dd733a8134d7ca41a50cc3307e7021f841a8626f..a6b616e7bc86e1bef7dacadac20ee1d1435175fb 100644 (file)
@@ -1,4 +1,879 @@
 #include "quickmenu.qh"
 // QuickMenu (#23)
 
-#include <client/quickmenu.qc>
+#include <common/ent_cs.qh>
+#include <client/hud/all.qh>
+#include <client/mapvoting.qh>
+
+// QUICKMENU_MAXLINES must be <= 10
+const int QUICKMENU_MAXLINES = 10;
+// visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
+string QuickMenu_Page_Command[QUICKMENU_MAXLINES];
+string QuickMenu_Page_Description[QUICKMENU_MAXLINES];
+int QuickMenu_Page_Command_Type[QUICKMENU_MAXLINES];
+int QuickMenu_Page_Entries;
+int QuickMenu_Page;
+int QuickMenu_Page_ActivatedEntry = -1;
+bool QuickMenu_Page_ActivatedEntry_Close;
+float QuickMenu_Page_ActivatedEntry_Time;
+bool QuickMenu_IsLastPage;
+// all the entries are loaded into QuickMenu_Buffer
+// each entry (submenu or command) is composed of 2 entries
+const int QUICKMENU_MAXENTRIES = 256;
+const int QUICKMENU_BUFFER_MAXENTRIES = 2 * QUICKMENU_MAXENTRIES;
+int QuickMenu_Buffer = -1;
+int QuickMenu_Buffer_Size;
+int QuickMenu_Buffer_Index;
+string QuickMenu_CurrentSubMenu;
+float QuickMenu_TimeOut;
+
+// QuickMenu_Buffer are labeled with these tags
+#define QM_TAG_TITLE "T"
+#define QM_TAG_SUBMENU "S"
+#define QM_TAG_COMMAND "C"
+#define QM_TAG_PLCOMMAND "P"
+
+#define QuickMenu_Buffer_Set(tag, string) bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat(tag, string))
+#define QuickMenu_Buffer_Get() bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index)
+
+// if s1 is not empty s will be displayed as command otherwise as submenu
+void QuickMenu_Page_LoadEntry(int i, string s, string s1)
+{
+    TC(int, i);
+       //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
+       if (QuickMenu_Page_Description[i])
+               strunzone(QuickMenu_Page_Description[i]);
+       QuickMenu_Page_Description[i] = strzone(s);
+       if (QuickMenu_Page_Command[i])
+               strunzone(QuickMenu_Page_Command[i]);
+       QuickMenu_Page_Command[i] = strzone(s1);
+}
+
+void QuickMenu_Page_ClearEntry(int i)
+{
+    TC(int, i);
+       if (QuickMenu_Page_Description[i])
+               strunzone(QuickMenu_Page_Description[i]);
+       QuickMenu_Page_Description[i] = string_null;
+       if (QuickMenu_Page_Command[i])
+               strunzone(QuickMenu_Page_Command[i]);
+       QuickMenu_Page_Command[i] = string_null;
+}
+
+float QuickMenu_Page_Load(string target_submenu, float new_page);
+void QuickMenu_Default(string submenu);
+bool QuickMenu_Open(string mode, string submenu)
+{
+       int fh = -1;
+       string s;
+
+       if(mode == "")
+       {
+               if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
+                       mode = "default";
+               else
+                       mode = "file";
+       }
+
+       if(mode == "file")
+       {
+               if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
+                       LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
+               else
+               {
+                       fh = fopen(autocvar_hud_panel_quickmenu_file, FILE_READ);
+                       if(fh < 0)
+                               LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", autocvar_hud_panel_quickmenu_file);
+               }
+               if(fh < 0)
+                       mode = "default";
+       }
+
+       if(mode == "default")
+       {
+               QuickMenu_Buffer = buf_create();
+               if(QuickMenu_Buffer < 0)
+                       return false;
+
+               QuickMenu_Default(submenu);
+       }
+       else if(mode == "file")
+       {
+               QuickMenu_Buffer = buf_create();
+               if(QuickMenu_Buffer < 0)
+               {
+                       fclose(fh);
+                       return false;
+               }
+
+               QuickMenu_Buffer_Size = 0;
+               while((s = fgets(fh)) && QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES)
+               {
+                       // first skip invalid entries, so we don't check them anymore
+                       float argc;
+                       argc = tokenize_console(s);
+                       if(argc == 0 || argv(0) == "")
+                               continue;
+                       if(argc == 1)
+                               QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
+                       else if(argc == 2)
+                       {
+                               if(argv(1) == "")
+                                       continue;
+                               QuickMenu_Buffer_Set(QM_TAG_TITLE, argv(0));
+                               ++QuickMenu_Buffer_Size;
+                               QuickMenu_Buffer_Set(QM_TAG_COMMAND, argv(1));
+                       }
+                       else if(argc == 3)
+                       {
+                               // check for special keywords
+                               float teamplayers = 0, without_me = 0;
+                               switch(argv(2))
+                               {
+                                       case "ALLPLAYERS_BUT_ME":               without_me = 1; // fall through
+                                       case "ALLPLAYERS":                              teamplayers = 0; break;
+                                       case "OWNTEAMPLAYERS_BUT_ME":   without_me = 1; // fall through
+                                       case "OWNTEAMPLAYERS":                  teamplayers = 1; break;
+                                       case "ENEMYTEAMPLAYERS":                teamplayers = 2; break;
+                                       default: continue;
+                               }
+
+                               if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES)
+                               {
+                                       QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
+                                       ++QuickMenu_Buffer_Size;
+                                       QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); // put PLCOMMAND arguments in the title string
+                                       ++QuickMenu_Buffer_Size;
+                                       QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, argv(1));
+                                       ++QuickMenu_Buffer_Size;
+                                       QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
+                               }
+                       }
+                       ++QuickMenu_Buffer_Size;
+               }
+               fclose(fh);
+       }
+       else
+       {
+               LOG_WARNINGF("Unrecognized mode %s\n", mode);
+               return false;
+       }
+
+       if (QuickMenu_Buffer_Size <= 0)
+       {
+               buf_del(QuickMenu_Buffer);
+               QuickMenu_Buffer = -1;
+               return false;
+       }
+
+       if(mode == "file")
+               QuickMenu_Page_Load(submenu, 0);
+       else
+               QuickMenu_Page_Load("", 0);
+
+       hud_panel_quickmenu = 1;
+       if(autocvar_hud_cursormode)
+               setcursormode(1);
+       hudShiftState = 0;
+
+       QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
+       return true;
+}
+
+void QuickMenu_Buffer_Close()
+{
+       if (QuickMenu_Buffer >= 0)
+       {
+               buf_del(QuickMenu_Buffer);
+               QuickMenu_Buffer = -1;
+               QuickMenu_Buffer_Size = 0;
+       }
+}
+
+void QuickMenu_Close()
+{
+       if (QuickMenu_CurrentSubMenu)
+               strunzone(QuickMenu_CurrentSubMenu);
+       QuickMenu_CurrentSubMenu = string_null;
+       int i;
+       for (i = 0; i < QUICKMENU_MAXLINES; ++i)
+               QuickMenu_Page_ClearEntry(i);
+       QuickMenu_Page_Entries = 0;
+       hud_panel_quickmenu = 0;
+       mouseClicked = 0;
+       prevMouseClicked = 0;
+       QuickMenu_Buffer_Close();
+
+       if(autocvar_hud_cursormode)
+       if(!mv_active)
+               setcursormode(0);
+}
+
+// It assumes submenu open tag is already detected
+void QuickMenu_skip_submenu(string submenu)
+{
+       string s, z_submenu;
+       z_submenu = strzone(submenu);
+       for(++QuickMenu_Buffer_Index ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+       {
+               s = QuickMenu_Buffer_Get();
+               if(substring(s, 0, 1) != QM_TAG_SUBMENU)
+                       continue;
+               if(substring(s, 1, -1) == z_submenu) // submenu end
+                       break;
+               QuickMenu_skip_submenu(substring(s, 1, -1));
+       }
+       strunzone(z_submenu);
+}
+
+bool QuickMenu_IsOpened()
+{
+       return (QuickMenu_Page_Entries > 0);
+}
+
+void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me);
+bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, bool without_me)
+{
+    TC(int, teamplayers); TC(bool, without_me);
+       int i;
+       for(i = 0; i < QUICKMENU_MAXLINES; ++i)
+               QuickMenu_Page_ClearEntry(i);
+       QuickMenu_Buffer_Close();
+
+       QuickMenu_Buffer = buf_create();
+       if(QuickMenu_Buffer < 0)
+               return false;
+
+       HUD_Quickmenu_PlayerListEntries(cmd, teamplayers, without_me);
+
+       if(QuickMenu_Buffer_Size <= 0)
+       {
+               buf_del(QuickMenu_Buffer);
+               QuickMenu_Buffer = -1;
+               return false;
+       }
+       return true;
+}
+
+// new_page 0 means page 0, new_page != 0 means next page
+int QuickMenu_Buffer_Index_Prev;
+bool QuickMenu_Page_Load(string target_submenu, bool new_page)
+{
+    TC(bool, new_page);
+       string s = string_null, cmd = string_null, z_submenu;
+
+       if (new_page == 0)
+               QuickMenu_Page = 0;
+       else
+               ++QuickMenu_Page;
+
+       z_submenu = strzone(target_submenu);
+       if (QuickMenu_CurrentSubMenu)
+               strunzone(QuickMenu_CurrentSubMenu);
+       QuickMenu_CurrentSubMenu = strzone(z_submenu);
+
+       QuickMenu_IsLastPage = true;
+       QuickMenu_Page_Entries = 0;
+
+       QuickMenu_Buffer_Index = 0;
+       if (z_submenu != "")
+       {
+               // skip everything until the submenu open tag is found
+               for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+               {
+                       s = QuickMenu_Buffer_Get();
+                       if(substring(s, 0, 1) == QM_TAG_SUBMENU && substring(s, 1, -1) == z_submenu)
+                       {
+                               // printf("^3 beginning of %s\n", z_submenu);
+                               ++QuickMenu_Buffer_Index;
+                               break; // target_submenu found!
+                       }
+                       // printf("^1 skipping %s\n", s);
+               }
+               if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
+                       LOG_WARNINGF("Couldn't find submenu \"%s\"\n", z_submenu);
+       }
+
+       // only the last page can contain up to QUICKMENU_MAXLINES entries
+       // the other ones contain only (QUICKMENU_MAXLINES - 2) entries
+       // so that the panel can show an empty row and "Continue..."
+       float first_entry = QuickMenu_Page * (QUICKMENU_MAXLINES - 2);
+       int entry_num = 0; // counts entries in target_submenu
+       for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+       {
+               s = QuickMenu_Buffer_Get();
+
+               if(z_submenu != "" && substring(s, 1, -1) == z_submenu)
+               {
+                       // printf("^3 end of %s\n", z_submenu);
+                       break;
+               }
+
+               if(entry_num >= first_entry)
+               {
+                       ++QuickMenu_Page_Entries;
+                       if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES - 2)
+                               QuickMenu_Buffer_Index_Prev = QuickMenu_Buffer_Index;
+                       else if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES)
+                       {
+                               QuickMenu_Page_ClearEntry(QUICKMENU_MAXLINES - 1);
+                               QuickMenu_Buffer_Index = QuickMenu_Buffer_Index_Prev;
+                               QuickMenu_IsLastPage = false;
+                               break;
+                       }
+               }
+
+               // NOTE: entries are loaded starting from 1, not from 0
+               if(substring(s, 0, 1) == QM_TAG_SUBMENU)
+               {
+                       if(entry_num >= first_entry)
+                               QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), "");
+                       QuickMenu_skip_submenu(substring(s, 1, -1));
+               }
+               else if(entry_num >= first_entry && substring(s, 0, 1) == QM_TAG_TITLE)
+               {
+                       ++QuickMenu_Buffer_Index;
+                       cmd = QuickMenu_Buffer_Get();
+                       string command_code = substring(cmd, 0, 1);
+                       if(command_code == QM_TAG_COMMAND)
+                               cmd = substring(cmd, 1, -1);
+                       else if(command_code == QM_TAG_PLCOMMAND)
+                       {
+                               // throw away the current quickmenu buffer and load a new one
+                               cmd = substring(cmd, 1, -1);
+                               strunzone(z_submenu);
+                               if(HUD_Quickmenu_PlayerListEntries_Create(cmd, stof(substring(s, 1, 1)), stof(substring(s, 2, 1))))
+                                       return QuickMenu_Page_Load("", 0);
+                               QuickMenu_Close();
+                               return false;
+                       }
+
+                       tokenize_console(cmd);
+                       QuickMenu_Page_Command_Type[QuickMenu_Page_Entries] = (argv(1) && argv(0) == "toggle");
+
+                       QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), cmd);
+               }
+
+               ++entry_num;
+       }
+       strunzone(z_submenu);
+       if (QuickMenu_Page_Entries == 0)
+       {
+               QuickMenu_Close();
+               return false;
+       }
+       QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
+       return true;
+}
+
+bool QuickMenu_ActionForNumber(int num)
+{
+    TC(int, num);
+       if (!QuickMenu_IsLastPage)
+       {
+               if (num < 0 || num >= QUICKMENU_MAXLINES)
+                       return false;
+               if (num == QUICKMENU_MAXLINES - 1)
+                       return false;
+               if (num == 0)
+               {
+                       QuickMenu_Page_Load(QuickMenu_CurrentSubMenu, +1);
+                       return false;
+               }
+       } else if (num <= 0 || num > QuickMenu_Page_Entries)
+               return false;
+
+       if (QuickMenu_Page_Command[num] != "")
+       {
+               localcmd(strcat("\n", QuickMenu_Page_Command[num], "\n"));
+               QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
+               return true;
+       }
+       if (QuickMenu_Page_Description[num] != "")
+               QuickMenu_Page_Load(QuickMenu_Page_Description[num], 0);
+       return false;
+}
+
+void QuickMenu_Page_ActiveEntry(int entry_num)
+{
+    TC(int, entry_num);
+       QuickMenu_Page_ActivatedEntry = entry_num;
+       QuickMenu_Page_ActivatedEntry_Time = time + 0.1;
+       if(QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
+       {
+               bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
+               // toggle commands don't close the quickmenu
+               if(QuickMenu_Page_Command_Type[QuickMenu_Page_ActivatedEntry] == 1)
+                       QuickMenu_Page_ActivatedEntry_Close = false;
+               else
+                       QuickMenu_Page_ActivatedEntry_Close = (f && !(hudShiftState & S_CTRL));
+       }
+       else
+               QuickMenu_Page_ActivatedEntry_Close = (!(hudShiftState & S_CTRL));
+}
+
+bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
+{
+    TC(int, bInputType);
+       // we only care for keyboard events
+       if(bInputType == 2)
+               return false;
+
+       if(!QuickMenu_IsOpened() || autocvar__hud_configure || mv_active)
+               return false;
+
+       if(bInputType == 3)
+       {
+               mousepos.x = nPrimary;
+               mousepos.y = nSecondary;
+               return true;
+       }
+
+       // allow console bind to work
+       string con_keys;
+       float keys;
+       con_keys = findkeysforcommand("toggleconsole", 0);
+       keys = tokenize(con_keys); // findkeysforcommand returns data for this
+
+       bool hit_con_bind = false;
+       int i;
+       for (i = 0; i < keys; ++i)
+       {
+               if(nPrimary == stof(argv(i)))
+                       hit_con_bind = true;
+       }
+
+       if(bInputType == 0) {
+               if(nPrimary == K_ALT) hudShiftState |= S_ALT;
+               if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
+               if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+       }
+       else if(bInputType == 1) {
+               if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
+               if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
+               if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+       }
+
+       if(nPrimary == K_ESCAPE)
+       {
+               if (bInputType == 1)
+                       return true;
+               QuickMenu_Close();
+       }
+       else if(nPrimary >= '0' && nPrimary <= '9')
+       {
+               if (bInputType == 1)
+                       return true;
+               QuickMenu_Page_ActiveEntry(stof(chr2str(nPrimary)));
+       }
+       if(nPrimary == K_MOUSE1)
+       {
+               if(bInputType == 0) // key pressed
+                       mouseClicked |= S_MOUSE1;
+               else if(bInputType == 1) // key released
+                       mouseClicked -= (mouseClicked & S_MOUSE1);
+       }
+       else if(nPrimary == K_MOUSE2)
+       {
+               if(bInputType == 0) // key pressed
+                       mouseClicked |= S_MOUSE2;
+               else if(bInputType == 1) // key released
+                       mouseClicked -= (mouseClicked & S_MOUSE2);
+       }
+       else if(hit_con_bind)
+               return false;
+
+       return true;
+}
+
+void QuickMenu_Mouse()
+{
+       if(mv_active) return;
+
+       if(!mouseClicked)
+       if(prevMouseClicked & S_MOUSE2)
+       {
+               QuickMenu_Close();
+               return;
+       }
+
+       if(!autocvar_hud_cursormode)
+       {
+               mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
+
+               mousepos.x = bound(0, mousepos.x, vid_conwidth);
+               mousepos.y = bound(0, mousepos.y, vid_conheight);
+       }
+
+       HUD_Panel_UpdateCvars();
+
+       if(panel_bg_padding)
+       {
+               panel_pos += '1 1 0' * panel_bg_padding;
+               panel_size -= '2 2 0' * panel_bg_padding;
+       }
+
+       float first_entry_pos, entries_height;
+       vector fontsize;
+       fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
+       first_entry_pos = panel_pos.y + ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
+       entries_height = panel_size.y - ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y);
+
+       if (mousepos.x >= panel_pos.x && mousepos.y >= first_entry_pos && mousepos.x <= panel_pos.x + panel_size.x && mousepos.y <= first_entry_pos + entries_height)
+       {
+               float entry_num;
+               entry_num = floor((mousepos.y - first_entry_pos) / fontsize.y);
+               if (QuickMenu_IsLastPage || entry_num != QUICKMENU_MAXLINES - 2)
+               {
+                       panel_pos.y = first_entry_pos + entry_num * fontsize.y;
+                       vector color;
+                       if(mouseClicked & S_MOUSE1)
+                               color = '0.5 1 0.5';
+                       else if(hudShiftState & S_CTRL)
+                               color = '1 1 0.3';
+                       else
+                               color = '1 1 1';
+                       drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, color, .2, DRAWFLAG_NORMAL);
+
+                       if(!mouseClicked && (prevMouseClicked & S_MOUSE1))
+                               QuickMenu_Page_ActiveEntry((entry_num < QUICKMENU_MAXLINES - 1) ? entry_num + 1 : 0);
+               }
+       }
+
+       draw_cursor_normal(mousepos, '1 1 1', 0.8);
+
+       prevMouseClicked = mouseClicked;
+}
+
+void HUD_Quickmenu_DrawEntry(vector pos, string desc, string option, vector fontsize)
+{
+       string entry;
+       float offset;
+       float desc_width = panel_size.x;
+       if(option)
+       {
+               string pic = strcat(hud_skin_path, "/", option);
+               if(precache_pic(pic) == "")
+                       pic = strcat("gfx/hud/default/", option);
+               vector option_size = '1 1 0' * fontsize.y * 0.8;
+               desc_width -= option_size.x;
+               drawpic(pos + eX * desc_width + eY * (fontsize.y - option_size.y) / 2, pic, option_size, '1 1 1', panel_fg_alpha, DRAWFLAG_ADDITIVE);
+               desc_width -= fontsize.x / 4;
+       }
+       entry = textShortenToWidth(desc, desc_width, fontsize, stringwidth_colors);
+       if (autocvar_hud_panel_quickmenu_align > 0)
+       {
+               float real_desc_width = stringwidth_colors(entry, fontsize);
+               offset = (desc_width - real_desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
+
+               if(option)
+               {
+                       // when there's enough room align description regardless the checkbox
+                       float extra_offset = (panel_size.x - desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
+                       if(offset + real_desc_width + extra_offset < desc_width)
+                               offset += extra_offset;
+                       else
+                               offset = max(0, desc_width - real_desc_width);
+               }
+               drawcolorcodedstring(pos + eX * offset, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
+       }
+       else
+               drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
+}
+
+void HUD_QuickMenu()
+{
+       if(!autocvar__hud_configure)
+       {
+               if (hud_configure_prev && hud_configure_prev != -1)
+                       QuickMenu_Close();
+
+               if(!hud_draw_maximized) return;
+               if(mv_active) return;
+               //if(!autocvar_hud_panel_quickmenu) return;
+               if(!hud_panel_quickmenu) return;
+
+               if(QuickMenu_TimeOut)
+               if(time > QuickMenu_TimeOut)
+               {
+                       QuickMenu_Close();
+                       return;
+               }
+       }
+       else
+       {
+               if(!QuickMenu_IsOpened())
+               {
+                       QuickMenu_Page_Entries = 1;
+                       QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
+                       ++QuickMenu_Page_Entries;
+                       QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
+                       ++QuickMenu_Page_Entries;
+                       // although real command doesn't matter here, it must not be empty
+                       // otherwise the entry is displayed like a submenu
+                       for (; QuickMenu_Page_Entries < QUICKMENU_MAXLINES - 1; ++QuickMenu_Page_Entries)
+                               QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Command%d"), QuickMenu_Page_Entries), "-");
+                       ++QuickMenu_Page_Entries;
+                       QuickMenu_Page_ClearEntry(QuickMenu_Page_Entries);
+                       QuickMenu_IsLastPage = false;
+               }
+       }
+
+       HUD_Panel_UpdateCvars();
+
+       HUD_Scale_Enable();
+       HUD_Panel_DrawBg(1);
+
+       if(panel_bg_padding)
+       {
+               panel_pos += '1 1 0' * panel_bg_padding;
+               panel_size -= '2 2 0' * panel_bg_padding;
+       }
+
+       int i;
+       vector fontsize;
+       string color;
+       fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
+
+       if (!QuickMenu_IsLastPage)
+       {
+               color = "^5";
+               HUD_Quickmenu_DrawEntry(panel_pos + eY * (panel_size.y - fontsize.y), sprintf("%d: %s%s", 0, color, _("Continue...")), string_null, fontsize);
+       }
+       else
+               panel_pos.y += ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
+
+       for (i = 1; i <= QuickMenu_Page_Entries; ++i) {
+               if (QuickMenu_Page_Description[i] == "")
+                       break;
+               string option = string_null;
+               if (QuickMenu_Page_Command[i] == "")
+                       color = "^4";
+               else
+               {
+                       color = "^3";
+                       if(QuickMenu_Page_Command_Type[i] == 1) // toggle command
+                       {
+                               int end = strstrofs(QuickMenu_Page_Command[i], ";", 0);
+                               if(end < 0)
+                                       tokenize_console(QuickMenu_Page_Command[i]);
+                               else
+                                       tokenize_console(substring(QuickMenu_Page_Command[i], 0, end));
+
+                               //if(argv(1) && argv(0) == "toggle") // already checked
+                               {
+                                       // "enable feature xxx" "toggle xxx" (or "toggle xxx 1 0")
+                                       // "disable feature xxx" "toggle xxx 0 1"
+                                       float ON_value = 1, OFF_value = 0;
+                                       if(argv(2))
+                                               ON_value = stof(argv(2));
+
+                                       if(argv(3))
+                                               OFF_value = stof(argv(3));
+                                       else
+                                               OFF_value = !ON_value;
+
+                                       float value = cvar(argv(1));
+                                       if(value == ON_value)
+                                               option = "checkbox_checked";
+                                       else if(value == OFF_value)
+                                               option = "checkbox_empty";
+                                       else
+                                               option = "checkbox_undefined";
+                               }
+                       }
+               }
+               HUD_Quickmenu_DrawEntry(panel_pos, sprintf("%d: %s%s", i, color, QuickMenu_Page_Description[i]), option, fontsize);
+
+               if(QuickMenu_Page_ActivatedEntry_Time && time < QuickMenu_Page_ActivatedEntry_Time
+                       && QuickMenu_Page_ActivatedEntry == i)
+                       drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, '0.5 1 0.5', .2, DRAWFLAG_NORMAL);
+
+               panel_pos.y += fontsize.y;
+       }
+
+       if(QuickMenu_Page_ActivatedEntry >= 0 && time >= QuickMenu_Page_ActivatedEntry_Time)
+       {
+               if(!QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
+               {
+                       bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
+                       if(f && QuickMenu_Page_ActivatedEntry_Close)
+                               QuickMenu_Close();
+               }
+               else if(QuickMenu_Page_ActivatedEntry_Close)
+                       QuickMenu_Close();
+               QuickMenu_Page_ActivatedEntry = -1;
+               QuickMenu_Page_ActivatedEntry_Time = 0;
+       }
+}
+
+
+#define QUICKMENU_SMENU(submenu,eng_submenu) { \
+       if(target_submenu == eng_submenu && target_submenu_found) \
+               return; /* target_submenu entries are now loaded, exit */ \
+       if(QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES) \
+               QuickMenu_Buffer_Set(QM_TAG_SUBMENU, submenu); \
+       ++QuickMenu_Buffer_Size; \
+       if(target_submenu == eng_submenu && !target_submenu_found) { \
+               QuickMenu_Buffer_Size = 0; /* enable load of next entries */ \
+               target_submenu_found = true; \
+       } \
+}
+
+#define QUICKMENU_ENTRY(title,command) { \
+       if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
+       { \
+               QuickMenu_Buffer_Set(QM_TAG_TITLE, title); \
+               ++QuickMenu_Buffer_Size; \
+               QuickMenu_Buffer_Set(QM_TAG_COMMAND, command); \
+       } \
+       ++QuickMenu_Buffer_Size; \
+}
+
+#define QUICKMENU_SMENU_PL(submenu,eng_submenu,command,teamplayers,without_me) { \
+       if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES) {\
+               QUICKMENU_SMENU(submenu,eng_submenu) \
+               QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); \
+               ++QuickMenu_Buffer_Size; \
+               QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, command); \
+               ++QuickMenu_Buffer_Size; \
+               QUICKMENU_SMENU(submenu,eng_submenu) \
+       } \
+}
+
+
+
+// useful to Translate a string inside the Command
+#define QUICKMENU_ENTRY_TC(title,command,text,translated_text) {\
+       if(prvm_language == "en") \
+               QUICKMENU_ENTRY(title, sprintf(command, text)) \
+       else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) \
+               QUICKMENU_ENTRY(strcat("(en)", title), sprintf(command, text)) \
+       else \
+               QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
+}
+
+void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
+{
+    TC(int, teamplayers); TC(bool, without_me);
+       entity pl;
+       if(teamplayers && !team_count)
+               return;
+
+       for(pl = players.sort_next; pl; pl = pl.sort_next)
+       {
+               if(teamplayers == 1 && (pl.team != myteam || pl.team == NUM_SPECTATOR)) // only own team players
+                       continue;
+               if(teamplayers == 2 && (pl.team == myteam || pl.team == NUM_SPECTATOR)) // only enemy team players
+                       continue;
+               if(without_me && pl.sv_entnum == player_localnum)
+                       continue;
+               QUICKMENU_ENTRY(entcs_GetName(pl.sv_entnum), sprintf(cmd, entcs_GetName(pl.sv_entnum)))
+       }
+
+       return;
+}
+
+
+// Specifying target_submenu, this function only loads entries inside target_submenu
+// NOTE: alternatively we could have loaded the whole default quickmenu and
+// then called QuickMenu_Page_Load(target_submenu, 0);
+// but this sytem is more reliable since we can always refer to target_submenu
+// with the English title even if a translation is active
+void QuickMenu_Default(string target_submenu)
+{
+       bool target_submenu_found = false;
+       if(target_submenu != "")
+               QuickMenu_Buffer_Size = QUICKMENU_BUFFER_MAXENTRIES; // forbids load of next entries until target_submenu
+
+       QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^nice one")), "say %s", ":-) / nice one", CTX(_("QMCMD^:-) / nice one")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^good game")), "say %s", "good game", CTX(_("QMCMD^good game")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^hi / good luck")), "say %s", "hi / good luck and have fun", CTX(_("QMCMD^hi / good luck and have fun")))
+       QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
+
+       if(teamplay)
+       {
+       QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^quad soon")), "say_team %s", "quad soon", CTX(_("QMCMD^quad soon")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^free item, icon")), "say_team %s; g_waypointsprite_team_here_p", "free item %x^7 (l:%y^7)", CTX(_("QMCMD^free item %x^7 (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^took item, icon")), "say_team %s; g_waypointsprite_team_here", "took item (l:%l^7)", CTX(_("QMCMD^took item (l:%l^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^negative")), "say_team %s", "negative", CTX(_("QMCMD^negative")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^positive")), "say_team %s", "positive", CTX(_("QMCMD^positive")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^need help, icon")), "say_team %s; g_waypointsprite_team_helpme; cmd voice needhelp", "need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^enemy seen, icon")), "say_team %s; g_waypointsprite_team_danger_p; cmd voice incoming", "enemy seen (l:%y^7)", CTX(_("QMCMD^enemy seen (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^flag seen, icon")), "say_team %s; g_waypointsprite_team_here_p; cmd voice seenflag", "flag seen (l:%y^7)", CTX(_("QMCMD^flag seen (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^defending, icon")), "say_team %s; g_waypointsprite_team_here", "defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^roaming, icon")), "say_team %s; g_waypointsprite_team_here", "roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^attacking, icon")), "say_team %s; g_waypointsprite_team_here", "attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^killed flag, icon")), "say_team %s; g_waypointsprite_team_here_p", "killed flagcarrier (l:%y^7)", CTX(_("QMCMD^killed flagcarrier (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^dropped flag, icon")), "say_team %s; g_waypointsprite_team_here_d", "dropped flag (l:%d^7)", CTX(_("QMCMD^dropped flag (l:%d^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop gun, icon")), "say_team %s; g_waypointsprite_team_here; wait; dropweapon", "dropped gun %w^7 (l:%l^7)", CTX(_("QMCMD^dropped gun %w^7 (l:%l^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop flag/key, icon")), "say_team %s; g_waypointsprite_team_here; wait; use", "dropped flag/key %w^7 (l:%l^7)", CTX(_("QMCMD^dropped flag/key %w^7 (l:%l^7)")))
+       QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
+       }
+
+       QUICKMENU_SMENU_PL(CTX(_("QMCMD^Send private message to")), "Send private message to", "commandmode tell \"%s^7\"", 0, 1)
+
+       QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
+               QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person view")), "toggle chase_active")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Player models like mine")), "toggle cl_forceplayermodels")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Names above players")), "toggle hud_shownames")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Crosshair per weapon")), "toggle crosshair_per_weapon")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^FPS")), "toggle hud_panel_engineinfo")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Net graph")), "toggle shownetgraph")
+               QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
+
+               QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Hit sound")), "toggle cl_hitsound")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Chat sound")), "toggle con_chatsound")
+               QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
+
+               if(spectatee_status > 0)
+               {
+               QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^1st person")), "chase_active 0; -use")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person around player")), "chase_active 1; +use")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person behind")), "chase_active 1; -use")
+               QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
+               }
+
+               if(spectatee_status == -1)
+               {
+               QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Increase speed")), "weapnext")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Decrease speed")), "weapprev")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision off")), "+use")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision on")), "-use")
+               QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
+               }
+
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Fullscreen")), "toggle vid_fullscreen; vid_restart")
+               if(prvm_language != "en")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Translate chat messages")), "toggle hud_panel_quickmenu_translatecommands")
+       QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
+
+       QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Restart the map")), "vcall restart")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^End match")), "vcall endmatch")
+               if(STAT(TIMELIMIT) > 0)
+               {
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Reduce match time")), "vcall reducematchtime")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Extend match time")), "vcall extendmatchtime")
+               }
+               if(teamplay)
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Shuffle teams")), "vcall shuffleteams")
+       QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
+
+       if(target_submenu != "" && !target_submenu_found)
+       {
+               LOG_WARNINGF("Couldn't find submenu \"%s\"\n", target_submenu);
+               if(prvm_language != "en")
+                       LOG_WARNINGF("^3Warning: submenu must be in English\n", target_submenu);
+               QuickMenu_Buffer_Size = 0;
+       }
+}
+#undef QUICKMENU_SMENU
+#undef QUICKMENU_ENTRY
+#undef QUICKMENU_ENTRY_TC
index 6db88c68b39ee50fce1f8acce9c778465a3223ae..aad86e6bd689ed786280f6c1b8210e96b69ec6a3 100644 (file)
@@ -1,2 +1,6 @@
 #pragma once
 #include "../panel.qh"
+
+bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary);
+bool QuickMenu_IsOpened();
+void QuickMenu_Mouse();
index 449b1682cadd1faa7ea7945cb01be57b31a6e0eb..3ad0bb0f79e8c1216e4f91e7b6c05f643e89b66c 100644 (file)
@@ -3,6 +3,77 @@
 #include <common/mapinfo.qh>
 
 /** Race timer (#8) */
+
+// return the string of the onscreen race timer
+string MakeRaceString(int cp, float mytime, float theirtime, float lapdelta, string theirname)
+{
+       TC(int, cp);
+       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)));
+}
+
 void HUD_RaceTimer ()
 {
        if(!autocvar__hud_configure)
index bdffae574e8efa44a3ba203be2bc510e21e0ca1d..bb1cf9b4aab3ea5b47c0c4837709fd24836f071a 100644 (file)
@@ -4,7 +4,7 @@
 #include "hud/all.qh"
 #include "mapvoting.qh"
 #include "mutators/events.qh"
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
 #include <common/t_items.qh>
diff --git a/qcsrc/client/mutators/_mod.inc b/qcsrc/client/mutators/_mod.inc
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
index ca0078cdb8c50fdc75d7b3ed196944f516819cac..8817a2c71bfa14506774e73886ad3a00a93b5e43 100644 (file)
@@ -1,37 +1,24 @@
-#include "../lib/_all.inc"
+#include <lib/_all.inc>
 #include "_all.qh"
 
-#include "../common/effects/qc/all.qc"
+#include "_mod.inc"
+#include "commands/_mod.inc"
+#include "hud/_mod.inc"
+#include "mutators/_mod.inc"
+#include "weapons/_mod.inc"
 
-#include "announcer.qc"
-#include "bgmscript.qc"
-#include "csqcmodel_hooks.qc"
-#include "hud/all.qc"
-#include "main.qc"
-#include "mapvoting.qc"
-#include "miscfunctions.qc"
-#include "player_skeleton.qc"
-#include "scoreboard.qc"
-#include "shownames.qc"
-#include "teamradar.qc"
-#include "view.qc"
-#include "wall.qc"
+#include <common/_all.inc>
+#include <common/effects/qc/all.qc>
 
-#include "commands/all.qc"
+#include <lib/csqcmodel/cl_model.qc>
+#include <lib/csqcmodel/cl_player.qc>
+#include <lib/csqcmodel/interpolate.qc>
 
-#include "weapons/projectile.qc" // TODO
-
-#include "../common/_all.inc"
-
-#include "../lib/csqcmodel/cl_model.qc"
-#include "../lib/csqcmodel/cl_player.qc"
-#include "../lib/csqcmodel/interpolate.qc"
-
-#include "../lib/warpzone/anglestransform.qc"
-#include "../lib/warpzone/client.qc"
-#include "../lib/warpzone/common.qc"
-#include "../lib/warpzone/server.qc"
-#include "../lib/warpzone/util_server.qc"
+#include <lib/warpzone/anglestransform.qc>
+#include <lib/warpzone/common.qc>
+#include <lib/warpzone/client.qc>
+#include <lib/warpzone/server.qc>
+#include <lib/warpzone/util_server.qc>
 
 #if BUILD_MOD
 #include "../../mod/client/progs.inc"
diff --git a/qcsrc/client/quickmenu.qc b/qcsrc/client/quickmenu.qc
deleted file mode 100644 (file)
index 8f44529..0000000
+++ /dev/null
@@ -1,878 +0,0 @@
-#include "quickmenu.qh"
-
-#include <common/ent_cs.qh>
-#include "hud/all.qh"
-#include "mapvoting.qh"
-
-// QUICKMENU_MAXLINES must be <= 10
-const int QUICKMENU_MAXLINES = 10;
-// visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
-string QuickMenu_Page_Command[QUICKMENU_MAXLINES];
-string QuickMenu_Page_Description[QUICKMENU_MAXLINES];
-int QuickMenu_Page_Command_Type[QUICKMENU_MAXLINES];
-int QuickMenu_Page_Entries;
-int QuickMenu_Page;
-int QuickMenu_Page_ActivatedEntry = -1;
-bool QuickMenu_Page_ActivatedEntry_Close;
-float QuickMenu_Page_ActivatedEntry_Time;
-bool QuickMenu_IsLastPage;
-// all the entries are loaded into QuickMenu_Buffer
-// each entry (submenu or command) is composed of 2 entries
-const int QUICKMENU_MAXENTRIES = 256;
-const int QUICKMENU_BUFFER_MAXENTRIES = 2 * QUICKMENU_MAXENTRIES;
-int QuickMenu_Buffer = -1;
-int QuickMenu_Buffer_Size;
-int QuickMenu_Buffer_Index;
-string QuickMenu_CurrentSubMenu;
-float QuickMenu_TimeOut;
-
-// QuickMenu_Buffer are labeled with these tags
-#define QM_TAG_TITLE "T"
-#define QM_TAG_SUBMENU "S"
-#define QM_TAG_COMMAND "C"
-#define QM_TAG_PLCOMMAND "P"
-
-#define QuickMenu_Buffer_Set(tag, string) bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat(tag, string))
-#define QuickMenu_Buffer_Get() bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index)
-
-// if s1 is not empty s will be displayed as command otherwise as submenu
-void QuickMenu_Page_LoadEntry(int i, string s, string s1)
-{
-    TC(int, i);
-       //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
-       if (QuickMenu_Page_Description[i])
-               strunzone(QuickMenu_Page_Description[i]);
-       QuickMenu_Page_Description[i] = strzone(s);
-       if (QuickMenu_Page_Command[i])
-               strunzone(QuickMenu_Page_Command[i]);
-       QuickMenu_Page_Command[i] = strzone(s1);
-}
-
-void QuickMenu_Page_ClearEntry(int i)
-{
-    TC(int, i);
-       if (QuickMenu_Page_Description[i])
-               strunzone(QuickMenu_Page_Description[i]);
-       QuickMenu_Page_Description[i] = string_null;
-       if (QuickMenu_Page_Command[i])
-               strunzone(QuickMenu_Page_Command[i]);
-       QuickMenu_Page_Command[i] = string_null;
-}
-
-float QuickMenu_Page_Load(string target_submenu, float new_page);
-void QuickMenu_Default(string submenu);
-bool QuickMenu_Open(string mode, string submenu)
-{
-       int fh = -1;
-       string s;
-
-       if(mode == "")
-       {
-               if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
-                       mode = "default";
-               else
-                       mode = "file";
-       }
-
-       if(mode == "file")
-       {
-               if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
-                       LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
-               else
-               {
-                       fh = fopen(autocvar_hud_panel_quickmenu_file, FILE_READ);
-                       if(fh < 0)
-                               LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", autocvar_hud_panel_quickmenu_file);
-               }
-               if(fh < 0)
-                       mode = "default";
-       }
-
-       if(mode == "default")
-       {
-               QuickMenu_Buffer = buf_create();
-               if(QuickMenu_Buffer < 0)
-                       return false;
-
-               QuickMenu_Default(submenu);
-       }
-       else if(mode == "file")
-       {
-               QuickMenu_Buffer = buf_create();
-               if(QuickMenu_Buffer < 0)
-               {
-                       fclose(fh);
-                       return false;
-               }
-
-               QuickMenu_Buffer_Size = 0;
-               while((s = fgets(fh)) && QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES)
-               {
-                       // first skip invalid entries, so we don't check them anymore
-                       float argc;
-                       argc = tokenize_console(s);
-                       if(argc == 0 || argv(0) == "")
-                               continue;
-                       if(argc == 1)
-                               QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
-                       else if(argc == 2)
-                       {
-                               if(argv(1) == "")
-                                       continue;
-                               QuickMenu_Buffer_Set(QM_TAG_TITLE, argv(0));
-                               ++QuickMenu_Buffer_Size;
-                               QuickMenu_Buffer_Set(QM_TAG_COMMAND, argv(1));
-                       }
-                       else if(argc == 3)
-                       {
-                               // check for special keywords
-                               float teamplayers = 0, without_me = 0;
-                               switch(argv(2))
-                               {
-                                       case "ALLPLAYERS_BUT_ME":               without_me = 1; // fall through
-                                       case "ALLPLAYERS":                              teamplayers = 0; break;
-                                       case "OWNTEAMPLAYERS_BUT_ME":   without_me = 1; // fall through
-                                       case "OWNTEAMPLAYERS":                  teamplayers = 1; break;
-                                       case "ENEMYTEAMPLAYERS":                teamplayers = 2; break;
-                                       default: continue;
-                               }
-
-                               if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES)
-                               {
-                                       QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
-                                       ++QuickMenu_Buffer_Size;
-                                       QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); // put PLCOMMAND arguments in the title string
-                                       ++QuickMenu_Buffer_Size;
-                                       QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, argv(1));
-                                       ++QuickMenu_Buffer_Size;
-                                       QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
-                               }
-                       }
-                       ++QuickMenu_Buffer_Size;
-               }
-               fclose(fh);
-       }
-       else
-       {
-               LOG_WARNINGF("Unrecognized mode %s\n", mode);
-               return false;
-       }
-
-       if (QuickMenu_Buffer_Size <= 0)
-       {
-               buf_del(QuickMenu_Buffer);
-               QuickMenu_Buffer = -1;
-               return false;
-       }
-
-       if(mode == "file")
-               QuickMenu_Page_Load(submenu, 0);
-       else
-               QuickMenu_Page_Load("", 0);
-
-       hud_panel_quickmenu = 1;
-       if(autocvar_hud_cursormode)
-               setcursormode(1);
-       hudShiftState = 0;
-
-       QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
-       return true;
-}
-
-void QuickMenu_Buffer_Close()
-{
-       if (QuickMenu_Buffer >= 0)
-       {
-               buf_del(QuickMenu_Buffer);
-               QuickMenu_Buffer = -1;
-               QuickMenu_Buffer_Size = 0;
-       }
-}
-
-void QuickMenu_Close()
-{
-       if (QuickMenu_CurrentSubMenu)
-               strunzone(QuickMenu_CurrentSubMenu);
-       QuickMenu_CurrentSubMenu = string_null;
-       int i;
-       for (i = 0; i < QUICKMENU_MAXLINES; ++i)
-               QuickMenu_Page_ClearEntry(i);
-       QuickMenu_Page_Entries = 0;
-       hud_panel_quickmenu = 0;
-       mouseClicked = 0;
-       prevMouseClicked = 0;
-       QuickMenu_Buffer_Close();
-
-       if(autocvar_hud_cursormode)
-       if(!mv_active)
-               setcursormode(0);
-}
-
-// It assumes submenu open tag is already detected
-void QuickMenu_skip_submenu(string submenu)
-{
-       string s, z_submenu;
-       z_submenu = strzone(submenu);
-       for(++QuickMenu_Buffer_Index ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
-       {
-               s = QuickMenu_Buffer_Get();
-               if(substring(s, 0, 1) != QM_TAG_SUBMENU)
-                       continue;
-               if(substring(s, 1, -1) == z_submenu) // submenu end
-                       break;
-               QuickMenu_skip_submenu(substring(s, 1, -1));
-       }
-       strunzone(z_submenu);
-}
-
-bool QuickMenu_IsOpened()
-{
-       return (QuickMenu_Page_Entries > 0);
-}
-
-void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me);
-bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, bool without_me)
-{
-    TC(int, teamplayers); TC(bool, without_me);
-       int i;
-       for(i = 0; i < QUICKMENU_MAXLINES; ++i)
-               QuickMenu_Page_ClearEntry(i);
-       QuickMenu_Buffer_Close();
-
-       QuickMenu_Buffer = buf_create();
-       if(QuickMenu_Buffer < 0)
-               return false;
-
-       HUD_Quickmenu_PlayerListEntries(cmd, teamplayers, without_me);
-
-       if(QuickMenu_Buffer_Size <= 0)
-       {
-               buf_del(QuickMenu_Buffer);
-               QuickMenu_Buffer = -1;
-               return false;
-       }
-       return true;
-}
-
-// new_page 0 means page 0, new_page != 0 means next page
-int QuickMenu_Buffer_Index_Prev;
-bool QuickMenu_Page_Load(string target_submenu, bool new_page)
-{
-    TC(bool, new_page);
-       string s = string_null, cmd = string_null, z_submenu;
-
-       if (new_page == 0)
-               QuickMenu_Page = 0;
-       else
-               ++QuickMenu_Page;
-
-       z_submenu = strzone(target_submenu);
-       if (QuickMenu_CurrentSubMenu)
-               strunzone(QuickMenu_CurrentSubMenu);
-       QuickMenu_CurrentSubMenu = strzone(z_submenu);
-
-       QuickMenu_IsLastPage = true;
-       QuickMenu_Page_Entries = 0;
-
-       QuickMenu_Buffer_Index = 0;
-       if (z_submenu != "")
-       {
-               // skip everything until the submenu open tag is found
-               for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
-               {
-                       s = QuickMenu_Buffer_Get();
-                       if(substring(s, 0, 1) == QM_TAG_SUBMENU && substring(s, 1, -1) == z_submenu)
-                       {
-                               // printf("^3 beginning of %s\n", z_submenu);
-                               ++QuickMenu_Buffer_Index;
-                               break; // target_submenu found!
-                       }
-                       // printf("^1 skipping %s\n", s);
-               }
-               if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
-                       LOG_WARNINGF("Couldn't find submenu \"%s\"\n", z_submenu);
-       }
-
-       // only the last page can contain up to QUICKMENU_MAXLINES entries
-       // the other ones contain only (QUICKMENU_MAXLINES - 2) entries
-       // so that the panel can show an empty row and "Continue..."
-       float first_entry = QuickMenu_Page * (QUICKMENU_MAXLINES - 2);
-       int entry_num = 0; // counts entries in target_submenu
-       for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
-       {
-               s = QuickMenu_Buffer_Get();
-
-               if(z_submenu != "" && substring(s, 1, -1) == z_submenu)
-               {
-                       // printf("^3 end of %s\n", z_submenu);
-                       break;
-               }
-
-               if(entry_num >= first_entry)
-               {
-                       ++QuickMenu_Page_Entries;
-                       if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES - 2)
-                               QuickMenu_Buffer_Index_Prev = QuickMenu_Buffer_Index;
-                       else if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES)
-                       {
-                               QuickMenu_Page_ClearEntry(QUICKMENU_MAXLINES - 1);
-                               QuickMenu_Buffer_Index = QuickMenu_Buffer_Index_Prev;
-                               QuickMenu_IsLastPage = false;
-                               break;
-                       }
-               }
-
-               // NOTE: entries are loaded starting from 1, not from 0
-               if(substring(s, 0, 1) == QM_TAG_SUBMENU)
-               {
-                       if(entry_num >= first_entry)
-                               QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), "");
-                       QuickMenu_skip_submenu(substring(s, 1, -1));
-               }
-               else if(entry_num >= first_entry && substring(s, 0, 1) == QM_TAG_TITLE)
-               {
-                       ++QuickMenu_Buffer_Index;
-                       cmd = QuickMenu_Buffer_Get();
-                       string command_code = substring(cmd, 0, 1);
-                       if(command_code == QM_TAG_COMMAND)
-                               cmd = substring(cmd, 1, -1);
-                       else if(command_code == QM_TAG_PLCOMMAND)
-                       {
-                               // throw away the current quickmenu buffer and load a new one
-                               cmd = substring(cmd, 1, -1);
-                               strunzone(z_submenu);
-                               if(HUD_Quickmenu_PlayerListEntries_Create(cmd, stof(substring(s, 1, 1)), stof(substring(s, 2, 1))))
-                                       return QuickMenu_Page_Load("", 0);
-                               QuickMenu_Close();
-                               return false;
-                       }
-
-                       tokenize_console(cmd);
-                       QuickMenu_Page_Command_Type[QuickMenu_Page_Entries] = (argv(1) && argv(0) == "toggle");
-
-                       QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), cmd);
-               }
-
-               ++entry_num;
-       }
-       strunzone(z_submenu);
-       if (QuickMenu_Page_Entries == 0)
-       {
-               QuickMenu_Close();
-               return false;
-       }
-       QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
-       return true;
-}
-
-bool QuickMenu_ActionForNumber(int num)
-{
-    TC(int, num);
-       if (!QuickMenu_IsLastPage)
-       {
-               if (num < 0 || num >= QUICKMENU_MAXLINES)
-                       return false;
-               if (num == QUICKMENU_MAXLINES - 1)
-                       return false;
-               if (num == 0)
-               {
-                       QuickMenu_Page_Load(QuickMenu_CurrentSubMenu, +1);
-                       return false;
-               }
-       } else if (num <= 0 || num > QuickMenu_Page_Entries)
-               return false;
-
-       if (QuickMenu_Page_Command[num] != "")
-       {
-               localcmd(strcat("\n", QuickMenu_Page_Command[num], "\n"));
-               QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
-               return true;
-       }
-       if (QuickMenu_Page_Description[num] != "")
-               QuickMenu_Page_Load(QuickMenu_Page_Description[num], 0);
-       return false;
-}
-
-void QuickMenu_Page_ActiveEntry(int entry_num)
-{
-    TC(int, entry_num);
-       QuickMenu_Page_ActivatedEntry = entry_num;
-       QuickMenu_Page_ActivatedEntry_Time = time + 0.1;
-       if(QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
-       {
-               bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
-               // toggle commands don't close the quickmenu
-               if(QuickMenu_Page_Command_Type[QuickMenu_Page_ActivatedEntry] == 1)
-                       QuickMenu_Page_ActivatedEntry_Close = false;
-               else
-                       QuickMenu_Page_ActivatedEntry_Close = (f && !(hudShiftState & S_CTRL));
-       }
-       else
-               QuickMenu_Page_ActivatedEntry_Close = (!(hudShiftState & S_CTRL));
-}
-
-bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
-{
-    TC(int, bInputType);
-       // we only care for keyboard events
-       if(bInputType == 2)
-               return false;
-
-       if(!QuickMenu_IsOpened() || autocvar__hud_configure || mv_active)
-               return false;
-
-       if(bInputType == 3)
-       {
-               mousepos.x = nPrimary;
-               mousepos.y = nSecondary;
-               return true;
-       }
-
-       // allow console bind to work
-       string con_keys;
-       float keys;
-       con_keys = findkeysforcommand("toggleconsole", 0);
-       keys = tokenize(con_keys); // findkeysforcommand returns data for this
-
-       bool hit_con_bind = false;
-       int i;
-       for (i = 0; i < keys; ++i)
-       {
-               if(nPrimary == stof(argv(i)))
-                       hit_con_bind = true;
-       }
-
-       if(bInputType == 0) {
-               if(nPrimary == K_ALT) hudShiftState |= S_ALT;
-               if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
-               if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
-       }
-       else if(bInputType == 1) {
-               if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
-               if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
-               if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
-       }
-
-       if(nPrimary == K_ESCAPE)
-       {
-               if (bInputType == 1)
-                       return true;
-               QuickMenu_Close();
-       }
-       else if(nPrimary >= '0' && nPrimary <= '9')
-       {
-               if (bInputType == 1)
-                       return true;
-               QuickMenu_Page_ActiveEntry(stof(chr2str(nPrimary)));
-       }
-       if(nPrimary == K_MOUSE1)
-       {
-               if(bInputType == 0) // key pressed
-                       mouseClicked |= S_MOUSE1;
-               else if(bInputType == 1) // key released
-                       mouseClicked -= (mouseClicked & S_MOUSE1);
-       }
-       else if(nPrimary == K_MOUSE2)
-       {
-               if(bInputType == 0) // key pressed
-                       mouseClicked |= S_MOUSE2;
-               else if(bInputType == 1) // key released
-                       mouseClicked -= (mouseClicked & S_MOUSE2);
-       }
-       else if(hit_con_bind)
-               return false;
-
-       return true;
-}
-
-void QuickMenu_Mouse()
-{
-       if(mv_active) return;
-
-       if(!mouseClicked)
-       if(prevMouseClicked & S_MOUSE2)
-       {
-               QuickMenu_Close();
-               return;
-       }
-
-       if(!autocvar_hud_cursormode)
-       {
-               mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
-               mousepos.x = bound(0, mousepos.x, vid_conwidth);
-               mousepos.y = bound(0, mousepos.y, vid_conheight);
-       }
-
-       HUD_Panel_UpdateCvars();
-
-       if(panel_bg_padding)
-       {
-               panel_pos += '1 1 0' * panel_bg_padding;
-               panel_size -= '2 2 0' * panel_bg_padding;
-       }
-
-       float first_entry_pos, entries_height;
-       vector fontsize;
-       fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
-       first_entry_pos = panel_pos.y + ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
-       entries_height = panel_size.y - ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y);
-
-       if (mousepos.x >= panel_pos.x && mousepos.y >= first_entry_pos && mousepos.x <= panel_pos.x + panel_size.x && mousepos.y <= first_entry_pos + entries_height)
-       {
-               float entry_num;
-               entry_num = floor((mousepos.y - first_entry_pos) / fontsize.y);
-               if (QuickMenu_IsLastPage || entry_num != QUICKMENU_MAXLINES - 2)
-               {
-                       panel_pos.y = first_entry_pos + entry_num * fontsize.y;
-                       vector color;
-                       if(mouseClicked & S_MOUSE1)
-                               color = '0.5 1 0.5';
-                       else if(hudShiftState & S_CTRL)
-                               color = '1 1 0.3';
-                       else
-                               color = '1 1 1';
-                       drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, color, .2, DRAWFLAG_NORMAL);
-
-                       if(!mouseClicked && (prevMouseClicked & S_MOUSE1))
-                               QuickMenu_Page_ActiveEntry((entry_num < QUICKMENU_MAXLINES - 1) ? entry_num + 1 : 0);
-               }
-       }
-
-       draw_cursor_normal(mousepos, '1 1 1', 0.8);
-
-       prevMouseClicked = mouseClicked;
-}
-
-void HUD_Quickmenu_DrawEntry(vector pos, string desc, string option, vector fontsize)
-{
-       string entry;
-       float offset;
-       float desc_width = panel_size.x;
-       if(option)
-       {
-               string pic = strcat(hud_skin_path, "/", option);
-               if(precache_pic(pic) == "")
-                       pic = strcat("gfx/hud/default/", option);
-               vector option_size = '1 1 0' * fontsize.y * 0.8;
-               desc_width -= option_size.x;
-               drawpic(pos + eX * desc_width + eY * (fontsize.y - option_size.y) / 2, pic, option_size, '1 1 1', panel_fg_alpha, DRAWFLAG_ADDITIVE);
-               desc_width -= fontsize.x / 4;
-       }
-       entry = textShortenToWidth(desc, desc_width, fontsize, stringwidth_colors);
-       if (autocvar_hud_panel_quickmenu_align > 0)
-       {
-               float real_desc_width = stringwidth_colors(entry, fontsize);
-               offset = (desc_width - real_desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
-
-               if(option)
-               {
-                       // when there's enough room align description regardless the checkbox
-                       float extra_offset = (panel_size.x - desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
-                       if(offset + real_desc_width + extra_offset < desc_width)
-                               offset += extra_offset;
-                       else
-                               offset = max(0, desc_width - real_desc_width);
-               }
-               drawcolorcodedstring(pos + eX * offset, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
-       }
-       else
-               drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
-}
-
-void HUD_QuickMenu()
-{
-       if(!autocvar__hud_configure)
-       {
-               if (hud_configure_prev && hud_configure_prev != -1)
-                       QuickMenu_Close();
-
-               if(!hud_draw_maximized) return;
-               if(mv_active) return;
-               //if(!autocvar_hud_panel_quickmenu) return;
-               if(!hud_panel_quickmenu) return;
-
-               if(QuickMenu_TimeOut)
-               if(time > QuickMenu_TimeOut)
-               {
-                       QuickMenu_Close();
-                       return;
-               }
-       }
-       else
-       {
-               if(!QuickMenu_IsOpened())
-               {
-                       QuickMenu_Page_Entries = 1;
-                       QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
-                       ++QuickMenu_Page_Entries;
-                       QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
-                       ++QuickMenu_Page_Entries;
-                       // although real command doesn't matter here, it must not be empty
-                       // otherwise the entry is displayed like a submenu
-                       for (; QuickMenu_Page_Entries < QUICKMENU_MAXLINES - 1; ++QuickMenu_Page_Entries)
-                               QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Command%d"), QuickMenu_Page_Entries), "-");
-                       ++QuickMenu_Page_Entries;
-                       QuickMenu_Page_ClearEntry(QuickMenu_Page_Entries);
-                       QuickMenu_IsLastPage = false;
-               }
-       }
-
-       HUD_Panel_UpdateCvars();
-
-       HUD_Scale_Enable();
-       HUD_Panel_DrawBg(1);
-
-       if(panel_bg_padding)
-       {
-               panel_pos += '1 1 0' * panel_bg_padding;
-               panel_size -= '2 2 0' * panel_bg_padding;
-       }
-
-       int i;
-       vector fontsize;
-       string color;
-       fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
-
-       if (!QuickMenu_IsLastPage)
-       {
-               color = "^5";
-               HUD_Quickmenu_DrawEntry(panel_pos + eY * (panel_size.y - fontsize.y), sprintf("%d: %s%s", 0, color, _("Continue...")), string_null, fontsize);
-       }
-       else
-               panel_pos.y += ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
-
-       for (i = 1; i <= QuickMenu_Page_Entries; ++i) {
-               if (QuickMenu_Page_Description[i] == "")
-                       break;
-               string option = string_null;
-               if (QuickMenu_Page_Command[i] == "")
-                       color = "^4";
-               else
-               {
-                       color = "^3";
-                       if(QuickMenu_Page_Command_Type[i] == 1) // toggle command
-                       {
-                               int end = strstrofs(QuickMenu_Page_Command[i], ";", 0);
-                               if(end < 0)
-                                       tokenize_console(QuickMenu_Page_Command[i]);
-                               else
-                                       tokenize_console(substring(QuickMenu_Page_Command[i], 0, end));
-
-                               //if(argv(1) && argv(0) == "toggle") // already checked
-                               {
-                                       // "enable feature xxx" "toggle xxx" (or "toggle xxx 1 0")
-                                       // "disable feature xxx" "toggle xxx 0 1"
-                                       float ON_value = 1, OFF_value = 0;
-                                       if(argv(2))
-                                               ON_value = stof(argv(2));
-
-                                       if(argv(3))
-                                               OFF_value = stof(argv(3));
-                                       else
-                                               OFF_value = !ON_value;
-
-                                       float value = cvar(argv(1));
-                                       if(value == ON_value)
-                                               option = "checkbox_checked";
-                                       else if(value == OFF_value)
-                                               option = "checkbox_empty";
-                                       else
-                                               option = "checkbox_undefined";
-                               }
-                       }
-               }
-               HUD_Quickmenu_DrawEntry(panel_pos, sprintf("%d: %s%s", i, color, QuickMenu_Page_Description[i]), option, fontsize);
-
-               if(QuickMenu_Page_ActivatedEntry_Time && time < QuickMenu_Page_ActivatedEntry_Time
-                       && QuickMenu_Page_ActivatedEntry == i)
-                       drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, '0.5 1 0.5', .2, DRAWFLAG_NORMAL);
-
-               panel_pos.y += fontsize.y;
-       }
-
-       if(QuickMenu_Page_ActivatedEntry >= 0 && time >= QuickMenu_Page_ActivatedEntry_Time)
-       {
-               if(!QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
-               {
-                       bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
-                       if(f && QuickMenu_Page_ActivatedEntry_Close)
-                               QuickMenu_Close();
-               }
-               else if(QuickMenu_Page_ActivatedEntry_Close)
-                       QuickMenu_Close();
-               QuickMenu_Page_ActivatedEntry = -1;
-               QuickMenu_Page_ActivatedEntry_Time = 0;
-       }
-}
-
-
-#define QUICKMENU_SMENU(submenu,eng_submenu) { \
-       if(target_submenu == eng_submenu && target_submenu_found) \
-               return; /* target_submenu entries are now loaded, exit */ \
-       if(QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES) \
-               QuickMenu_Buffer_Set(QM_TAG_SUBMENU, submenu); \
-       ++QuickMenu_Buffer_Size; \
-       if(target_submenu == eng_submenu && !target_submenu_found) { \
-               QuickMenu_Buffer_Size = 0; /* enable load of next entries */ \
-               target_submenu_found = true; \
-       } \
-}
-
-#define QUICKMENU_ENTRY(title,command) { \
-       if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
-       { \
-               QuickMenu_Buffer_Set(QM_TAG_TITLE, title); \
-               ++QuickMenu_Buffer_Size; \
-               QuickMenu_Buffer_Set(QM_TAG_COMMAND, command); \
-       } \
-       ++QuickMenu_Buffer_Size; \
-}
-
-#define QUICKMENU_SMENU_PL(submenu,eng_submenu,command,teamplayers,without_me) { \
-       if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES) {\
-               QUICKMENU_SMENU(submenu,eng_submenu) \
-               QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); \
-               ++QuickMenu_Buffer_Size; \
-               QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, command); \
-               ++QuickMenu_Buffer_Size; \
-               QUICKMENU_SMENU(submenu,eng_submenu) \
-       } \
-}
-
-
-
-// useful to Translate a string inside the Command
-#define QUICKMENU_ENTRY_TC(title,command,text,translated_text) {\
-       if(prvm_language == "en") \
-               QUICKMENU_ENTRY(title, sprintf(command, text)) \
-       else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) \
-               QUICKMENU_ENTRY(strcat("(en)", title), sprintf(command, text)) \
-       else \
-               QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
-}
-
-void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
-{
-    TC(int, teamplayers); TC(bool, without_me);
-       entity pl;
-       if(teamplayers && !team_count)
-               return;
-
-       for(pl = players.sort_next; pl; pl = pl.sort_next)
-       {
-               if(teamplayers == 1 && (pl.team != myteam || pl.team == NUM_SPECTATOR)) // only own team players
-                       continue;
-               if(teamplayers == 2 && (pl.team == myteam || pl.team == NUM_SPECTATOR)) // only enemy team players
-                       continue;
-               if(without_me && pl.sv_entnum == player_localnum)
-                       continue;
-               QUICKMENU_ENTRY(entcs_GetName(pl.sv_entnum), sprintf(cmd, entcs_GetName(pl.sv_entnum)))
-       }
-
-       return;
-}
-
-
-// Specifying target_submenu, this function only loads entries inside target_submenu
-// NOTE: alternatively we could have loaded the whole default quickmenu and
-// then called QuickMenu_Page_Load(target_submenu, 0);
-// but this sytem is more reliable since we can always refer to target_submenu
-// with the English title even if a translation is active
-void QuickMenu_Default(string target_submenu)
-{
-       bool target_submenu_found = false;
-       if(target_submenu != "")
-               QuickMenu_Buffer_Size = QUICKMENU_BUFFER_MAXENTRIES; // forbids load of next entries until target_submenu
-
-       QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^nice one")), "say %s", ":-) / nice one", CTX(_("QMCMD^:-) / nice one")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^good game")), "say %s", "good game", CTX(_("QMCMD^good game")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^hi / good luck")), "say %s", "hi / good luck and have fun", CTX(_("QMCMD^hi / good luck and have fun")))
-       QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
-
-       if(teamplay)
-       {
-       QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^quad soon")), "say_team %s", "quad soon", CTX(_("QMCMD^quad soon")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^free item, icon")), "say_team %s; g_waypointsprite_team_here_p", "free item %x^7 (l:%y^7)", CTX(_("QMCMD^free item %x^7 (l:%y^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^took item, icon")), "say_team %s; g_waypointsprite_team_here", "took item (l:%l^7)", CTX(_("QMCMD^took item (l:%l^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^negative")), "say_team %s", "negative", CTX(_("QMCMD^negative")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^positive")), "say_team %s", "positive", CTX(_("QMCMD^positive")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^need help, icon")), "say_team %s; g_waypointsprite_team_helpme; cmd voice needhelp", "need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^enemy seen, icon")), "say_team %s; g_waypointsprite_team_danger_p; cmd voice incoming", "enemy seen (l:%y^7)", CTX(_("QMCMD^enemy seen (l:%y^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^flag seen, icon")), "say_team %s; g_waypointsprite_team_here_p; cmd voice seenflag", "flag seen (l:%y^7)", CTX(_("QMCMD^flag seen (l:%y^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^defending, icon")), "say_team %s; g_waypointsprite_team_here", "defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^roaming, icon")), "say_team %s; g_waypointsprite_team_here", "roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^attacking, icon")), "say_team %s; g_waypointsprite_team_here", "attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^killed flag, icon")), "say_team %s; g_waypointsprite_team_here_p", "killed flagcarrier (l:%y^7)", CTX(_("QMCMD^killed flagcarrier (l:%y^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^dropped flag, icon")), "say_team %s; g_waypointsprite_team_here_d", "dropped flag (l:%d^7)", CTX(_("QMCMD^dropped flag (l:%d^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop gun, icon")), "say_team %s; g_waypointsprite_team_here; wait; dropweapon", "dropped gun %w^7 (l:%l^7)", CTX(_("QMCMD^dropped gun %w^7 (l:%l^7)")))
-               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop flag/key, icon")), "say_team %s; g_waypointsprite_team_here; wait; use", "dropped flag/key %w^7 (l:%l^7)", CTX(_("QMCMD^dropped flag/key %w^7 (l:%l^7)")))
-       QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
-       }
-
-       QUICKMENU_SMENU_PL(CTX(_("QMCMD^Send private message to")), "Send private message to", "commandmode tell \"%s^7\"", 0, 1)
-
-       QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
-               QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person view")), "toggle chase_active")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Player models like mine")), "toggle cl_forceplayermodels")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Names above players")), "toggle hud_shownames")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Crosshair per weapon")), "toggle crosshair_per_weapon")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^FPS")), "toggle hud_panel_engineinfo")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Net graph")), "toggle shownetgraph")
-               QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
-
-               QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Hit sound")), "toggle cl_hitsound")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Chat sound")), "toggle con_chatsound")
-               QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
-
-               if(spectatee_status > 0)
-               {
-               QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^1st person")), "chase_active 0; -use")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person around player")), "chase_active 1; +use")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person behind")), "chase_active 1; -use")
-               QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
-               }
-
-               if(spectatee_status == -1)
-               {
-               QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Increase speed")), "weapnext")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Decrease speed")), "weapprev")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision off")), "+use")
-                       QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision on")), "-use")
-               QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
-               }
-
-               QUICKMENU_ENTRY(CTX(_("QMCMD^Fullscreen")), "toggle vid_fullscreen; vid_restart")
-               if(prvm_language != "en")
-               QUICKMENU_ENTRY(CTX(_("QMCMD^Translate chat messages")), "toggle hud_panel_quickmenu_translatecommands")
-       QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
-
-       QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
-               QUICKMENU_ENTRY(CTX(_("QMCMD^Restart the map")), "vcall restart")
-               QUICKMENU_ENTRY(CTX(_("QMCMD^End match")), "vcall endmatch")
-               if(STAT(TIMELIMIT) > 0)
-               {
-               QUICKMENU_ENTRY(CTX(_("QMCMD^Reduce match time")), "vcall reducematchtime")
-               QUICKMENU_ENTRY(CTX(_("QMCMD^Extend match time")), "vcall extendmatchtime")
-               }
-               if(teamplay)
-               QUICKMENU_ENTRY(CTX(_("QMCMD^Shuffle teams")), "vcall shuffleteams")
-       QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
-
-       if(target_submenu != "" && !target_submenu_found)
-       {
-               LOG_WARNINGF("Couldn't find submenu \"%s\"\n", target_submenu);
-               if(prvm_language != "en")
-                       LOG_WARNINGF("^3Warning: submenu must be in English\n", target_submenu);
-               QuickMenu_Buffer_Size = 0;
-       }
-}
-#undef QUICKMENU_SMENU
-#undef QUICKMENU_ENTRY
-#undef QUICKMENU_ENTRY_TC
diff --git a/qcsrc/client/quickmenu.qh b/qcsrc/client/quickmenu.qh
deleted file mode 100644 (file)
index 373cd27..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary);
-bool QuickMenu_IsOpened();
-void QuickMenu_Mouse();
index a41c91f773b74dcbbf5b78126898c9f31e236b79..7dcf9876983761fb500f562da5fd62c026c1218f 100644 (file)
@@ -1,6 +1,6 @@
 #include "scoreboard.qh"
 
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
 #include "hud/all.qh"
 
 #include <common/ent_cs.qh>
@@ -1308,7 +1308,7 @@ void HUD_DrawScoreboard()
        pos.y += sb_heading_fontsize.y + hud_fontsize.y * 0.25;
 
        // Draw the scoreboard
-       vector bg_size = draw_getimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
+       vector bg_size = draw_getimagesize("gfx/scoreboard/scoreboard_bg") * ((autocvar_scoreboard_bg_scale > 0) ? autocvar_scoreboard_bg_scale : 0.25);
 
        if(teamplay)
        {
index ea1d1f9ca601917dbc44bac107b87c583527d109..5368cb6429177ef4130a10e45610596485cab269 100644 (file)
@@ -178,7 +178,7 @@ void Draw_ShowNames_All()
                }
                make_impure(it);
                assert(entcs.think, eprint(entcs));
-               WITH(entity, self, entcs, entcs.think());
+               WITHSELF(entcs, entcs.think());
                if (!entcs.has_origin) continue;
                if (entcs.m_entcs_private)
                {
index b9730407ddc6339a9eced9fdedc6c6dad5686685..6ea2bb91b42a79b8d406b08b04c849bd804ca670 100644 (file)
@@ -5,7 +5,7 @@
 #include "mapvoting.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
 
 #include "mutators/events.qh"
 
@@ -853,10 +853,88 @@ void HitSound()
        }
 }
 
-void HUD_Crosshair()
-{SELFPARAM();
+vector crosshair_getcolor(entity this, float health_stat)
+{
        static float rainbow_last_flicker;
        static vector rainbow_prev_color;
+       vector wcross_color = '0 0 0';
+       switch(autocvar_crosshair_color_special)
+       {
+               case 1: // crosshair_color_per_weapon
+               {
+                       if(this)
+                       {
+                               wcross_color = this.wpcolor;
+                               break;
+                       }
+                       else { goto normalcolor; }
+               }
+
+               case 2: // crosshair_color_by_health
+               {
+                       float x = health_stat;
+
+                       //x = red
+                       //y = green
+                       //z = blue
+
+                       wcross_color.z = 0;
+
+                       if(x > 200)
+                       {
+                               wcross_color.x = 0;
+                               wcross_color.y = 1;
+                       }
+                       else if(x > 150)
+                       {
+                               wcross_color.x = 0.4 - (x-150)*0.02 * 0.4;
+                               wcross_color.y = 0.9 + (x-150)*0.02 * 0.1;
+                       }
+                       else if(x > 100)
+                       {
+                               wcross_color.x = 1 - (x-100)*0.02 * 0.6;
+                               wcross_color.y = 1 - (x-100)*0.02 * 0.1;
+                               wcross_color.z = 1 - (x-100)*0.02;
+                       }
+                       else if(x > 50)
+                       {
+                               wcross_color.x = 1;
+                               wcross_color.y = 1;
+                               wcross_color.z = 0.2 + (x-50)*0.02 * 0.8;
+                       }
+                       else if(x > 20)
+                       {
+                               wcross_color.x = 1;
+                               wcross_color.y = (x-20)*90/27/100;
+                               wcross_color.z = (x-20)*90/27/100 * 0.2;
+                       }
+                       else
+                       {
+                               wcross_color.x = 1;
+                               wcross_color.y = 0;
+                       }
+                       break;
+               }
+
+               case 3: // crosshair_color_rainbow
+               {
+                       if(time >= rainbow_last_flicker)
+                       {
+                               rainbow_prev_color = randomvec() * autocvar_crosshair_color_special_rainbow_brightness;
+                               rainbow_last_flicker = time + autocvar_crosshair_color_special_rainbow_delay;
+                       }
+                       wcross_color = rainbow_prev_color;
+                       break;
+               }
+LABEL(normalcolor)
+               default: { wcross_color = stov(autocvar_crosshair_color); break; }
+       }
+
+       return wcross_color;
+}
+
+void HUD_Crosshair()
+{SELFPARAM();
        entity e = this;
        float f, i, j;
        vector v;
@@ -937,77 +1015,7 @@ void HUD_Crosshair()
                        wcross_name = strcat("gfx/crosshair", wcross_style);
 
                // MAIN CROSSHAIR COLOR DECISION
-               switch(autocvar_crosshair_color_special)
-               {
-                       case 1: // crosshair_color_per_weapon
-                       {
-                               if(e)
-                               {
-                                       wcross_color = e.wpcolor;
-                                       break;
-                               }
-                               else { goto normalcolor; }
-                       }
-
-                       case 2: // crosshair_color_by_health
-                       {
-                               float x = STAT(HEALTH);
-
-                               //x = red
-                               //y = green
-                               //z = blue
-
-                               wcross_color.z = 0;
-
-                               if(x > 200)
-                               {
-                                       wcross_color.x = 0;
-                                       wcross_color.y = 1;
-                               }
-                               else if(x > 150)
-                               {
-                                       wcross_color.x = 0.4 - (x-150)*0.02 * 0.4;
-                                       wcross_color.y = 0.9 + (x-150)*0.02 * 0.1;
-                               }
-                               else if(x > 100)
-                               {
-                                       wcross_color.x = 1 - (x-100)*0.02 * 0.6;
-                                       wcross_color.y = 1 - (x-100)*0.02 * 0.1;
-                                       wcross_color.z = 1 - (x-100)*0.02;
-                               }
-                               else if(x > 50)
-                               {
-                                       wcross_color.x = 1;
-                                       wcross_color.y = 1;
-                                       wcross_color.z = 0.2 + (x-50)*0.02 * 0.8;
-                               }
-                               else if(x > 20)
-                               {
-                                       wcross_color.x = 1;
-                                       wcross_color.y = (x-20)*90/27/100;
-                                       wcross_color.z = (x-20)*90/27/100 * 0.2;
-                               }
-                               else
-                               {
-                                       wcross_color.x = 1;
-                                       wcross_color.y = 0;
-                               }
-                               break;
-                       }
-
-                       case 3: // crosshair_color_rainbow
-                       {
-                               if(time >= rainbow_last_flicker)
-                               {
-                                       rainbow_prev_color = randomvec() * autocvar_crosshair_color_special_rainbow_brightness;
-                                       rainbow_last_flicker = time + autocvar_crosshair_color_special_rainbow_delay;
-                               }
-                               wcross_color = rainbow_prev_color;
-                               break;
-                       }
-LABEL(normalcolor)
-                       default: { wcross_color = stov(autocvar_crosshair_color); break; }
-               }
+               wcross_color = crosshair_getcolor(e, STAT(HEALTH));
 
                if(autocvar_crosshair_effect_scalefade)
                {
@@ -1474,13 +1482,13 @@ void CSQC_UpdateView(float w, float h)
                        if(!gen)
                                ons_roundlost = false; // don't enforce the 3rd person camera if there is no dead generator to show
                }
-               if(WantEventchase(self) || (!autocvar_cl_orthoview && ons_roundlost))
+               if(WantEventchase(this) || (!autocvar_cl_orthoview && ons_roundlost))
                {
                        eventchase_running = true;
 
                        entity local_player = ((csqcplayer) ? csqcplayer : CSQCModel_server2csqc(player_localentnum - 1));
                        if(!local_player)
-                               local_player = self; // fall back!
+                               local_player = this; // fall back!
 
                        // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
                        vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
@@ -1499,7 +1507,7 @@ void CSQC_UpdateView(float w, float h)
 
                        if(view_offset)
                        {
-                               WarpZone_TraceLine(current_view_origin, current_view_origin + view_offset + ('0 0 1' * autocvar_cl_eventchase_maxs.z), MOVE_WORLDONLY, self);
+                               WarpZone_TraceLine(current_view_origin, current_view_origin + view_offset + ('0 0 1' * autocvar_cl_eventchase_maxs.z), MOVE_WORLDONLY, this);
                                if(trace_fraction == 1) { current_view_origin += view_offset; }
                                else { current_view_origin.z += max(0, (trace_endpos.z - current_view_origin.z) - autocvar_cl_eventchase_maxs.z); }
                        }
@@ -1528,14 +1536,14 @@ void CSQC_UpdateView(float w, float h)
                        makevectors(view_angles);
 
                        vector eventchase_target_origin = (current_view_origin - (v_forward * eventchase_current_distance));
-                       WarpZone_TraceBox(current_view_origin, autocvar_cl_eventchase_mins, autocvar_cl_eventchase_maxs, eventchase_target_origin, MOVE_WORLDONLY, self);
+                       WarpZone_TraceBox(current_view_origin, autocvar_cl_eventchase_mins, autocvar_cl_eventchase_maxs, eventchase_target_origin, MOVE_WORLDONLY, this);
 
                        // If the boxtrace fails, revert back to line tracing.
                        if(!local_player.viewloc)
                        if(trace_startsolid)
                        {
                                eventchase_target_origin = (current_view_origin - (v_forward * eventchase_current_distance));
-                               WarpZone_TraceLine(current_view_origin, eventchase_target_origin, MOVE_WORLDONLY, self);
+                               WarpZone_TraceLine(current_view_origin, eventchase_target_origin, MOVE_WORLDONLY, this);
                                setproperty(VF_ORIGIN, (trace_endpos - (v_forward * autocvar_cl_eventchase_mins.z)));
                        }
                        else { setproperty(VF_ORIGIN, trace_endpos); }
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..f8c8bd26b65e20203bcdf36d08869345bb516951 100644 (file)
@@ -1 +1,3 @@
 #pragma once
+
+vector crosshair_getcolor(entity this, float health_stat);
diff --git a/qcsrc/client/weapons/_mod.inc b/qcsrc/client/weapons/_mod.inc
new file mode 100644 (file)
index 0000000..005158a
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "projectile.qc"
index 8efa61772cae2b630cd0bc7ac6b13b92b413b22e..b16c24fb47086179068f433c7b93a057f28836c0 100644 (file)
@@ -39,11 +39,11 @@ float autocvar_net_connecttimeout = 30;
 #include "t_items.qc"
 #endif
 
-#include "items/all.qc"
+#include "items/_mod.inc"
     #include "weapons/all.qc"
         #include "monsters/all.qc"
         #include "turrets/all.qc"
         #include "vehicles/all.qc"
 
-#include "mutators/all.qc"
-    #include "gamemodes/all.qc"
+#include "mutators/_mod.inc"
+    #include "gamemodes/_mod.inc"
diff --git a/qcsrc/common/_mod.inc b/qcsrc/common/_mod.inc
new file mode 100644 (file)
index 0000000..0503213
--- /dev/null
@@ -0,0 +1,13 @@
+// generated file; do not modify
+#include "anim.qc"
+#include "animdecide.qc"
+#include "campaign_file.qc"
+#include "campaign_setup.qc"
+#include "ent_cs.qc"
+#include "mapinfo.qc"
+#include "net_notice.qc"
+#include "playerstats.qc"
+#include "state.qc"
+#include "t_items.qc"
+#include "util.qc"
+#include "viewloc.qc"
diff --git a/qcsrc/common/command/_mod.inc b/qcsrc/common/command/_mod.inc
new file mode 100644 (file)
index 0000000..57ff3f7
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "all.qc"
+#include "generic.qc"
+#include "markup.qc"
+#include "rpn.qc"
diff --git a/qcsrc/common/deathtypes/_mod.inc b/qcsrc/common/deathtypes/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
diff --git a/qcsrc/common/effects/_mod.inc b/qcsrc/common/effects/_mod.inc
new file mode 100644 (file)
index 0000000..25e9062
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qc"
+#include "effectinfo.qc"
diff --git a/qcsrc/common/effects/qc/_mod.inc b/qcsrc/common/effects/qc/_mod.inc
new file mode 100644 (file)
index 0000000..fc5a14f
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "all.qc"
+#include "casings.qc"
+#include "damageeffects.qc"
+#include "gibs.qc"
+#include "globalsound.qc"
+#include "lightningarc.qc"
+#include "modeleffects.qc"
index 6763519ef49b55543bac9a1d150c6054861beccf..ab217110b08a96352ea01185e63be7e38ff08134 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef SVQC
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner);
+#endif
+
 #ifdef IMPLEMENTATION
 
 #include <common/util.qh>
index ba60e51bd10cf3c483a24a3c818f52d2ab3ed476..c894ea15414f294ba8d5b6b1d62192b3558056c1 100644 (file)
@@ -73,33 +73,33 @@ 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;
+               this.nextthink = time + autocvar_cl_damageeffect_ticrate * this.owner.total_damages;
        else
-               self.nextthink = time + autocvar_cl_damageeffect_ticrate;
+               this.nextthink = time + autocvar_cl_damageeffect_ticrate;
 
-       if(time >= self.cnt || !self.owner || !self.owner.modelindex || !self.owner.drawmask)
+       if(time >= this.cnt || !this.owner || !this.owner.modelindex || !this.owner.drawmask)
        {
                // time is up or the player got gibbed / disconnected
-               self.owner.total_damages = max(0, self.owner.total_damages - 1);
-               remove(self);
+               this.owner.total_damages = max(0, this.owner.total_damages - 1);
+               remove(this);
                return;
        }
-       if(self.state && !self.owner.csqcmodel_isdead)
+       if(this.state && !this.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);
+               this.owner.total_damages = max(0, this.owner.total_damages - 1);
+               remove(this);
                return;
        }
-       self.state = self.owner.csqcmodel_isdead;
-       if(self.owner.isplayermodel && (self.owner.entnum == player_localentnum) && !autocvar_chase_active)
+       this.state = this.owner.csqcmodel_isdead;
+       if(this.owner.isplayermodel && (this.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);
+       org = gettaginfo(this, 0); // origin at attached location
+       __pointparticles(this.team, org, '0 0 0', 1);
 }
 
 string species_prefix(int specnum)
@@ -117,8 +117,8 @@ string species_prefix(int specnum)
        }
 }
 
-void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
-{SELFPARAM();
+void DamageEffect(entity this, vector hitorg, float thedamage, int type, int specnum)
+{
        // particle effects for players and objects damaged by weapons (eg: flames coming out of victims shot with rockets)
 
        int nearestbone = 0;
@@ -128,13 +128,13 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
 
        if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage)
                return;
-       if(!self || !self.modelindex || !self.drawmask)
+       if(!this || !this.modelindex || !this.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)
+       FOR_EACH_TAG(this)
        {
                if(!tagnum)
                        continue; // skip empty bones
@@ -144,21 +144,21 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
                        continue; // player model bone blacklist
 
                // now choose the bone closest to impact origin
-               if(nearestbone == 0 || vlen2(hitorg - gettaginfo(self, tagnum)) <= vlen2(hitorg - gettaginfo(self, nearestbone)))
+               if(nearestbone == 0 || vlen2(hitorg - gettaginfo(this, tagnum)) <= vlen2(hitorg - gettaginfo(this, nearestbone)))
                        nearestbone = tagnum;
        }
-       gettaginfo(self, nearestbone); // set gettaginfo_name
+       gettaginfo(this, 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)
+               if(this.total_damages >= autocvar_cl_damageeffect_bones)
                        return; // allow multiple damages on skeletal models
        }
        else
        {
-               if(autocvar_cl_damageeffect < 2 || self.total_damages)
+               if(autocvar_cl_damageeffect < 2 || this.total_damages)
                        return; // allow a single damage on non-skeletal models
        }
 
@@ -168,7 +168,7 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
 
        if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD")
        {
-               if(self.isplayermodel)
+               if(this.isplayermodel)
                {
                        specstr = species_prefix(specnum);
                        specstr = substring(specstr, 0, strlen(specstr) - 1);
@@ -179,18 +179,18 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
 
        e = new(damage);
        setmodel(e, MDL_Null); // necessary to attach and read origin
-       setattachment(e, self, gettaginfo_name); // attach to the given bone
-       e.owner = self;
+       setattachment(e, this, gettaginfo_name); // attach to the given bone
+       e.owner = this;
        e.cnt = time + life;
        e.team = _particleeffectnum(effectname);
        e.think = DamageEffect_Think;
        e.nextthink = time;
-       self.total_damages += 1;
+       this.total_damages += 1;
 }
 
 NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
 {
-       make_pure(this);
+       const float ATTEN_LOW = 0.2;
        float thedamage, rad, edge, thisdmg;
        bool hitplayer = false;
        int species, forcemul;
@@ -224,11 +224,10 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                forcemul = 1;
 
     FOREACH_ENTITY_RADIUS(w_org, rad + MAX_DAMAGEEXTRARADIUS, !it.tag_entity, {
-               setself(it);
-               vector nearest = NearestPointOnBox(self, w_org);
+               vector nearest = NearestPointOnBox(it, w_org);
                if (rad)
                {
-                       thisdmg = ((vlen (nearest - w_org) - bound(MIN_DAMAGEEXTRARADIUS, self.damageextraradius, MAX_DAMAGEEXTRARADIUS)) / rad);
+                       thisdmg = ((vlen (nearest - w_org) - bound(MIN_DAMAGEEXTRARADIUS, it.damageextraradius, MAX_DAMAGEEXTRARADIUS)) / rad);
                        if(thisdmg >= 1)
                                continue;
                        if(thisdmg < 0)
@@ -236,42 +235,41 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                        if(thedamage)
                        {
                                thisdmg = thedamage + (edge - thedamage) * thisdmg;
-                               thisforce = forcemul * vlen(force) * (thisdmg / thedamage) * normalize(self.origin - w_org);
+                               thisforce = forcemul * vlen(force) * (thisdmg / thedamage) * normalize(it.origin - w_org);
                        }
                        else
                        {
                                thisdmg = 0;
-                               thisforce = forcemul * vlen(force) * normalize(self.origin - w_org);
+                               thisforce = forcemul * vlen(force) * normalize(it.origin - w_org);
                        }
                }
                else
                {
-                       if(vdist((nearest - w_org), >, bound(MIN_DAMAGEEXTRARADIUS, self.damageextraradius, MAX_DAMAGEEXTRARADIUS)))
+                       if(vdist((nearest - w_org), >, bound(MIN_DAMAGEEXTRARADIUS, it.damageextraradius, MAX_DAMAGEEXTRARADIUS)))
                                continue;
 
                        thisdmg = thedamage;
                        thisforce = forcemul * force;
                }
 
-               if(self.damageforcescale)
+               if(it.damageforcescale)
                        if(vdist(thisforce, !=, 0))
                        {
-                               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;
+                               it.move_velocity = it.move_velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.move_velocity, autocvar_g_balance_damagepush_speedfactor);
+                               it.move_flags &= ~FL_ONGROUND;
                        }
 
                if(w_issilent)
-                       self.silent = 1;
+                       it.silent = 1;
 
-               if(self.event_damage)
-                       self.event_damage(self, thisdmg, w_deathtype, w_org, thisforce);
+               if(it.event_damage)
+                       it.event_damage(it, thisdmg, w_deathtype, w_org, thisforce);
 
-               DamageEffect(w_org, thisdmg, w_deathtype, species);
+               DamageEffect(it, w_org, thisdmg, w_deathtype, species);
 
-               if(self.isplayermodel)
+               if(it.isplayermodel)
                        hitplayer = true; // this impact damaged a player
        });
-       setself(this);
 
        if(DEATH_ISVEHICLE(w_deathtype))
        {
@@ -281,7 +279,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                else
                        w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
 
-               setorigin(self, w_org + w_backoff * 2); // for sound() calls
+               setorigin(this, w_org + w_backoff * 2); // for sound() calls
 
                switch(DEATH_ENT(w_deathtype))
                {
@@ -290,34 +288,34 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
 
                        // spiderbot
                        case DEATH_VH_SPID_MINIGUN:
-                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_SPIDERBOT_MINIGUN_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_SPIDERBOT_MINIGUN_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_SPID_ROCKET:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_SPIDERBOT_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_SPIDERBOT_ROCKET_EXPLODE, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_SPID_DEATH:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_EXPLOSION_BIG, this.origin, w_backoff * 1000, 1);
                                break;
 
                        case DEATH_VH_WAKI_GUN:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_RACER_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_RACER_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_WAKI_ROCKET:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_RACER_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_RACER_ROCKET_EXPLODE, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_WAKI_DEATH:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_EXPLOSION_BIG, this.origin, w_backoff * 1000, 1);
                                break;
 
                        case DEATH_VH_RAPT_CANNON:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_RAPTOR_CANNON_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_RAPTOR_CANNON_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_FRAGMENT:
                                float i;
@@ -328,20 +326,20 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                                        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(EFFECT_RAPTOR_BOMB_SPREAD, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_RAPTOR_BOMB_SPREAD, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_BOMB:
-                               sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_RAPTOR_BOMB_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_RAPTOR_BOMB_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_DEATH:
-                               sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_EXPLOSION_BIG, this.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_BUMB_GUN:
-                               sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM);
-                               pointparticles(EFFECT_BIGPLASMA_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_BIGPLASMA_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
                }
        }
@@ -355,49 +353,49 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                else
                        w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
 
-               setorigin(self, w_org + w_backoff * 2); // for sound() calls
+               setorigin(this, 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(EFFECT_BLASTER_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_BLASTER_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_FLAC:
                                pointparticles(EFFECT_HAGAR_EXPLODE, w_org, '0 0 0', 1);
-                               sound(self, CH_SHOTS, SND_HAGEXP_RANDOM(), VOL_BASE, ATTEN_NORM);
+                               sound(this, 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(EFFECT_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_ROCKET_EXPLODE, this.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(EFFECT_MACHINEGUN_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
+                               pointparticles(EFFECT_MACHINEGUN_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_PLASMA:
-                               sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_MIN);
-                               pointparticles(EFFECT_ELECTRO_IMPACT, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_ELECTRO_IMPACT, this.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_WALK_MELEE:
-                               sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_MIN);
-                               pointparticles(EFFECT_TE_SPARK, self.origin, w_backoff * 1000, 1);
+                               sound(this, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_LOW);
+                               pointparticles(EFFECT_TE_SPARK, this.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_PHASER:
                                break;
 
                         case DEATH_TURRET_TESLA:
-                               te_smallflash(self.origin);
+                               te_smallflash(this.origin);
                                break;
 
                }
@@ -415,7 +413,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(force);
-               setorigin(self, w_org + w_backoff * 2); // for sound() calls
+               setorigin(this, w_org + w_backoff * 2); // for sound() calls
 
                if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
                {
index 148d3883f031d436fb9acfff64fca5d496c75496..1310ff0343b8d98e0b82c1246d493fb4985162eb 100644 (file)
        #undef X
                this.iflags |= IFLAG_ORIGIN;
                InterpolateOrigin_Note(this);
-               WITH(entity, self, this, this.think());
+               WITHSELF(this, this.think());
                return true;
        }
 
diff --git a/qcsrc/common/gamemodes/_mod.inc b/qcsrc/common/gamemodes/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
diff --git a/qcsrc/common/gamemodes/gamemode/_mod.inc b/qcsrc/common/gamemodes/gamemode/_mod.inc
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
diff --git a/qcsrc/common/gamemodes/gamemode/nexball/_mod.inc b/qcsrc/common/gamemodes/gamemode/nexball/_mod.inc
new file mode 100644 (file)
index 0000000..3e72142
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "nexball.qc"
+#include "weapon.qc"
diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/_mod.inc b/qcsrc/common/gamemodes/gamemode/onslaught/_mod.inc
new file mode 100644 (file)
index 0000000..d1aac78
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "cl_controlpoint.qc"
+#include "cl_generator.qc"
+#include "onslaught.qc"
+#include "sv_controlpoint.qc"
+#include "sv_generator.qc"
index 93afb72077500dca1fc5c9903a263ee458a2f2a9..4fc4a982cbefefb330b95d5cdafa979d2e769b96 100644 (file)
@@ -548,7 +548,7 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
                // Use targets now (somebody make sure this is in the right place..)
                setself(this.owner);
                activator = this;
-               WITH(entity, self, this, SUB_UseTargets());
+               WITHSELF(this, SUB_UseTargets());
                setself(this);
 
                this.owner.waslinked = this.owner.islinked;
@@ -1775,7 +1775,7 @@ MUTATOR_HOOKFUNCTION(ons, reset_map_global)
        FOREACH_CLIENT(IS_PLAYER(it), {
                it.ons_roundlost = false;
                it.ons_deathloc = '0 0 0';
-               WITH(entity, self, it, PutClientInServer());
+               WITHSELF(it, PutClientInServer());
        });
        return false;
 }
diff --git a/qcsrc/common/impulses/_mod.inc b/qcsrc/common/impulses/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
diff --git a/qcsrc/common/items/_mod.inc b/qcsrc/common/items/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
diff --git a/qcsrc/common/items/all.inc b/qcsrc/common/items/all.inc
deleted file mode 100644 (file)
index 48b92be..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/** If you register a new item, make sure to add it to this list */
-#include "item/ammo.qc"
-#include "item/armor.qc"
-#include "item/health.qc"
-#include "item/jetpack.qc"
-#include "item/pickup.qc"
-#include "item/powerup.qc"
index 62dc0fe270be2d48efaf5ab54b3547aa41ed9665..9d7cfa8d32e428aed292e73b8a4d501cbfada5f9 100644 (file)
@@ -2,7 +2,7 @@
 #define ITEMS_ALL_C
 #include "all.qh"
 
-#include "all.inc"
+#include "item/_mod.inc"
 
 void Dump_Items()
 {
index ba8d86bfaab2cf71b037efcb798758c09b0d8bfe..18cc5ae4f3b707dfd11caea3774cc2473d2587f2 100644 (file)
@@ -8,7 +8,6 @@
 REGISTRY(Items, BITS(5))
 #define Items_from(i) _Items_from(i, NULL)
 REGISTER_REGISTRY(Items)
-/** If you register a new item, make sure to add it to all.inc */
 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
 
 REGISTRY_SORT(Items)
index 7780a0054551c59d50150da9d0e6a5c8c90122be..934271059ba55ed6cc464e9c7122cdd970bc65eb 100644 (file)
@@ -4,11 +4,14 @@
 #include "all.qh"
 #include "item/pickup.qh"
 
-entityclass(Inventory);
-/** Stores counts of items, the id being the index */
-class(Inventory) .int inv_items[Items_MAX];
+CLASS(Inventory, Object)
+    /** Stores counts of items, the id being the index */
+    ATTRIBARRAY(Inventory, inv_items, int, Items_MAX)
+    /** Previous state */
+    ATTRIB(Inventory, inventory, Inventory, NULL)
+ENDCLASS(Inventory)
 
-/** Player inventory; Inventories also have one inventory for storing the previous state */
+/** Player inventory */
 .Inventory inventory;
 
 REGISTER_NET_LINKED(ENT_CLIENT_INVENTORY)
@@ -31,6 +34,11 @@ NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
 #ifdef SVQC
 void Inventory_Write(Inventory data)
 {
+    if (!data) {
+        WriteInt24_t(MSG_ENTITY, 0);
+        return;
+    }
+    TC(Inventory, data);
     int bits = 0;
     FOREACH(Items, true, {
         .int fld = inv_items[it.m_id];
@@ -44,11 +52,13 @@ void Inventory_Write(Inventory data)
 #endif
 
 #ifdef SVQC
-bool Inventory_Send(entity this, entity to, int sf)
+bool Inventory_Send(Inventory this, Client to, int sf)
 {
+    TC(Inventory, this);
     WriteHeader(MSG_ENTITY, ENT_CLIENT_INVENTORY);
-    entity e = self.owner;
+    entity e = this.owner;
     if (IS_SPEC(e)) e = e.enemy;
+    TC(Player, e);
     Inventory data = e.inventory;
     Inventory_Write(data);
     return true;
@@ -56,7 +66,7 @@ bool Inventory_Send(entity this, entity to, int sf)
 
 void Inventory_new(entity e)
 {
-    Inventory inv = new_pure(Inventory), bak = new_pure(Inventory);
+    Inventory inv = NEW(Inventory), bak = NEW(Inventory);
     inv.inventory = bak;
     inv.drawonlytoclient = e;
     Net_LinkEntity((inv.owner = e).inventory = inv, false, 0, Inventory_Send);
index 55f33ecc8ec3b97088ad18416563b798f7bbd9ad..4ab7af4f2317341ebeb4d1f625dfb8659cecb3d8 100644 (file)
@@ -39,7 +39,6 @@ const int IT_UNLIMITED_AMMO                   = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITE
 const int IT_PICKUPMASK                        = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
 
 #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
-/** If you register a new item, make sure to add it to all.inc */
 CLASS(GameItem, Object)
     ATTRIB(GameItem, m_id, int, 0)
     ATTRIB(GameItem, m_name, string, string_null)
diff --git a/qcsrc/common/items/item/_mod.inc b/qcsrc/common/items/item/_mod.inc
new file mode 100644 (file)
index 0000000..453cead
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "ammo.qc"
+#include "armor.qc"
+#include "health.qc"
+#include "jetpack.qc"
+#include "pickup.qc"
+#include "powerup.qc"
diff --git a/qcsrc/common/minigames/_mod.inc b/qcsrc/common/minigames/_mod.inc
new file mode 100644 (file)
index 0000000..47690d3
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "cl_minigames.qc"
+#include "cl_minigames_hud.qc"
+#include "minigames.qc"
+#include "sv_minigames.qc"
index a61d8bfbc6519da43388cb66c9f49fe041de1383..c12399527ad45d7931d115953b4ad29f76e2424a 100644 (file)
@@ -115,7 +115,7 @@ void HUD_MinigameMenu_Click(entity menuitem)
 {SELFPARAM();
        if ( menuitem )
        {
-               WITH(entity, self, menuitem, menuitem.use());
+               WITHSELF(menuitem, menuitem.use());
        }
 }
 
diff --git a/qcsrc/common/minigames/minigame/_mod.inc b/qcsrc/common/minigames/minigame/_mod.inc
new file mode 100644 (file)
index 0000000..f53fc0b
--- /dev/null
@@ -0,0 +1,9 @@
+// generated file; do not modify
+#include "bd.qc"
+#include "c4.qc"
+#include "nmm.qc"
+#include "pong.qc"
+#include "pp.qc"
+#include "ps.qc"
+#include "snake.qc"
+#include "ttt.qc"
index 7c19c43dd6f4f2d037ac56dc7c0aa9ee54d601bb..991544189291e227cf6e6876d6cb7c15bfb9fff3 100644 (file)
@@ -146,7 +146,7 @@ int minigame_addplayer(entity minigame_session, entity player)
 
                if ( !IS_OBSERVER(player) && autocvar_sv_minigames_observer )
                {
-                       WITH(entity, self, player, PutObserverInServer());
+                       WITHSELF(player, PutObserverInServer());
                }
                if ( autocvar_sv_minigames_observer == 2 )
                        player.team_forced = -1;
diff --git a/qcsrc/common/models/_mod.inc b/qcsrc/common/models/_mod.inc
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
diff --git a/qcsrc/common/monsters/_mod.inc b/qcsrc/common/monsters/_mod.inc
new file mode 100644 (file)
index 0000000..8dff76f
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "all.qc"
+#include "spawn.qc"
+#include "sv_monsters.qc"
diff --git a/qcsrc/common/monsters/all.inc b/qcsrc/common/monsters/all.inc
deleted file mode 100644 (file)
index 778e2a1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef MENUQC
-#include "../animdecide.qh"
-#include "../anim.qh"
-vector animfixfps(entity e, vector a, vector b);
-#endif
-
-#include "monster/mage.qc"
-#include "monster/shambler.qc"
-#include "monster/spider.qc"
-#include "monster/wyvern.qc"
-#include "monster/zombie.qc"
index 2b15e4085734183ebe31053e327314d6bfc5f8e1..ce0a9023d494e2cf14367532c5305f9ec4d7af37 100644 (file)
@@ -15,7 +15,7 @@ string M_Model(string m_mdl)
 #include "all.qh"
 
 #define IMPLEMENTATION
-#include "all.inc"
+#include "monster/_mod.inc"
 #undef IMPLEMENTATION
 
 #ifdef SVQC
index b771984f212b1b4ef3a680099e19e7059600662e..1e23f3287940218b3c8a882033d3f12b42c88fd2 100644 (file)
@@ -12,12 +12,11 @@ REGISTER_REGISTRY(Monsters)
 REGISTRY_CHECK(Monsters)
 const int MON_FIRST = 1;
 #define MON_LAST (Monsters_COUNT - 1)
-/** If you register a new monster, make sure to add it to all.inc */
 #define REGISTER_MONSTER(id, inst) REGISTER(Monsters, MON, id, monsterid, inst)
 
 REGISTER_MONSTER(Null, NEW(Monster));
 
 
-#include "all.inc"
+#include "monster/_mod.inc"
 
 #endif
index f1a5ee3d46f473a558e67f4ac1ec7beb67789707..9ba1cde12941ac1777aa98c4a2f5868f8aa3a825 100644 (file)
 #include <lib/warpzone/server.qh>
 #endif
 
+#ifndef MENUQC
+#include "../animdecide.qh"
+#include "../anim.qh"
+vector animfixfps(entity e, vector a, vector b);
+#endif
+
 // special spawn flags
 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
 const int MONSTER_TYPE_FLY = 32;
@@ -39,7 +45,6 @@ const int MONSTER_SIZE_QUAKE = 8192;
 .vector anim_walk;
 .vector anim_spawn;
 
-/** If you register a new monster, make sure to add it to all.inc */
 CLASS(Monster, Object)
     ATTRIB(Monster, monsterid, int, 0)
     /** attributes */
diff --git a/qcsrc/common/monsters/monster/_mod.inc b/qcsrc/common/monsters/monster/_mod.inc
new file mode 100644 (file)
index 0000000..6b8a307
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "mage.qc"
+#include "shambler.qc"
+#include "spider.qc"
+#include "wyvern.qc"
+#include "zombie.qc"
index 9f6fb8d1b2017d241bd648a42d3c4c452e762ce0..3cfa18cdf4bc166e3f296cc11274a260acf3e050 100644 (file)
@@ -116,7 +116,7 @@ void M_Shambler_Attack_Lightning_Damage(entity this, entity inflictor, entity at
        this.health = this.health - damage;
 
        if (this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, this.use));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, this.use));
 }
 
 void M_Shambler_Attack_Lightning_Touch()
index 2c0ecdc481599c55564a96a5068b57a2b70c6df3..9b0541c14edb581a2f342337a8511b249c56c961 100644 (file)
@@ -57,12 +57,12 @@ REGISTER_MUTATOR(spiderweb, true);
 MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics)
 {
     SELFPARAM();
-       if (time >= self.spider_slowness)
+       if (time >= this.spider_slowness)
                return false;
-       PHYS_MAXSPEED(self) *= 0.5; // half speed while slow from spider
-       PHYS_MAXAIRSPEED(self) *= 0.5;
-       PHYS_AIRSPEEDLIMIT_NONQW(self) *= 0.5;
-       PHYS_AIRSTRAFEACCELERATE(self) *= 0.5;
+       PHYS_MAXSPEED(this) *= 0.5; // half speed while slow from spider
+       PHYS_MAXAIRSPEED(this) *= 0.5;
+       PHYS_AIRSPEEDLIMIT_NONQW(this) *= 0.5;
+       PHYS_AIRSTRAFEACCELERATE(this) *= 0.5;
        return false;
 }
 
index 5910d5b26ffe11921cf7f2689dd885ab9a24c0cb..9d1022fa36cd92fcda738a5477699a6f80cd74d4 100644 (file)
@@ -48,7 +48,7 @@ void monster_dropitem(entity this)
        if(e && e.monster_loot)
        {
                e.noalign = true;
-               WITH(entity, self, e, e.monster_loot(e));
+               WITHSELF(e, e.monster_loot(e));
                e.gravity = 1;
                e.movetype = MOVETYPE_TOSS;
                e.reset = SUB_Remove;
@@ -904,6 +904,9 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed)
 
 void Monster_Remove(entity this)
 {
+       if(IS_CLIENT(this))
+               return; // don't remove it?
+
        .entity weaponentity = weaponentities[0];
        if(!this) { return; }
 
@@ -1101,7 +1104,7 @@ void Monster_Damage(entity this, entity inflictor, entity attacker, float damage
                // TODO: fix this?
                activator = attacker;
                other = this.enemy;
-               WITH(entity, self, this, SUB_UseTargets());
+               WITHSELF(this, SUB_UseTargets());
                this.target2 = this.oldtarget2; // reset to original target on death, incase we respawn
 
                Monster_Dead(this, attacker, (this.health <= -100 || deathtype == DEATH_KILL.m_id));
diff --git a/qcsrc/common/mutators/_mod.inc b/qcsrc/common/mutators/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
diff --git a/qcsrc/common/mutators/mutator/_mod.inc b/qcsrc/common/mutators/mutator/_mod.inc
new file mode 100644 (file)
index 0000000..14e0e3d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "itemstime.qc"
diff --git a/qcsrc/common/mutators/mutator/bloodloss/_mod.inc b/qcsrc/common/mutators/mutator/bloodloss/_mod.inc
new file mode 100644 (file)
index 0000000..791cd03
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "bloodloss.qc"
diff --git a/qcsrc/common/mutators/mutator/breakablehook/_mod.inc b/qcsrc/common/mutators/mutator/breakablehook/_mod.inc
new file mode 100644 (file)
index 0000000..ff8da62
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "breakablehook.qc"
diff --git a/qcsrc/common/mutators/mutator/buffs/_mod.inc b/qcsrc/common/mutators/mutator/buffs/_mod.inc
new file mode 100644 (file)
index 0000000..df0201d
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qc"
+#include "buffs.qc"
index 61d4dc80aab7cff02b48ef15c4ed07e18d0ffc96..7de2a906201ff55964e6971440fc383ee8b7e838 100644 (file)
@@ -892,7 +892,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
                                {
                                        entity oldother = other;
                                        other = self;
-                                       WITH(entity, self, it, it.touch());
+                                       WITHSELF(it, it.touch());
 
                                        other = oldother;
                                }
diff --git a/qcsrc/common/mutators/mutator/bugrigs/_mod.inc b/qcsrc/common/mutators/mutator/bugrigs/_mod.inc
new file mode 100644 (file)
index 0000000..cd18f33
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "bugrigs.qc"
diff --git a/qcsrc/common/mutators/mutator/campcheck/_mod.inc b/qcsrc/common/mutators/mutator/campcheck/_mod.inc
new file mode 100644 (file)
index 0000000..2f61e45
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "campcheck.qc"
diff --git a/qcsrc/common/mutators/mutator/cloaked/_mod.inc b/qcsrc/common/mutators/mutator/cloaked/_mod.inc
new file mode 100644 (file)
index 0000000..4423f2b
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "cloaked.qc"
diff --git a/qcsrc/common/mutators/mutator/damagetext/_mod.inc b/qcsrc/common/mutators/mutator/damagetext/_mod.inc
new file mode 100644 (file)
index 0000000..ff53767
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "damagetext.qc"
diff --git a/qcsrc/common/mutators/mutator/dodging/_mod.inc b/qcsrc/common/mutators/mutator/dodging/_mod.inc
new file mode 100644 (file)
index 0000000..92244a5
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "dodging.qc"
diff --git a/qcsrc/common/mutators/mutator/doublejump/_mod.inc b/qcsrc/common/mutators/mutator/doublejump/_mod.inc
new file mode 100644 (file)
index 0000000..8c1f531
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "doublejump.qc"
diff --git a/qcsrc/common/mutators/mutator/hook/_mod.inc b/qcsrc/common/mutators/mutator/hook/_mod.inc
new file mode 100644 (file)
index 0000000..9eff27e
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "hook.qc"
diff --git a/qcsrc/common/mutators/mutator/instagib/_mod.inc b/qcsrc/common/mutators/mutator/instagib/_mod.inc
new file mode 100644 (file)
index 0000000..e5e4393
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "instagib.qc"
+#include "items.qc"
index 69bc4b7b9931274e697b9824652bec5854be99be..f8f2e5a7dfb41ec821f611b8f8573a784e97d01c 100644 (file)
@@ -302,7 +302,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
                {
                        if(frag_deathtype & HITTYPE_SECONDARY)
                        {
-                               if(!autocvar_g_instagib_blaster_keepdamage)
+                               if(!autocvar_g_instagib_blaster_keepdamage || frag_attacker == frag_target)
                                        frag_damage = frag_mirrordamage = 0;
 
                                if(frag_target != frag_attacker)
@@ -371,7 +371,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem)
         e.cnt = self.cnt;
         e.team = self.team;
         e.spawnfunc_checked = true;
-               WITH(entity, self, e, spawnfunc_item_minst_cells(e));
+               WITHSELF(e, spawnfunc_item_minst_cells(e));
                return true;
        }
 
diff --git a/qcsrc/common/mutators/mutator/invincibleproj/_mod.inc b/qcsrc/common/mutators/mutator/invincibleproj/_mod.inc
new file mode 100644 (file)
index 0000000..2783d09
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "invincibleproj.qc"
diff --git a/qcsrc/common/mutators/mutator/melee_only/_mod.inc b/qcsrc/common/mutators/mutator/melee_only/_mod.inc
new file mode 100644 (file)
index 0000000..d2132e6
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "melee_only.qc"
diff --git a/qcsrc/common/mutators/mutator/midair/_mod.inc b/qcsrc/common/mutators/mutator/midair/_mod.inc
new file mode 100644 (file)
index 0000000..aae84aa
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "midair.qc"
diff --git a/qcsrc/common/mutators/mutator/multijump/_mod.inc b/qcsrc/common/mutators/mutator/multijump/_mod.inc
new file mode 100644 (file)
index 0000000..a58cf85
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "multijump.qc"
index 14c854df9221d70ae455a57503dfdc29f1563bbf..50fd020213ae77ef64af5809798c42eba3593477 100644 (file)
@@ -101,19 +101,19 @@ MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics)
 {
     SELFPARAM();
 #ifdef CSQC
-       self.multijump_count = PHYS_MULTIJUMP_COUNT(self);
+       this.multijump_count = PHYS_MULTIJUMP_COUNT(this);
 #endif
        if(!PHYS_MULTIJUMP) { return; }
 
-       if(IS_ONGROUND(self))
-               self.multijump_count = 0;
+       if(IS_ONGROUND(this))
+               this.multijump_count = 0;
        return false;
 }
 
 MUTATOR_HOOKFUNCTION(multijump, PlayerJump)
 {
     SELFPARAM();
-       return PM_multijump_checkjump(self);
+       return PM_multijump_checkjump(this);
 }
 
 #ifdef SVQC
diff --git a/qcsrc/common/mutators/mutator/nades/_mod.inc b/qcsrc/common/mutators/mutator/nades/_mod.inc
new file mode 100644 (file)
index 0000000..9055545
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "nades.qc"
+#include "net.qc"
index 2e34c6de721f67010221c4414b41dcd3155c058e..8d17edb0b6c164b7114bf24b551b16c396bb7065 100644 (file)
@@ -749,7 +749,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i
        if(ITEM_DAMAGE_NEEDKILL(deathtype))
        {
                this.takedamage = DAMAGE_NO;
-               WITH(entity, self, this, nade_boom());
+               WITHSELF(this, nade_boom());
                return;
        }
 
@@ -804,7 +804,7 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i
                this.realowner = attacker;
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, nade_boom));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, nade_boom));
        else
                nade_burn_spawn(this);
 }
diff --git a/qcsrc/common/mutators/mutator/new_toys/_mod.inc b/qcsrc/common/mutators/mutator/new_toys/_mod.inc
new file mode 100644 (file)
index 0000000..97665f5
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "new_toys.qc"
diff --git a/qcsrc/common/mutators/mutator/nix/_mod.inc b/qcsrc/common/mutators/mutator/nix/_mod.inc
new file mode 100644 (file)
index 0000000..b98eab4
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "nix.qc"
diff --git a/qcsrc/common/mutators/mutator/overkill/_mod.inc b/qcsrc/common/mutators/mutator/overkill/_mod.inc
new file mode 100644 (file)
index 0000000..19c25a0
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "hmg.qc"
+#include "overkill.qc"
+#include "rpc.qc"
index 1af6e82df83e3b2d4e2aceac616e388231372611..ec8061c3d2f764a5ff2bf0b6c7a3ea90e7ea7193 100644 (file)
@@ -83,7 +83,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone
        }
 
        float hmg_spread = bound(WEP_CVAR(hmg, spread_min), WEP_CVAR(hmg, spread_min) + (WEP_CVAR(hmg, spread_add) * actor.misc_bulletcounter), WEP_CVAR(hmg, spread_max));
-       fireBullet(w_shotorg, w_shotdir, hmg_spread, WEP_CVAR(hmg, solidpenetration), WEP_CVAR(hmg, damage), WEP_CVAR(hmg, force), WEP_HMG.m_id, 0);
+       fireBullet(actor, w_shotorg, w_shotdir, hmg_spread, WEP_CVAR(hmg, solidpenetration), WEP_CVAR(hmg, damage), WEP_CVAR(hmg, force), WEP_HMG.m_id, 0);
 
        actor.misc_bulletcounter = actor.misc_bulletcounter + 1;
 
index 125025f205c40f8ce1908705ff831df50d18a252..45a7e77f3d21a002470f2c2bb84721f4ecb8eec1 100644 (file)
@@ -135,12 +135,14 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDies)
        e.pickup_anyway = true;
        e.spawnfunc_checked = true;
        spawnfunc_item_armor_small(e);
-       e.movetype = MOVETYPE_TOSS;
-       e.gravity = 1;
-       e.reset = SUB_Remove;
-       setorigin(e, frag_target.origin + '0 0 32');
-       e.velocity = '0 0 200' + normalize(targ.origin - frag_target.origin) * 500;
-       SUB_SetFade(e, time + 5, 1);
+       if (!wasfreed(e)) { // might have been blocked by a mutator
+        e.movetype = MOVETYPE_TOSS;
+        e.gravity = 1;
+        e.reset = SUB_Remove;
+        setorigin(e, frag_target.origin + '0 0 32');
+        e.velocity = '0 0 200' + normalize(targ.origin - frag_target.origin) * 500;
+        SUB_SetFade(e, time + 5, 1);
+       }
 
        frag_target.ok_lastwep = PS(frag_target).m_switchweapon.m_id;
 
index a5360a20cd4e1852cf2407353207660249d3b5ec..5a06302d9f282fe5cc92a550dee40b90d9eaf21f 100644 (file)
@@ -80,7 +80,7 @@ void W_RocketPropelledChainsaw_Damage(entity this, entity inflictor, entity atta
        this.health = this.health - damage;
 
        if (this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, W_RocketPropelledChainsaw_Explode));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, W_RocketPropelledChainsaw_Explode));
 }
 
 void W_RocketPropelledChainsaw_Think()
diff --git a/qcsrc/common/mutators/mutator/physical_items/_mod.inc b/qcsrc/common/mutators/mutator/physical_items/_mod.inc
new file mode 100644 (file)
index 0000000..8174e85
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "physical_items.qc"
index e8e152a5bbdb1dbbd06e40daea047e07487483f8..aaad9d47be599b59c91a7c879014d0deb8dc6535 100644 (file)
@@ -127,7 +127,7 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn)
                setorigin(wep, wep.origin + '0 0 1');
                entity oldself;
                oldself = self;
-               WITH(entity, self, wep, builtin_droptofloor());
+               WITHSELF(wep, builtin_droptofloor());
        }
 
        wep.spawn_origin = wep.origin;
diff --git a/qcsrc/common/mutators/mutator/pinata/_mod.inc b/qcsrc/common/mutators/mutator/pinata/_mod.inc
new file mode 100644 (file)
index 0000000..a4017bd
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "pinata.qc"
diff --git a/qcsrc/common/mutators/mutator/random_gravity/_mod.inc b/qcsrc/common/mutators/mutator/random_gravity/_mod.inc
new file mode 100644 (file)
index 0000000..e07c8af
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "random_gravity.qc"
diff --git a/qcsrc/common/mutators/mutator/rocketflying/_mod.inc b/qcsrc/common/mutators/mutator/rocketflying/_mod.inc
new file mode 100644 (file)
index 0000000..92ef3cc
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "rocketflying.qc"
diff --git a/qcsrc/common/mutators/mutator/rocketminsta/_mod.inc b/qcsrc/common/mutators/mutator/rocketminsta/_mod.inc
new file mode 100644 (file)
index 0000000..e50a4ba
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "rocketminsta.qc"
diff --git a/qcsrc/common/mutators/mutator/running_guns/_mod.inc b/qcsrc/common/mutators/mutator/running_guns/_mod.inc
new file mode 100644 (file)
index 0000000..2550d2d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "running_guns.qc"
diff --git a/qcsrc/common/mutators/mutator/sandbox/_mod.inc b/qcsrc/common/mutators/mutator/sandbox/_mod.inc
new file mode 100644 (file)
index 0000000..c1e80d4
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "sandbox.qc"
diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.inc b/qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.inc
new file mode 100644 (file)
index 0000000..612f5a0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "spawn_near_teammate.qc"
diff --git a/qcsrc/common/mutators/mutator/superspec/_mod.inc b/qcsrc/common/mutators/mutator/superspec/_mod.inc
new file mode 100644 (file)
index 0000000..bb63a18
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "superspec.qc"
diff --git a/qcsrc/common/mutators/mutator/touchexplode/_mod.inc b/qcsrc/common/mutators/mutator/touchexplode/_mod.inc
new file mode 100644 (file)
index 0000000..06bb8d3
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "touchexplode.qc"
diff --git a/qcsrc/common/mutators/mutator/vampire/_mod.inc b/qcsrc/common/mutators/mutator/vampire/_mod.inc
new file mode 100644 (file)
index 0000000..c0164ea
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "vampire.qc"
diff --git a/qcsrc/common/mutators/mutator/vampirehook/_mod.inc b/qcsrc/common/mutators/mutator/vampirehook/_mod.inc
new file mode 100644 (file)
index 0000000..4f2e935
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "vampirehook.qc"
diff --git a/qcsrc/common/mutators/mutator/waypoints/_mod.inc b/qcsrc/common/mutators/mutator/waypoints/_mod.inc
new file mode 100644 (file)
index 0000000..a5ebe76
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "waypointsprites.qc"
diff --git a/qcsrc/common/mutators/mutator/weaponarena_random/_mod.inc b/qcsrc/common/mutators/mutator/weaponarena_random/_mod.inc
new file mode 100644 (file)
index 0000000..c110d3f
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "weaponarena_random.qc"
diff --git a/qcsrc/common/notifications/_mod.inc b/qcsrc/common/notifications/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
diff --git a/qcsrc/common/physics/_mod.inc b/qcsrc/common/physics/_mod.inc
new file mode 100644 (file)
index 0000000..fb423ec
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "movelib.qc"
+#include "player.qc"
index 26c70daf60f2690119e73a4b213f92ff91787c37..a27b8666eedf0a716c4f5743dd844bdfd2593c76 100644 (file)
@@ -182,41 +182,41 @@ Yed need to set v_up and v_forward (generally by calling makevectors) before cal
 **/
 #endif
 
-void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max)
-{SELFPARAM();
+void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
+{
     vector a, b, c, d, e, r, push_angle, ahead, side;
 
     push_angle.y = 0;
-    r = (self.absmax + self.absmin) * 0.5 + (v_up * spring_up);
+    r = (this.absmax + this.absmin) * 0.5 + (v_up * spring_up);
     e = v_up * spring_length;
 
     // Put springs slightly inside bbox
-    ahead = v_forward * (self.maxs.x * 0.8);
-    side  = v_right   * (self.maxs.y * 0.8);
+    ahead = v_forward * (this.maxs.x * 0.8);
+    side  = v_right   * (this.maxs.y * 0.8);
 
     a = r + ahead + side;
     b = r + ahead - side;
     c = r - ahead + side;
     d = r - ahead - side;
 
-    traceline(a, a - e,MOVE_NORMAL,self);
+    traceline(a, a - e,MOVE_NORMAL,this);
     a.z =  (1 - trace_fraction);
     r = trace_endpos;
 
-    traceline(b, b - e,MOVE_NORMAL,self);
+    traceline(b, b - e,MOVE_NORMAL,this);
     b.z =  (1 - trace_fraction);
     r += trace_endpos;
 
-    traceline(c, c - e,MOVE_NORMAL,self);
+    traceline(c, c - e,MOVE_NORMAL,this);
     c.z =  (1 - trace_fraction);
     r += trace_endpos;
 
-    traceline(d, d - e,MOVE_NORMAL,self);
+    traceline(d, d - e,MOVE_NORMAL,this);
     d.z =  (1 - trace_fraction);
     r += trace_endpos;
 
     a.x = r.z;
-    r = self.origin;
+    r = this.origin;
     r.z = r.z;
 
     push_angle.x = (a.z - c.z) * _max;
@@ -225,13 +225,13 @@ void movelib_groundalign4point(float spring_length, float spring_up, float blend
     push_angle.z = (b.z - a.z) * _max;
     push_angle.z += (d.z - c.z) * _max;
 
-    //self.angles_x += push_angle_x * 0.95;
-    //self.angles_z += push_angle_z * 0.95;
+    //this.angles_x += push_angle_x * 0.95;
+    //this.angles_z += push_angle_z * 0.95;
 
-    self.angles_x = ((1-blendrate) *  self.angles.x)  + (push_angle.x * blendrate);
-    self.angles_z = ((1-blendrate) *  self.angles.z)  + (push_angle.z * blendrate);
+    this.angles_x = ((1-blendrate) *  this.angles.x)  + (push_angle.x * blendrate);
+    this.angles_z = ((1-blendrate) *  this.angles.z)  + (push_angle.z * blendrate);
 
-    //a = self.origin;
-    setorigin(self,r);
+    //a = this.origin;
+    setorigin(this,r);
 }
 
index 86cb7338509c0dad21121f4af8b7d2cfd743190f..90ea4b4160e12d79ce24e4b00e60fc9582c424f0 100644 (file)
@@ -48,6 +48,6 @@ Yed need to set v_up and v_forward (generally by calling makevectors) before cal
 **/
 #endif
 
-void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max);
+void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max);
 
 #endif
diff --git a/qcsrc/common/physics/movetypes/_mod.inc b/qcsrc/common/physics/movetypes/_mod.inc
new file mode 100644 (file)
index 0000000..674b829
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "follow.qc"
+#include "movetypes.qc"
+#include "push.qc"
+#include "step.qc"
+#include "toss.qc"
+#include "walk.qc"
index 2c9c5894bfecfdbfefe763562e840cf4f05f0233..33c56216a5d71b8ad053f9c3a05236af65ae5509 100644 (file)
@@ -321,7 +321,7 @@ void _Movetype_Impact(entity this, entity oth)  // SV_Impact
        {
                other = oth;
 
-               WITH(entity, self, this, this.move_touch());
+               WITHSELF(this, this.move_touch());
 
                other = oldother;
        }
@@ -330,7 +330,7 @@ void _Movetype_Impact(entity this, entity oth)  // SV_Impact
        {
                other = this;
 
-               WITH(entity, self, oth, oth.move_touch());
+               WITHSELF(oth, oth.move_touch());
 
                other = oldother;
        }
@@ -360,7 +360,7 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this)  // SV_LinkEdict_TouchAreaGr
                        trace_plane_dist = 0;
                        trace_ent = this;
 
-                       WITH(entity, self, it, it.move_touch());
+                       WITHSELF(it, it.move_touch());
                }
     });
 
index dd89a4099dfa6e9c3a38d001a49a618ea204932f..b3cfb875da28a318c6585bd1a91df2f8e1ff64ef 100644 (file)
@@ -149,6 +149,6 @@ void _Movetype_Physics_Pusher(entity this, float dt)  // SV_Physics_Pusher
                this.move_nextthink = 0;
                this.move_time = time;
                other = world;
-               WITH(entity, self, this, this.move_think());
+               WITHSELF(this, this.move_think());
        }
 }
index 84768690c544296b032a5410d79c1cd89707c917..0ecfa180f45bc143e6d11c831bdbbc41bc0a7b60 100644 (file)
@@ -128,7 +128,17 @@ void PM_ClientMovement_UpdateStatus(entity this, bool ground)
                PM_ClientMovement_Unstick(this);
 
        // set crouched
-       if (PHYS_INPUT_BUTTON_CROUCH(this))
+       bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
+       if(this.hook && !wasfreed(this.hook))
+               do_crouch = false;
+       if(hud != HUD_NORMAL)
+               do_crouch = false;
+       if(STAT(FROZEN, this))
+               do_crouch = false;
+       if((activeweapon == WEP_SHOCKWAVE || activeweapon == WEP_SHOTGUN) && viewmodel.animstate_startframe == viewmodel.anim_fire2_x && time < viewmodel.weapon_nextthink)
+               do_crouch = false;
+
+       if (do_crouch)
        {
                // wants to crouch, this always works
                if (!IS_DUCKED(this)) SET_DUCKED(this);
@@ -1316,7 +1326,7 @@ void PM_Main(entity this)
 
 
 #ifdef SVQC
-       WarpZone_PlayerPhysics_FixVAngle();
+       WarpZone_PlayerPhysics_FixVAngle(this);
 #endif
        float maxspeed_mod = 1;
        maxspeed_mod *= PHYS_HIGHSPEED(this);
index 339d617459b94f4dfa529d9dbd63866112d831c9..fd1b610de68811c11c405afdd6eef9f8eed43b58 100644 (file)
@@ -155,6 +155,8 @@ STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK)
 
 #define ITEMS_STAT(s)                       ((s).items)
 
+.float teleport_time;
+
 #ifdef CSQC
 
        string autocvar_cl_jumpspeedcap_min;
@@ -172,6 +174,8 @@ STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK)
        .vector movement;
        .vector v_angle;
 
+       .entity hook;
+
 // TODO
        #define IS_CLIENT(s)                        ((s).isplayermodel)
        #define IS_PLAYER(s)                        ((s).isplayermodel)
diff --git a/qcsrc/common/sounds/_mod.inc b/qcsrc/common/sounds/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
index 21e009022145aa9bbcef21d404190f8e5abed328..d75e08027171aee5cf812333cb56367bb974a3e8 100644 (file)
@@ -12,12 +12,14 @@ void PlayerState_attach(entity this)
 
 void PlayerState_detach(entity this)
 {
-       if (!PS(this)) return;  // initial connect
-       FOREACH_CLIENT(PS(it) == PS(this), { PS(it) = NULL; });
-       remove(PS(this));
-       this._ps = NULL;
-
-    Inventory_delete(self);
+    PlayerState ps = PS(this);
+       if (!ps) return;  // initial connect
+       PS(this) = NULL;
+       if (ps.m_client != this) return;  // don't own state, spectator
+       FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
+       remove(ps);
+
+    Inventory_delete(this);
 }
 
 void GetCvars(entity this, int);
index a381324f8990ea7613132f3086f2c9fbaaf9794f..75fec0103e7ccbe6cb04b804baf5b315c8a664b6 100644 (file)
@@ -1030,7 +1030,7 @@ float commodity_pickupevalfunc(entity player, entity item)
 void Item_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if(ITEM_DAMAGE_NEEDKILL(deathtype))
-               WITH(entity, self, this, RemoveItem());
+               WITHSELF(this, RemoveItem());
 }
 
 void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter)
@@ -1135,7 +1135,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                        this.SendFlags |= ISF_SIZE;
                        // note droptofloor returns false if stuck/or would fall too far
                        if (!this.noalign)
-                               WITH(entity, self, this, droptofloor());
+                               WITHSELF(this, droptofloor());
                        waypoint_spawnforitem(this);
                }
 
diff --git a/qcsrc/common/triggers/_mod.inc b/qcsrc/common/triggers/_mod.inc
new file mode 100644 (file)
index 0000000..8c5a22c
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "include.qc"
+#include "platforms.qc"
+#include "subs.qc"
+#include "teleporters.qc"
+#include "triggers.qc"
diff --git a/qcsrc/common/triggers/func/_mod.inc b/qcsrc/common/triggers/func/_mod.inc
new file mode 100644 (file)
index 0000000..2497d85
--- /dev/null
@@ -0,0 +1,19 @@
+// generated file; do not modify
+#include "bobbing.qc"
+#include "breakable.qc"
+#include "button.qc"
+#include "conveyor.qc"
+#include "door.qc"
+#include "door_rotating.qc"
+#include "door_secret.qc"
+#include "fourier.qc"
+#include "include.qc"
+#include "ladder.qc"
+#include "pendulum.qc"
+#include "plat.qc"
+#include "pointparticles.qc"
+#include "rainsnow.qc"
+#include "rotating.qc"
+#include "stardust.qc"
+#include "train.qc"
+#include "vectormamamam.qc"
index e3c74b35626ba894f03335c432b91b64ecf4a38b..feaf8785093d97b9663d67096ae3c8d22d853394 100644 (file)
@@ -243,7 +243,7 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float
                WaypointSprite_Ping(this.sprite);
                WaypointSprite_UpdateHealth(this.sprite, this.health);
        }
-       WITH(entity, self, this, func_breakable_colormod());
+       WITHSELF(this, func_breakable_colormod());
 
        if(this.health <= 0)
        {
index 41cdb44dafc3237fb9063bd5aafffce77cb1f314..e9ae0a5472042f24cfbada02a1ce52cdbd9fd07d 100644 (file)
@@ -92,7 +92,7 @@ void button_damage(entity this, entity inflictor, entity attacker, float damage,
        if (this.health <= 0)
        {
                this.enemy = damage_attacker;
-               WITH(entity, self, this, button_fire());
+               WITHSELF(this, button_fire());
        }
 }
 
index fb50a6613c14ce5dab6c3ea43d54978fd6e4822b..583c737438ac3fae10131e2497018df65789ca38 100644 (file)
@@ -147,7 +147,7 @@ spawnfunc(func_conveyor)
 
 #elif defined(CSQC)
 
-void conveyor_draw(entity this) { WITH(entity, self, this, conveyor_think()); }
+void conveyor_draw(entity this) { WITHSELF(this, conveyor_think()); }
 
 void conveyor_init()
 {SELFPARAM();
index 1bd36df4bf0957ae6e6e27a0178e6753d8e85eef..0b250ef32e1d1f74fd2f04c5628dce82b8e6bd65 100644 (file)
@@ -268,7 +268,7 @@ void door_use()
 
        if (self.owner)
        {
-               WITH(entity, self, self.owner, door_fire());
+               WITHSELF(self.owner, door_fire());
        }
 }
 
@@ -289,7 +289,7 @@ void door_damage(entity this, entity inflictor, entity attacker, float damage, i
        {
                this.owner.health = this.owner.max_health;
                this.owner.takedamage = DAMAGE_NO;      // wil be reset upon return
-               WITH(entity, self, this.owner, door_use());
+               WITHSELF(this.owner, door_use());
        }
 }
 
index e32ed7e50c308c66627c434bc8eebfaf66bc081a..70b5a0a09e884f3a3aac039b42fb8a55e973ea02 100644 (file)
@@ -65,7 +65,7 @@ void fd_secret_use()
 
 void fd_secret_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
-       WITH(entity, self, this, fd_secret_use());
+       WITHSELF(this, fd_secret_use());
 }
 
 // Wait after first movement...
index 77bb7b87090b4e093180c0b1ec0cf2cb2fa205c1..26ecc81f148411626551012622434f73a024f361 100644 (file)
@@ -5,7 +5,7 @@ void train_use();
 #endif
 void train_wait()
 {SELFPARAM();
-       WITH(entity, self, self.enemy, SUB_UseTargets());
+       WITHSELF(self.enemy, SUB_UseTargets());
        self.enemy = world;
 
        // if turning is enabled, the train will turn toward the next point while waiting
diff --git a/qcsrc/common/triggers/misc/_mod.inc b/qcsrc/common/triggers/misc/_mod.inc
new file mode 100644 (file)
index 0000000..5a6a06a
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "corner.qc"
+#include "follow.qc"
+#include "include.qc"
+#include "laser.qc"
+#include "teleport_dest.qc"
index bcd6f2807675e89db6ea3ebd05e9ae95dd70e449..0f05ce72a82772123100b4a2bb017a3047cdd7f0 100644 (file)
@@ -98,7 +98,7 @@ void misc_laser_think()
                                self.count = 1;
 
                                activator = self.enemy.pusher;
-                               WITH(entity, self, self.enemy, SUB_UseTargets());
+                               WITHSELF(self.enemy, SUB_UseTargets());
                        }
                }
                else
@@ -108,7 +108,7 @@ void misc_laser_think()
                                self.count = 0;
 
                                activator = self.enemy.pusher;
-                               WITH(entity, self, self.enemy, SUB_UseTargets());
+                               WITHSELF(self.enemy, SUB_UseTargets());
                        }
                }
        }
index a0f60bb32f03a2f3cd99da0924d6e02c4cd6db09..87c9c329099641e2c1cab962c2f5b8d55d4f26de 100644 (file)
@@ -47,15 +47,15 @@ void SUB_VanishOrRemove (entity ent)
 
 void SUB_SetFade_Think ()
 {SELFPARAM();
-       if(self.alpha == 0)
-               self.alpha = 1;
-       self.SUB_THINK = SUB_SetFade_Think;
-       self.SUB_NEXTTHINK = time;
-       self.alpha -= frametime * self.fade_rate;
-       if (self.alpha < 0.01)
-               SUB_VanishOrRemove(self);
+       if(this.alpha == 0)
+               this.alpha = 1;
+       this.SUB_THINK = SUB_SetFade_Think;
+       this.SUB_NEXTTHINK = time;
+       this.alpha -= frametime * this.fade_rate;
+       if (this.alpha < 0.01)
+               SUB_VanishOrRemove(this);
        else
-               self.SUB_NEXTTHINK = time;
+               this.SUB_NEXTTHINK = time;
 }
 
 /*
@@ -295,7 +295,7 @@ void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
 
 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void() func)
 {SELFPARAM();
-       WITH(entity, self, ent, SUB_CalcMove(tdest, tspeedtype, tspeed, func));
+       WITHSELF(ent, SUB_CalcMove(tdest, tspeedtype, tspeed, func));
 }
 
 /*
@@ -363,5 +363,5 @@ void SUB_CalcAngleMove (vector destangle, float tspeedtype, float tspeed, void()
 
 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void() func)
 {SELFPARAM();
-       WITH(entity, self, ent, SUB_CalcAngleMove (destangle, tspeedtype, tspeed, func));
+       WITHSELF(ent, SUB_CalcAngleMove (destangle, tspeedtype, tspeed, func));
 }
diff --git a/qcsrc/common/triggers/target/_mod.inc b/qcsrc/common/triggers/target/_mod.inc
new file mode 100644 (file)
index 0000000..fdfabf7
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "changelevel.qc"
+#include "include.qc"
+#include "location.qc"
+#include "music.qc"
+#include "spawn.qc"
+#include "speaker.qc"
+#include "voicescript.qc"
index 1873d64a07be516e9e387fe1a52737d6ab80f8b0..5a4e86c48b370d0dd65baa1f0553abfc433eefb0 100644 (file)
@@ -36,15 +36,13 @@ void target_music_reset(entity this)
 }
 void target_music_kill()
 {
-    SELFPARAM();
-       for(self = world; (self = find(self, classname, "target_music")); )
-       {
-               self.volume = 0;
-               if(self.targetname == "")
-                       target_music_sendto(MSG_ALL, 1);
-               else
-                       target_music_sendto(MSG_ALL, 0);
-       }
+       FOREACH_ENTITY_CLASS("target_music", true, {
+               it.volume = 0;
+        if (it.targetname == "")
+            WITHSELF(it, target_music_sendto(MSG_ALL, 1));
+        else
+            WITHSELF(it, target_music_sendto(MSG_ALL, 0));
+       });
 }
 void target_music_use()
 {
index 96c266f6cc57315e2436e3f752321b83405a5ab8..960e818b6d8c69dd8cfbabd8c5481dba7daa62c8 100644 (file)
@@ -221,7 +221,7 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                        oldactivator = activator;
 
                        activator = act;
-                       WITH(entity, self, e, e.target_spawn_spawnfunc(e));
+                       WITHSELF(e, e.target_spawn_spawnfunc(e));
                        activator = oldactivator;
 
                        // We called an external function, so we have to re-tokenize msg.
diff --git a/qcsrc/common/triggers/trigger/_mod.inc b/qcsrc/common/triggers/trigger/_mod.inc
new file mode 100644 (file)
index 0000000..03fa001
--- /dev/null
@@ -0,0 +1,25 @@
+// generated file; do not modify
+#include "counter.qc"
+#include "delay.qc"
+#include "disablerelay.qc"
+#include "flipflop.qc"
+#include "gamestart.qc"
+#include "gravity.qc"
+#include "heal.qc"
+#include "hurt.qc"
+#include "impulse.qc"
+#include "include.qc"
+#include "jumppads.qc"
+#include "keylock.qc"
+#include "magicear.qc"
+#include "monoflop.qc"
+#include "multi.qc"
+#include "multivibrator.qc"
+#include "relay.qc"
+#include "relay_activators.qc"
+#include "relay_if.qc"
+#include "relay_teamcheck.qc"
+#include "secret.qc"
+#include "swamp.qc"
+#include "teleport.qc"
+#include "viewloc.qc"
index b4b146c7f315292c3e7a44968b280e8e3821e7ac..b7cd57272dce363c57e103f755e6a126c165019a 100644 (file)
@@ -218,24 +218,24 @@ spawnfunc(trigger_impulse)
 #elif defined(CSQC)
 NET_HANDLE(ENT_CLIENT_TRIGGER_IMPULSE, bool isnew)
 {
-       self.spawnflags = ReadInt24_t();
-       self.radius = ReadCoord();
-       self.strength = ReadCoord();
-       self.falloff = ReadByte();
-       self.active = ReadByte();
+       this.spawnflags = ReadInt24_t();
+       this.radius = ReadCoord();
+       this.strength = ReadCoord();
+       this.falloff = ReadByte();
+       this.active = ReadByte();
 
        trigger_common_read(true);
        return = true;
 
-       self.classname = "trigger_impulse";
-       self.solid = SOLID_TRIGGER;
-       self.entremove = trigger_remove_generic;
-       //self.draw = trigger_draw_generic;
-       self.drawmask = MASK_NORMAL;
-       self.move_time = time;
+       this.classname = "trigger_impulse";
+       this.solid = SOLID_TRIGGER;
+       this.entremove = trigger_remove_generic;
+       //this.draw = trigger_draw_generic;
+       this.drawmask = MASK_NORMAL;
+       this.move_time = time;
 
-       if(self.radius) { self.move_touch = trigger_impulse_touch3; }
-       else if(self.target) { self.move_touch = trigger_impulse_touch1; }
-       else { self.move_touch = trigger_impulse_touch2; }
+       if(this.radius) { this.move_touch = trigger_impulse_touch3; }
+       else if(this.target) { this.move_touch = trigger_impulse_touch1; }
+       else { this.move_touch = trigger_impulse_touch2; }
 }
 #endif
index de8458e9f8bc15abe5c63f034c35164c02f3ff6f..7b82c39590e2bc1e3e192f69161d2894f0d0be49 100644 (file)
@@ -237,7 +237,7 @@ void trigger_push_touch()
        if(this.enemy.target)
        {
                activator = other;
-               WITH(entity, self, this.enemy, SUB_UseTargets());
+               WITHSELF(this.enemy, SUB_UseTargets());
        }
 
        if (other.flags & FL_PROJECTILE)
@@ -282,23 +282,23 @@ void trigger_push_findtarget()
        vector org;
 
        // first calculate a typical start point for the jump
-       org = (self.absmin + self.absmax) * 0.5;
-       org_z = self.absmax.z - STAT(PL_MIN, NULL).z;
+       org = (this.absmin + this.absmax) * 0.5;
+       org_z = this.absmax.z - STAT(PL_MIN, NULL).z;
 
-       if (self.target)
+       if (this.target)
        {
                float n = 0;
-               for(t = world; (t = find(t, targetname, self.target)); )
+               for(t = world; (t = find(t, targetname, this.target)); )
                {
                        ++n;
 #ifdef SVQC
                        entity e = spawn();
                        setorigin(e, org);
                        setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
-                       e.velocity = trigger_push_calculatevelocity(org, t, self.height);
+                       e.velocity = trigger_push_calculatevelocity(org, t, this.height);
                        tracetoss(e, e);
                        if(e.movetype == MOVETYPE_NONE)
-                               waypoint_spawnforteleporter(self, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
+                               waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
                        remove(e);
 #endif
                }
@@ -314,12 +314,12 @@ void trigger_push_findtarget()
                else if(n == 1)
                {
                        // exactly one dest - bots love that
-                       self.enemy = find(world, targetname, self.target);
+                       this.enemy = find(world, targetname, this.target);
                }
                else
                {
                        // have to use random selection every single time
-                       self.enemy = world;
+                       this.enemy = world;
                }
        }
 #ifdef SVQC
@@ -328,14 +328,14 @@ void trigger_push_findtarget()
                entity e = spawn();
                setorigin(e, org);
                setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
-               e.velocity = self.movedir;
+               e.velocity = this.movedir;
                tracetoss(e, e);
-               waypoint_spawnforteleporter(self, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
+               waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
                remove(e);
        }
 
        trigger_push_link();
-       defer(self, 0.1, trigger_push_updatelink);
+       defer(this, 0.1, trigger_push_updatelink);
 #endif
 }
 
@@ -344,25 +344,25 @@ float trigger_push_send(entity this, entity to, float sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TRIGGER_PUSH);
 
-       WriteByte(MSG_ENTITY, self.team);
-       WriteInt24_t(MSG_ENTITY, self.spawnflags);
-       WriteByte(MSG_ENTITY, self.active);
-       WriteCoord(MSG_ENTITY, self.height);
+       WriteByte(MSG_ENTITY, this.team);
+       WriteInt24_t(MSG_ENTITY, this.spawnflags);
+       WriteByte(MSG_ENTITY, this.active);
+       WriteCoord(MSG_ENTITY, this.height);
 
-       trigger_common_write(self, true);
+       trigger_common_write(this, true);
 
        return true;
 }
 
 void trigger_push_updatelink()
 {SELFPARAM();
-       self.SendFlags |= 1;
+       this.SendFlags |= 1;
 }
 
 void trigger_push_link()
 {
     SELFPARAM();
-       trigger_link(self, trigger_push_send);
+       trigger_link(this, trigger_push_send);
 }
 
 /*
@@ -379,25 +379,25 @@ void trigger_push_link()
  */
 spawnfunc(trigger_push)
 {
-       SetMovedir(self);
+       SetMovedir(this);
 
-       trigger_init(self);
+       trigger_init(this);
 
-       self.active = ACTIVE_ACTIVE;
-       self.use = trigger_push_use;
-       self.touch = trigger_push_touch;
+       this.active = ACTIVE_ACTIVE;
+       this.use = trigger_push_use;
+       this.touch = trigger_push_touch;
 
        // normal push setup
-       if (!self.speed)
-               self.speed = 1000;
-       self.movedir = self.movedir * self.speed * 10;
+       if (!this.speed)
+               this.speed = 1000;
+       this.movedir = this.movedir * this.speed * 10;
 
-       if (!self.noise)
-               self.noise = "misc/jumppad.wav";
-       precache_sound (self.noise);
+       if (!this.noise)
+               this.noise = "misc/jumppad.wav";
+       precache_sound (this.noise);
 
        // this must be called to spawn the teleport waypoints for bots
-       InitializeEntity(self, trigger_push_findtarget, INITPRIO_FINDTARGET);
+       InitializeEntity(this, trigger_push_findtarget, INITPRIO_FINDTARGET);
 }
 
 
@@ -405,15 +405,15 @@ bool target_push_send(entity this, entity to, float sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TARGET_PUSH);
 
-       WriteByte(MSG_ENTITY, self.cnt);
-       WriteString(MSG_ENTITY, self.targetname);
-       WriteCoord(MSG_ENTITY, self.origin_x);
-       WriteCoord(MSG_ENTITY, self.origin_y);
-       WriteCoord(MSG_ENTITY, self.origin_z);
+       WriteByte(MSG_ENTITY, this.cnt);
+       WriteString(MSG_ENTITY, this.targetname);
+       WriteCoord(MSG_ENTITY, this.origin_x);
+       WriteCoord(MSG_ENTITY, this.origin_y);
+       WriteCoord(MSG_ENTITY, this.origin_z);
 
-       WriteAngle(MSG_ENTITY, self.angles_x);
-       WriteAngle(MSG_ENTITY, self.angles_y);
-       WriteAngle(MSG_ENTITY, self.angles_z);
+       WriteAngle(MSG_ENTITY, this.angles_x);
+       WriteAngle(MSG_ENTITY, this.angles_y);
+       WriteAngle(MSG_ENTITY, this.angles_z);
 
        return true;
 }
@@ -442,21 +442,21 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
 {
        make_pure(this);
 
-       self.classname = "jumppad";
-       int mytm = ReadByte(); if(mytm) { self.team = mytm - 1; }
-       self.spawnflags = ReadInt24_t();
-       self.active = ReadByte();
-       self.height = ReadCoord();
+       this.classname = "jumppad";
+       int mytm = ReadByte(); if(mytm) { this.team = mytm - 1; }
+       this.spawnflags = ReadInt24_t();
+       this.active = ReadByte();
+       this.height = ReadCoord();
 
        trigger_common_read(true);
 
-       self.entremove = trigger_remove_generic;
-       self.solid = SOLID_TRIGGER;
-       //self.draw = trigger_draw_generic;
-       self.move_touch = trigger_push_touch;
-       self.drawmask = MASK_NORMAL;
-       self.move_time = time;
-       defer(self, 0.25, trigger_push_findtarget);
+       this.entremove = trigger_remove_generic;
+       this.solid = SOLID_TRIGGER;
+       //this.draw = trigger_draw_generic;
+       this.move_touch = trigger_push_touch;
+       this.drawmask = MASK_NORMAL;
+       this.move_time = time;
+       defer(this, 0.25, trigger_push_findtarget);
 
        return true;
 }
@@ -474,22 +474,22 @@ void target_push_remove(entity this)
 
 NET_HANDLE(ENT_CLIENT_TARGET_PUSH, bool isnew)
 {
-       self.classname = "push_target";
-       self.cnt = ReadByte();
-       self.targetname = strzone(ReadString());
-       self.origin_x = ReadCoord();
-       self.origin_y = ReadCoord();
-       self.origin_z = ReadCoord();
+       this.classname = "push_target";
+       this.cnt = ReadByte();
+       this.targetname = strzone(ReadString());
+       this.origin_x = ReadCoord();
+       this.origin_y = ReadCoord();
+       this.origin_z = ReadCoord();
 
-       self.angles_x = ReadAngle();
-       self.angles_y = ReadAngle();
-       self.angles_z = ReadAngle();
+       this.angles_x = ReadAngle();
+       this.angles_y = ReadAngle();
+       this.angles_z = ReadAngle();
 
        return = true;
 
-       setorigin(self, self.origin);
+       setorigin(this, this.origin);
 
-       self.drawmask = MASK_NORMAL;
-       self.entremove = target_push_remove;
+       this.drawmask = MASK_NORMAL;
+       this.entremove = target_push_remove;
 }
 #endif
index b9d3aeb96e9081a7eab274bfb5cc535896c55088..3f0a4b27fef60d5058fba15f2298da394ae14950 100644 (file)
@@ -111,7 +111,7 @@ void multi_eventdamage(entity this, entity inflictor, entity attacker, float dam
        {
                this.enemy = attacker;
                this.goalentity = inflictor;
-               WITH(entity, self, this, multi_trigger());
+               WITHSELF(this, multi_trigger());
        }
 }
 
index 9be241e7f49e2c0b56b8ca50740334abb24b5ed2..f94cd00ad9680e5b61b203c2c2b4e9eeaa10c3eb 100644 (file)
@@ -10,8 +10,8 @@
 
 void secrets_setstatus()
 {SELFPARAM();
-       self.stat_secrets_total = secrets_total;
-       self.stat_secrets_found = secrets_found;
+       this.stat_secrets_total = secrets_total;
+       this.stat_secrets_found = secrets_found;
 }
 
 /**
index be8040079b91f36670492816498228debff65bfa..92ae805b5259641dd9e8cb3bd174b5df9b642a3e 100644 (file)
@@ -54,7 +54,7 @@ void Teleport_Touch ()
        SUB_UseTargets();
        if (!self.target) self.target = s;
 
-       WITH(entity, self, e, SUB_UseTargets());
+       WITHSELF(e, SUB_UseTargets());
 #endif
 }
 
index 29cb70a7dcc935990309119f1acf2e403806ff18..1ca03fd4fefc819113b7b6aaae62ba1c9009d8aa 100644 (file)
@@ -4,9 +4,9 @@ void() SUB_UseTargets;
 
 void DelayThink()
 {SELFPARAM();
-       activator = self.enemy;
+       activator = this.enemy;
        SUB_UseTargets ();
-       remove(self);
+       remove(this);
 }
 
 void FixSize(entity e)
@@ -25,7 +25,7 @@ void FixSize(entity e)
 void trigger_init(entity this)
 {
        string m = this.model;
-       WITH(entity, self, this, WarpZoneLib_ExactTrigger_Init());
+       WITHSELF(this, WarpZoneLib_ExactTrigger_Init());
        if(m != "")
        {
                precache_model(m);
@@ -96,51 +96,51 @@ void trigger_common_write(entity this, bool withtarget)
 void trigger_common_read(bool withtarget)
 {SELFPARAM();
        int f = ReadByte();
-       self.warpzone_isboxy = (f & 1);
+       this.warpzone_isboxy = (f & 1);
 
        if(withtarget)
        {
-               if(self.target) { strunzone(self.target); }
-               self.target = strzone(ReadString());
-               if(self.target2) { strunzone(self.target2); }
-               self.target2 = strzone(ReadString());
-               if(self.target3) { strunzone(self.target3); }
-               self.target3 = strzone(ReadString());
-               if(self.target4) { strunzone(self.target4); }
-               self.target4 = strzone(ReadString());
-               if(self.targetname) { strunzone(self.targetname); }
-               self.targetname = strzone(ReadString());
-               if(self.killtarget) { strunzone(self.killtarget); }
-               self.killtarget = strzone(ReadString());
+               if(this.target) { strunzone(this.target); }
+               this.target = strzone(ReadString());
+               if(this.target2) { strunzone(this.target2); }
+               this.target2 = strzone(ReadString());
+               if(this.target3) { strunzone(this.target3); }
+               this.target3 = strzone(ReadString());
+               if(this.target4) { strunzone(this.target4); }
+               this.target4 = strzone(ReadString());
+               if(this.targetname) { strunzone(this.targetname); }
+               this.targetname = strzone(ReadString());
+               if(this.killtarget) { strunzone(this.killtarget); }
+               this.killtarget = strzone(ReadString());
        }
 
        if(f & 4)
        {
-               self.origin_x = ReadCoord();
-               self.origin_y = ReadCoord();
-               self.origin_z = ReadCoord();
+               this.origin_x = ReadCoord();
+               this.origin_y = ReadCoord();
+               this.origin_z = ReadCoord();
        }
        else
-               self.origin = '0 0 0';
-       setorigin(self, self.origin);
-
-       self.modelindex = ReadShort();
-       self.mins_x = ReadCoord();
-       self.mins_y = ReadCoord();
-       self.mins_z = ReadCoord();
-       self.maxs_x = ReadCoord();
-       self.maxs_y = ReadCoord();
-       self.maxs_z = ReadCoord();
-       self.scale = ReadByte() / 16;
-       setsize(self, self.mins, self.maxs);
-
-       self.movedir_x = ReadCoord();
-       self.movedir_y = ReadCoord();
-       self.movedir_z = ReadCoord();
-
-       self.angles_x = ReadCoord();
-       self.angles_y = ReadCoord();
-       self.angles_z = ReadCoord();
+               this.origin = '0 0 0';
+       setorigin(this, this.origin);
+
+       this.modelindex = ReadShort();
+       this.mins_x = ReadCoord();
+       this.mins_y = ReadCoord();
+       this.mins_z = ReadCoord();
+       this.maxs_x = ReadCoord();
+       this.maxs_y = ReadCoord();
+       this.maxs_z = ReadCoord();
+       this.scale = ReadByte() / 16;
+       setsize(this, this.mins, this.maxs);
+
+       this.movedir_x = ReadCoord();
+       this.movedir_y = ReadCoord();
+       this.movedir_z = ReadCoord();
+
+       this.angles_x = ReadCoord();
+       this.angles_y = ReadCoord();
+       this.angles_z = ReadCoord();
 }
 
 void trigger_remove_generic(entity this)
@@ -193,19 +193,19 @@ void SUB_UseTargets()
 //
 // check for a delay
 //
-       if (self.delay)
+       if (this.delay)
        {
        // create a temp object to fire at a later time
                t = new(DelayedUse);
-               t.nextthink = time + self.delay;
+               t.nextthink = time + this.delay;
                t.think = DelayThink;
                t.enemy = activator;
-               t.message = self.message;
-               t.killtarget = self.killtarget;
-               t.target = self.target;
-               t.target2 = self.target2;
-               t.target3 = self.target3;
-               t.target4 = self.target4;
+               t.message = this.message;
+               t.killtarget = this.killtarget;
+               t.target = this.target;
+               t.target2 = this.target2;
+               t.target3 = this.target3;
+               t.target4 = this.target4;
                return;
        }
 
@@ -214,19 +214,19 @@ void SUB_UseTargets()
 // print the message
 //
 #ifdef SVQC
-       if(self)
-       if(IS_PLAYER(activator) && self.message != "")
+       if(this)
+       if(IS_PLAYER(activator) && this.message != "")
        if(IS_REAL_CLIENT(activator))
        {
-               centerprint(activator, self.message);
-               if (self.noise == "")
+               centerprint(activator, this.message);
+               if (this.noise == "")
                        play2(activator, SND(TALK));
        }
 
 //
 // kill the killtagets
 //
-       s = self.killtarget;
+       s = this.killtarget;
        if (s != "")
        {
                for(t = world; (t = find(t, targetname, s)); )
@@ -257,7 +257,7 @@ void SUB_UseTargets()
                {
                        // Flag to set func_clientwall state
                        // 1 == deactivate, 2 == activate, 0 == do nothing
-                       float aw_flag = self.antiwall_flag;
+                       float aw_flag = this.antiwall_flag;
                        for(t = world; (t = find(t, targetname, s)); )
                        if(t.use)
                        {
@@ -308,7 +308,7 @@ void trigger_touch_generic(entity this, void() touchfunc)
                if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, e)) // accurate
                {
                        other = e;
-                       WITH(entity, self, this, touchfunc());
+                       WITHSELF(this, touchfunc());
                }
        }
 }
diff --git a/qcsrc/common/turrets/_mod.inc b/qcsrc/common/turrets/_mod.inc
new file mode 100644 (file)
index 0000000..552a805
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "all.qc"
+#include "checkpoint.qc"
+#include "cl_turrets.qc"
+#include "config.qc"
+#include "sv_turrets.qc"
+#include "targettrigger.qc"
+#include "util.qc"
diff --git a/qcsrc/common/turrets/all.inc b/qcsrc/common/turrets/all.inc
deleted file mode 100644 (file)
index 5c9f1e1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "turret/ewheel.qc"
-#include "turret/flac.qc"
-#include "turret/fusionreactor.qc"
-#include "turret/hellion.qc"
-#include "turret/hk.qc"
-#include "turret/machinegun.qc"
-#include "turret/mlrs.qc"
-#include "turret/phaser.qc"
-#include "turret/plasma.qc"
-#include "turret/plasma_dual.qc"
-#include "turret/tesla.qc"
-#include "turret/walker.qc"
index 2d40f17d01eb3037eb201451905bde4cf0b6bd7f..469a64c9274b240758ebd40eeeb8d4f19576d767 100644 (file)
@@ -7,7 +7,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_TURRET)
 #endif
 
 #define IMPLEMENTATION
-#include "all.inc"
+#include "turret/_mod.inc"
 #undef IMPLEMENTATION
 
 #ifdef CSQC
index 16bfacf3c8caf64439f68c08ea2936914f1c66c6..a993b9218a22cf77ae2df4f80870d2115b3b9fde 100644 (file)
@@ -74,6 +74,6 @@ const int TUR_FIRST = 1;
 
 REGISTER_TURRET(Null, NEW(Turret));
 
-#include "all.inc"
+#include "turret/_mod.inc"
 
 #endif
index 853c3cb924af5757b03357d608b0b801fad7f4ca..1502be25114f1ddfb5bf90192c796d9f37d2febb 100644 (file)
@@ -455,7 +455,7 @@ void turret_projectile_damage(entity this, entity inflictor, entity attacker, fl
        this.health     -= damage;
        //this.realowner = attacker; // Dont change realowner, it does not make much sense for turrets
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(this.owner, turret_projectile_explode));
+               WITHSELF(this, W_PrepareExplosionByDamage(this.owner, turret_projectile_explode));
 }
 
 entity turret_projectile(Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim)
diff --git a/qcsrc/common/turrets/turret/_mod.inc b/qcsrc/common/turrets/turret/_mod.inc
new file mode 100644 (file)
index 0000000..3673214
--- /dev/null
@@ -0,0 +1,23 @@
+// generated file; do not modify
+#include "ewheel.qc"
+#include "ewheel_weapon.qc"
+#include "flac.qc"
+#include "flac_weapon.qc"
+#include "fusionreactor.qc"
+#include "hellion.qc"
+#include "hellion_weapon.qc"
+#include "hk.qc"
+#include "hk_weapon.qc"
+#include "machinegun.qc"
+#include "machinegun_weapon.qc"
+#include "mlrs.qc"
+#include "mlrs_weapon.qc"
+#include "phaser.qc"
+#include "phaser_weapon.qc"
+#include "plasma.qc"
+#include "plasma_dual.qc"
+#include "plasma_weapon.qc"
+#include "tesla.qc"
+#include "tesla_weapon.qc"
+#include "walker.qc"
+#include "walker_weapon.qc"
index 2a537d4e98fdc889f94ebb10ad1b2c1873637925..798e141ecd2e5caa4e12765eee020ab8830a0f6c 100644 (file)
@@ -3,7 +3,7 @@
 
 //#define EWHEEL_FANCYPATH
 
-#include "ewheel_weapon.qc"
+#include "ewheel_weapon.qh"
 
 CLASS(EWheel, Turret)
 /* spawnflags */ ATTRIB(EWheel, spawnflags, int, TUR_FLAG_PLAYER | TUR_FLAG_MOVE | TUR_FLAG_ROAM);
@@ -22,8 +22,6 @@ REGISTER_TURRET(EWHEEL, NEW(EWheel));
 
 #ifdef IMPLEMENTATION
 
-#include "ewheel_weapon.qc"
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_ewheel_speed_fast;
index 8f25a7c0832ef57d68abbe2df189504ffa61bb6f..50212458f22ef14b41e37dd1230c824a2f1590a1 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_EWHEEL_WEAPON_H
-#define TURRET_EWHEEL_WEAPON_H
-
-CLASS(EWheelAttack, PortoLaunch)
-/* flags     */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(EWheelAttack, impulse, int, 5);
-/* refname   */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel");
-/* wepname   */ ATTRIB(EWheelAttack, m_name, string, _("eWheel"));
-ENDCLASS(EWheelAttack)
-REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
-
-#endif
+#include "ewheel_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/ewheel_weapon.qh b/qcsrc/common/turrets/turret/ewheel_weapon.qh
new file mode 100644 (file)
index 0000000..974a32c
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(EWheelAttack, PortoLaunch)
+/* flags     */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(EWheelAttack, impulse, int, 5);
+/* refname   */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel");
+/* wepname   */ ATTRIB(EWheelAttack, m_name, string, _("eWheel"));
+ENDCLASS(EWheelAttack)
+REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
index faaf89ffc0348ed7816ec11ca6a996c4ad07cfaa..6bd6a3ff1462389ec9eb65649826614722e7470a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_FLAC_H
 #define TURRET_FLAC_H
 
-#include "flac_weapon.qc"
+#include "flac_weapon.qh"
 
 CLASS(Flac, Turret)
 /* spawnflags */ ATTRIB(Flac, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_MISSILE);
@@ -20,8 +20,6 @@ REGISTER_TURRET(FLAC, NEW(Flac));
 
 #ifdef IMPLEMENTATION
 
-#include "flac_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_flac) { if (!turret_initialize(TUR_FLAC)) remove(self); }
index 85eccb6e15f8ed1d4115729e92de9bf8e6f85793..175fa7617ffdc24812da3130256d2fc7561dadfe 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_FLAC_WEAPON_H
-#define TURRET_FLAC_WEAPON_H
-
-CLASS(FlacAttack, PortoLaunch)
-/* flags     */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(FlacAttack, impulse, int, 5);
-/* refname   */ ATTRIB(FlacAttack, netname, string, "turret_flac");
-/* wepname   */ ATTRIB(FlacAttack, m_name, string, _("FLAC"));
-ENDCLASS(FlacAttack)
-REGISTER_WEAPON(FLAC, NEW(FlacAttack));
-
-#endif
+#include "flac_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/flac_weapon.qh b/qcsrc/common/turrets/turret/flac_weapon.qh
new file mode 100644 (file)
index 0000000..7857f2f
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(FlacAttack, PortoLaunch)
+/* flags     */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(FlacAttack, impulse, int, 5);
+/* refname   */ ATTRIB(FlacAttack, netname, string, "turret_flac");
+/* wepname   */ ATTRIB(FlacAttack, m_name, string, _("FLAC"));
+ENDCLASS(FlacAttack)
+REGISTER_WEAPON(FLAC, NEW(FlacAttack));
index 3eec587b20790403d207ee0df9b3b9f7f3ed635b..ef279f7611fd767cbdcc2e289489b91edf68579b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_HELLION_H
 #define TURRET_HELLION_H
 
-#include "hellion_weapon.qc"
+#include "hellion_weapon.qh"
 
 CLASS(Hellion, Turret)
 /* spawnflags */ ATTRIB(Hellion, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE);
@@ -20,8 +20,6 @@ REGISTER_TURRET(HELLION, NEW(Hellion));
 
 #ifdef IMPLEMENTATION
 
-#include "hellion_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_hellion) { if (!turret_initialize(TUR_HELLION)) remove(self); }
index 99029cd1ef75c22e2de7df64f49b940f49901a78..7df79c8c7e03d41f1c1fc214047b51b8abac9674 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_HELLION_WEAPON_H
-#define TURRET_HELLION_WEAPON_H
-
-CLASS(HellionAttack, PortoLaunch)
-/* flags     */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(HellionAttack, impulse, int, 9);
-/* refname   */ ATTRIB(HellionAttack, netname, string, "turret_hellion");
-/* wepname   */ ATTRIB(HellionAttack, m_name, string, _("Hellion"));
-ENDCLASS(HellionAttack)
-REGISTER_WEAPON(HELLION, NEW(HellionAttack));
-
-#endif
+#include "hellion_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qh b/qcsrc/common/turrets/turret/hellion_weapon.qh
new file mode 100644 (file)
index 0000000..88ac336
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(HellionAttack, PortoLaunch)
+/* flags     */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(HellionAttack, impulse, int, 9);
+/* refname   */ ATTRIB(HellionAttack, netname, string, "turret_hellion");
+/* wepname   */ ATTRIB(HellionAttack, m_name, string, _("Hellion"));
+ENDCLASS(HellionAttack)
+REGISTER_WEAPON(HELLION, NEW(HellionAttack));
index a1a7e096dd1b0b02a4d37bf4ded097339f23327a..4e7b4513818e1b0e264e080fdf23a44361541bf6 100644 (file)
@@ -3,7 +3,7 @@
 
 //#define TURRET_DEBUG_HK
 
-#include "hk_weapon.qc"
+#include "hk_weapon.qh"
 
 CLASS(HunterKiller, Turret)
 /* spawnflags */ ATTRIB(HunterKiller, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER | TUR_FLAG_RECIEVETARGETS);
@@ -22,8 +22,6 @@ REGISTER_TURRET(HK, NEW(HunterKiller));
 
 #ifdef IMPLEMENTATION
 
-#include "hk_weapon.qc"
-
 #ifdef SVQC
 
 #ifdef TURRET_DEBUG_HK
index 91d138ee0de23c6d2765c1b997fb4652136cd6dc..319a579cf2bac4d537e4d2c497f329f75bd2d409 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_HK_WEAPON_H
-#define TURRET_HK_WEAPON_H
-
-CLASS(HunterKillerAttack, PortoLaunch)
-/* flags     */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(HunterKillerAttack, impulse, int, 9);
-/* refname   */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk");
-/* wepname   */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer"));
-ENDCLASS(HunterKillerAttack)
-REGISTER_WEAPON(HK, NEW(HunterKillerAttack));
-
-#endif
+#include "hk_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/hk_weapon.qh b/qcsrc/common/turrets/turret/hk_weapon.qh
new file mode 100644 (file)
index 0000000..87e0c88
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(HunterKillerAttack, PortoLaunch)
+/* flags     */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(HunterKillerAttack, impulse, int, 9);
+/* refname   */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk");
+/* wepname   */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer"));
+ENDCLASS(HunterKillerAttack)
+REGISTER_WEAPON(HK, NEW(HunterKillerAttack));
index 61f256d7acbb4eb41568dcb8843a16bda569d390..e919026570af16da0598a4dbb9dbaff79b2473ac 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_MACHINEGUN_H
 #define TURRET_MACHINEGUN_H
 
-#include "machinegun_weapon.qc"
+#include "machinegun_weapon.qh"
 
 CLASS(MachineGunTurret, Turret)
 /* spawnflags */ ATTRIB(MachineGunTurret, spawnflags, int, TUR_FLAG_PLAYER);
@@ -20,8 +20,6 @@ REGISTER_TURRET(MACHINEGUN, NEW(MachineGunTurret));
 
 #ifdef IMPLEMENTATION
 
-#include "machinegun_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_machinegun) { if (!turret_initialize(TUR_MACHINEGUN)) remove(self); }
index 29c1c1ae96e2168f80a0619f0968ced3db4bf887..853750f6caf7fd839b3a7d4e50d4d38ec0b23440 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_MACHINEGUN_WEAPON_H
-#define TURRET_MACHINEGUN_WEAPON_H
-
-CLASS(MachineGunTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(MachineGunTurretAttack, impulse, int, 9);
-/* refname   */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun");
-/* wepname   */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun"));
-ENDCLASS(MachineGunTurretAttack)
-REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
-
-#endif
+#include "machinegun_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
@@ -30,7 +19,7 @@ METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, .ent
             actor.tur_head = actor;
             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
         }
-        fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, 0);
+        fireBullet (actor, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, 0);
         W_MachineGun_MuzzleFlash();
         setattachment(actor.muzzle_flash, actor.tur_head, "tag_fire");
     }
diff --git a/qcsrc/common/turrets/turret/machinegun_weapon.qh b/qcsrc/common/turrets/turret/machinegun_weapon.qh
new file mode 100644 (file)
index 0000000..30163bc
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(MachineGunTurretAttack, PortoLaunch)
+/* flags     */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(MachineGunTurretAttack, impulse, int, 9);
+/* refname   */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun");
+/* wepname   */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun"));
+ENDCLASS(MachineGunTurretAttack)
+REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
index c5f6865cc90c0357de7dee9228fd61391a7fdce4..43710b6c02f91e6b82ee5eb220b8a41874484d6a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_MLRS_H
 #define TURRET_MLRS_H
 
-#include "mlrs_weapon.qc"
+#include "mlrs_weapon.qh"
 
 CLASS(MLRSTurret, Turret)
 /* spawnflags */ ATTRIB(MLRSTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
@@ -20,8 +20,6 @@ REGISTER_TURRET(MLRS, NEW(MLRSTurret));
 
 #ifdef IMPLEMENTATION
 
-#include "mlrs_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_mlrs) { if (!turret_initialize(TUR_MLRS)) remove(self); }
index 592657d857fe77fe82deddd391679f33463ff41e..2f8dd65e9f48fae08d4c6e53a704cc95bb4365dd 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_MLRS_WEAPON_H
-#define TURRET_MLRS_WEAPON_H
-
-CLASS(MLRSTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(MLRSTurretAttack, impulse, int, 9);
-/* refname   */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs");
-/* wepname   */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS"));
-ENDCLASS(MLRSTurretAttack)
-REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
-
-#endif
+#include "mlrs_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/mlrs_weapon.qh b/qcsrc/common/turrets/turret/mlrs_weapon.qh
new file mode 100644 (file)
index 0000000..c583842
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(MLRSTurretAttack, PortoLaunch)
+/* flags     */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(MLRSTurretAttack, impulse, int, 9);
+/* refname   */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs");
+/* wepname   */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS"));
+ENDCLASS(MLRSTurretAttack)
+REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
index 5c973c65aef92dc531329a1cd426a03b677df22f..e4c0c119a434af41591fd94a3527a06a35af226a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_PHASER_H
 #define TURRET_PHASER_H
 
-#include "phaser_weapon.qc"
+#include "phaser_weapon.qh"
 
 CLASS(PhaserTurret, Turret)
 /* spawnflags */ ATTRIB(PhaserTurret, spawnflags, int, TUR_FLAG_SNIPER | TUR_FLAG_HITSCAN | TUR_FLAG_PLAYER);
@@ -20,12 +20,12 @@ REGISTER_TURRET(PHASER, NEW(PhaserTurret));
 
 #ifdef IMPLEMENTATION
 
-#include "phaser_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_phaser) { if (!turret_initialize(TUR_PHASER)) remove(self); }
 
+.int fireflag;
+
 METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
 {
     SELFPARAM();
index a82f949adefe04441a8e44dbde0afddf654bc213..440bdf6a7299a6271363f3968b03a55d258d0db5 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_PHASER_WEAPON_H
-#define TURRET_PHASER_WEAPON_H
-
-CLASS(PhaserTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(PhaserTurretAttack, impulse, int, 9);
-/* refname   */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser");
-/* wepname   */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser"));
-ENDCLASS(PhaserTurretAttack)
-REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
-
-#endif
+#include "phaser_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qh b/qcsrc/common/turrets/turret/phaser_weapon.qh
new file mode 100644 (file)
index 0000000..326a90e
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(PhaserTurretAttack, PortoLaunch)
+/* flags     */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(PhaserTurretAttack, impulse, int, 9);
+/* refname   */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser");
+/* wepname   */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser"));
+ENDCLASS(PhaserTurretAttack)
+REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
index 4982bff56c33ddac1de6541bbdf79b8d5738058b..5b2fd0f35fc363602e0abb9d20e2437385b94401 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_PLASMA_H
 #define TURRET_PLASMA_H
 
-#include "plasma_weapon.qc"
+#include "plasma_weapon.qh"
 
 CLASS(PlasmaTurret, Turret)
 /* spawnflags */ ATTRIB(PlasmaTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
@@ -20,8 +20,6 @@ REGISTER_TURRET(PLASMA, NEW(PlasmaTurret));
 
 #ifdef IMPLEMENTATION
 
-#include "plasma_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_plasma) { if (!turret_initialize(TUR_PLASMA)) remove(self); }
index 1518a3008e6d78813838c31013a2032e9b1977fb..55226bd864d47f87d92c9caa3fa819bb6b5a7cc9 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef TURRET_PLASMA_DUAL_H
 #define TURRET_PLASMA_DUAL_H
 
+#include "plasma_weapon.qh"
+
 CLASS(PlasmaDualAttack, PlasmaAttack)
 /* refname   */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual");
 /* wepname   */ ATTRIB(PlasmaDualAttack, m_name, string, _("Dual plasma"));
index eef648448731f5c474a0010afbfa3a85b7355c0c..0d61df550c45e9161900af00547f3bd1981b307a 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_PLASMA_WEAPON_H
-#define TURRET_PLASMA_WEAPON_H
-
-CLASS(PlasmaAttack, PortoLaunch)
-/* flags     */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(PlasmaAttack, impulse, int, 5);
-/* refname   */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
-/* wepname   */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma"));
-ENDCLASS(PlasmaAttack)
-REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
-
-#endif
+#include "plasma_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/plasma_weapon.qh b/qcsrc/common/turrets/turret/plasma_weapon.qh
new file mode 100644 (file)
index 0000000..5c73384
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(PlasmaAttack, PortoLaunch)
+/* flags     */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(PlasmaAttack, impulse, int, 5);
+/* refname   */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
+/* wepname   */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma"));
+ENDCLASS(PlasmaAttack)
+REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
index de45078a1ef90f4e4d21ba0ccbd65d7b306ff3f0..510331c637400fe19586cee4767fff7cffaabd81 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TURRET_TESLA_H
 #define TURRET_TESLA_H
 
-#include "tesla_weapon.qc"
+#include "tesla_weapon.qh"
 
 CLASS(TeslaCoil, Turret)
 /* spawnflags */ ATTRIB(TeslaCoil, spawnflags, int, TUR_FLAG_HITSCAN | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE);
@@ -20,8 +20,6 @@ REGISTER_TURRET(TESLA, NEW(TeslaCoil));
 
 #ifdef IMPLEMENTATION
 
-#include "tesla_weapon.qc"
-
 #ifdef SVQC
 
 spawnfunc(turret_tesla) { if (!turret_initialize(TUR_TESLA)) remove(self); }
index 1c0ed527240c348d13b96d8745d13aa9c7f682e1..a283a738f2c79c93737698d02d86ff849c7e52c6 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_TESLA_WEAPON_H
-#define TURRET_TESLA_WEAPON_H
-
-CLASS(TeslaCoilTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9);
-/* refname   */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla");
-/* wepname   */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil"));
-ENDCLASS(TeslaCoilTurretAttack)
-REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
-
-#endif
+#include "tesla_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qh b/qcsrc/common/turrets/turret/tesla_weapon.qh
new file mode 100644 (file)
index 0000000..7e3879b
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(TeslaCoilTurretAttack, PortoLaunch)
+/* flags     */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9);
+/* refname   */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla");
+/* wepname   */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil"));
+ENDCLASS(TeslaCoilTurretAttack)
+REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
index 9582f2d1f4176c4af84bd35d0a6fc58280561b54..491b5bbd920065c21d02b2fa61c8b0a27a5be559 100644 (file)
@@ -3,7 +3,7 @@
 
 //#define WALKER_FANCYPATHING
 
-#include "walker_weapon.qc"
+#include "walker_weapon.qh"
 
 CLASS(WalkerTurret, Turret)
 /* spawnflags */ ATTRIB(WalkerTurret, spawnflags, int, TUR_FLAG_PLAYER | TUR_FLAG_MOVE);
@@ -22,8 +22,6 @@ REGISTER_TURRET(WALKER, NEW(WalkerTurret));
 
 #ifdef IMPLEMENTATION
 
-#include "walker_weapon.qc"
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_walker_melee_damage;
@@ -111,7 +109,7 @@ void walker_rocket_damage(entity this, entity inflictor, entity attacker, float
     this.velocity = this.velocity + vforce;
 
     if (this.health <= 0)
-        WITH(entity, self, this, W_PrepareExplosionByDamage(this.owner, walker_rocket_explode));
+        WITHSELF(this, W_PrepareExplosionByDamage(this.owner, walker_rocket_explode));
 }
 
 #define WALKER_ROCKET_MOVE movelib_move_simple(self, newdir, (autocvar_g_turrets_unit_walker_rocket_speed), (autocvar_g_turrets_unit_walker_rocket_turnrate)); UpdateCSQCProjectile(self)
@@ -643,7 +641,7 @@ void walker_draw(entity this)
         return;
 
     fixedmakevectors(this.angles);
-    movelib_groundalign4point(300, 100, 0.25, 45);
+    movelib_groundalign4point(this, 300, 100, 0.25, 45);
     setorigin(this, this.origin + this.velocity * dt);
     this.tur_head.angles += dt * this.tur_head.move_avelocity;
     this.angles_y = this.move_angles_y;
index c1214758d27cdae0135b6234898023bf803d3bd2..91e4345a95b3f6c6c0e58f79dfe8d7b5198c5867 100644 (file)
@@ -1,15 +1,4 @@
-#ifndef TURRET_WALKER_WEAPON_H
-#define TURRET_WALKER_WEAPON_H
-
-CLASS(WalkerTurretAttack, PortoLaunch)
-/* flags     */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(WalkerTurretAttack, impulse, int, 5);
-/* refname   */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker");
-/* wepname   */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker"));
-ENDCLASS(WalkerTurretAttack)
-REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
-
-#endif
+#include "walker_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
@@ -29,7 +18,7 @@ METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
         sound (actor, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
-        fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
+        fireBullet (actor, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
         Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
     }
 }
diff --git a/qcsrc/common/turrets/turret/walker_weapon.qh b/qcsrc/common/turrets/turret/walker_weapon.qh
new file mode 100644 (file)
index 0000000..4e20785
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+CLASS(WalkerTurretAttack, PortoLaunch)
+/* flags     */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(WalkerTurretAttack, impulse, int, 5);
+/* refname   */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker");
+/* wepname   */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker"));
+ENDCLASS(WalkerTurretAttack)
+REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
diff --git a/qcsrc/common/vehicles/_mod.inc b/qcsrc/common/vehicles/_mod.inc
new file mode 100644 (file)
index 0000000..e80489b
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "all.qc"
+#include "cl_vehicles.qc"
+#include "sv_vehicles.qc"
diff --git a/qcsrc/common/vehicles/all.inc b/qcsrc/common/vehicles/all.inc
deleted file mode 100644 (file)
index e4c73a4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "vehicle/spiderbot.qc"
-#include "vehicle/raptor.qc"
-#include "vehicle/racer.qc"
-#ifndef VEHICLES_NO_UNSTABLE
-       #include "vehicle/bumblebee.qc"
-#endif
index 44178f92f8178486eee45abbe90c2fff72345544..251df22839e750646abef244455aa63d7e846df5 100644 (file)
@@ -12,7 +12,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_AUXILIARYXHAIR)
 #endif
 
 #define IMPLEMENTATION
-#include "all.inc"
+#include "vehicle/_mod.inc"
 #undef IMPLEMENTATION
 
 #endif
index f4e837f784694d841ca78b60c8a43d1c6d22990b..b58389d4abb7955feb7c3c80934583fadd4f6f1b 100644 (file)
@@ -11,7 +11,6 @@ REGISTRY_CHECK(Vehicles)
 const int VEH_FIRST = 1;
 #define VEH_LAST (Vehicles_COUNT - 1)
 
-/** If you register a new vehicle, make sure to add it to all.inc */
 #define REGISTER_VEHICLE(id, inst) REGISTER(Vehicles, VEH, id, vehicleid, inst)
 
 #if defined(SVQC)
@@ -22,6 +21,6 @@ const int VEH_FIRST = 1;
 
 REGISTER_VEHICLE(Null, NEW(Vehicle));
 
-#include "all.inc"
+#include "vehicle/_mod.inc"
 
 #endif
index 9a9b8b08bc3b6b2f43dafb2932ffe118c5ac8a41..e2187290d97910574b1b51a2537e2eefd42538ac 100644 (file)
@@ -304,6 +304,10 @@ void Vehicles_drawCrosshair(string crosshair)
                tmpPos.x = (vid_conwidth - tmpSize.x) / 2;
                tmpPos.y = (vid_conheight - tmpSize.y) / 2;
 
-               drawpic(tmpPos, crosshair, tmpSize, '1 1 1', autocvar_crosshair_alpha, DRAWFLAG_NORMAL);
+               vector wcross_color = '1 1 1';
+               if(autocvar_cl_vehicles_crosshair_colorize)
+                       wcross_color = crosshair_getcolor(NULL, STAT(VEHICLESTAT_HEALTH));
+
+               drawpic(tmpPos, crosshair, tmpSize, wcross_color, autocvar_crosshair_alpha, DRAWFLAG_NORMAL);
        }
 }
index 7e5bc93eb87abfdf7bff47b8404dd652cee62338..35b6c677f957de6fbfe84ee53ad28a78ce4aa3e7 100644 (file)
@@ -302,11 +302,11 @@ void vehicles_gib_think()
                self.nextthink = time + 0.1;
 }
 
-entity vehicle_tossgib(entity _template, vector _vel, string _tag, bool _burn, bool _explode, float _maxtime, vector _rot)
-{SELFPARAM();
+entity vehicle_tossgib(entity this, entity _template, vector _vel, string _tag, bool _burn, bool _explode, float _maxtime, vector _rot)
+{
        entity _gib = spawn();
        _setmodel(_gib, _template.model);
-       vector org = gettaginfo(self, gettagindex(self, _tag));
+       vector org = gettaginfo(this, gettagindex(this, _tag));
        setorigin(_gib, org);
        _gib.velocity = _vel;
        _gib.movetype = MOVETYPE_TOSS;
@@ -337,9 +337,9 @@ entity vehicle_tossgib(entity _template, vector _vel, string _tag, bool _burn, b
 bool vehicle_addplayerslot(    entity _owner,
                                                                entity _slot,
                                                                int _hud,
-                                                               string _hud_model,
+                                                               Model _hud_model,
                                                                bool(entity) _framefunc,
-                                                               void(bool) _exitfunc, float() _enterfunc)
+                                                               void(bool) _exitfunc, float(entity, entity) _enterfunc)
 {
        if(!(_owner.vehicle_flags & VHF_MULTISLOT))
                _owner.vehicle_flags |= VHF_MULTISLOT;
@@ -354,7 +354,7 @@ bool vehicle_addplayerslot( entity _owner,
        _slot.vehicle_hudmodel.viewmodelforclient = _slot;
        _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
 
-       _setmodel(_slot.vehicle_hudmodel, _hud_model);
+       setmodel(_slot.vehicle_hudmodel, _hud_model);
        setmodel(_slot.vehicle_viewport, MDL_Null);
 
        setattachment(_slot.vehicle_hudmodel, _slot, "");
@@ -381,62 +381,52 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string
        return vtag;
 }
 
-void vehicles_reset_colors()
-{SELFPARAM();
-       entity e;
-       float _effects = 0, _colormap;
-       vector _glowmod, _colormod;
-
+void vehicles_reset_colors(entity this)
+{
+       int eff = 0, cmap;
+       const vector cmod = '0 0 0';
+       if(this.team && teamplay)
+               cmap = 1024 + (this.team - 1) * 17;
+       else
+               cmap = 1024;
        if(autocvar_g_nodepthtestplayers)
-               _effects |= EF_NODEPTHTEST;
-
+               eff |= EF_NODEPTHTEST;
        if(autocvar_g_fullbrightplayers)
-               _effects |= EF_FULLBRIGHT;
-
-       if(self.team)
-               _colormap = 1024 + (self.team - 1) * 17;
-       else
-               _colormap = 1024;
-
-       _glowmod  = '0 0 0';
-       _colormod = '0 0 0';
+               eff |= EF_FULLBRIGHT;
 
        // Find all ents attacked to main model and setup effects, colormod etc.
-       e = findchainentity(tag_entity, self);
-       while(e)
+       FOREACH_ENTITY_ENT(tag_entity, this,
        {
-               if(e != self.vehicle_shieldent)
+               if(it != this.vehicle_shieldent)
                {
-                       e.effects   = _effects; //  | EF_LOWPRECISION;
-                       e.colormod  = _colormod;
-                       e.colormap  = _colormap;
-                       e.alpha  = 1;
+                       it.effects = eff;
+                       it.colormod = cmod;
+                       it.colormap = cmap;
+                       it.alpha = 1;
                }
-               e = e.chain;
-       }
+       });
+
        // Also check head tags
-       e = findchainentity(tag_entity, self.tur_head);
-       while(e)
+       FOREACH_ENTITY_ENT(tag_entity, this.tur_head,
        {
-               if(e != self.vehicle_shieldent)
+               if(it != this.vehicle_shieldent)
                {
-                       e.effects   = _effects; //  | EF_LOWPRECISION;
-                       e.colormod  = _colormod;
-                       e.colormap  = _colormap;
-                       e.alpha  = 1;
+                       it.effects = eff;
+                       it.colormod = cmod;
+                       it.colormap = cmap;
+                       it.alpha = 1;
                }
-               e = e.chain;
-       }
+       });
 
-       self.vehicle_hudmodel.effects  = self.effects  = _effects; // | EF_LOWPRECISION;
-       self.vehicle_hudmodel.colormod = self.colormod = _colormod;
-       self.vehicle_hudmodel.colormap = self.colormap = _colormap;
-       self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
+       this.vehicle_hudmodel.effects  = this.effects  = eff; // | EF_LOWPRECISION;
+       this.vehicle_hudmodel.colormod = this.colormod = cmod;
+       this.vehicle_hudmodel.colormap = this.colormap = cmap;
+       this.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
 
-       self.alpha       = 1;
-       self.avelocity = '0 0 0';
-       self.velocity  = '0 0 0';
-       self.effects   = _effects;
+       this.alpha       = 1;
+       this.avelocity = '0 0 0';
+       this.velocity  = '0 0 0';
+       this.effects   = eff;
 }
 
 void vehicles_clearreturn(entity veh)
@@ -573,7 +563,7 @@ void vehicle_use()
                else
                {
                        vehicles_setreturn(self);
-                       vehicles_reset_colors();
+                       vehicles_reset_colors(self);
                }
        }
 }
@@ -716,9 +706,9 @@ void vehicles_damage(entity this, entity inflictor, entity attacker, float damag
        {
                if(this.owner)
                        if(this.vehicle_flags & VHF_DEATHEJECT)
-                               WITH(entity, self, this, vehicles_exit(VHEF_EJECT));
+                               WITHSELF(this, vehicles_exit(VHEF_EJECT));
                        else
-                               WITH(entity, self, this, vehicles_exit(VHEF_RELEASE));
+                               WITHSELF(this, vehicles_exit(VHEF_RELEASE));
 
 
                antilag_clear(this, this);
@@ -740,21 +730,21 @@ float vehicles_crushable(entity e)
        return false;
 }
 
-void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
-{SELFPARAM();
+void vehicles_impact(entity this, float _minspeed, float _speedfac, float _maxpain)
+{
        if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
                return;
 
-       if(self.play_time < time)
+       if(this.play_time < time)
        {
-               float wc = vlen(self.velocity - self.oldvelocity);
-               //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
-               //dprint("vel: ", vtos(self.velocity), "\n");
+               float wc = vlen(this.velocity - this.oldvelocity);
+               //dprint("oldvel: ", vtos(this.oldvelocity), "\n");
+               //dprint("vel: ", vtos(this.velocity), "\n");
                if(_minspeed < wc)
                {
                        float take = min(_speedfac * wc, _maxpain);
-                       Damage (self, world, world, take, DEATH_FALL.m_id, self.origin, '0 0 0');
-                       self.play_time = time + 0.25;
+                       Damage (this, world, world, take, DEATH_FALL.m_id, this.origin, '0 0 0');
+                       this.play_time = time + 0.25;
 
                        //dprint("wc: ", ftos(wc), "\n");
                        //dprint("take: ", ftos(take), "\n");
@@ -901,7 +891,7 @@ void vehicles_exit(bool eject)
        _vehicle.vehicle_exit(eject);
 
        vehicles_setreturn(_vehicle);
-       vehicles_reset_colors();
+       vehicles_reset_colors(_vehicle);
        _vehicle.owner = world;
 
        CSQCMODEL_AUTOINIT(self);
@@ -962,7 +952,10 @@ bool vehicle_impulse(entity this, int imp)
 }
 
 void vehicles_enter(entity pl, entity veh)
-{SELFPARAM();
+{
+    SELFPARAM();
+       entity oldself = self;
+
    // Remove this when bots know how to use vehicles
        if((IS_BOT_CLIENT(pl) && !autocvar_g_vehicles_allow_bots))
                return;
@@ -979,28 +972,17 @@ void vehicles_enter(entity pl, entity veh)
        if(veh.vehicle_flags & VHF_MULTISLOT)
        if(veh.owner)
        {
-               setself(veh);
-               other = pl; // TODO: fix
-
                if(!veh.gunner1)
                if(time >= veh.gun1.phase)
                if(veh.gun1.vehicle_enter)
-               if(veh.gun1.vehicle_enter())
-               {
-                       setself(this);
+               if(veh.gun1.vehicle_enter(veh, pl))
                        return;
-               }
 
                if(!veh.gunner2)
                if(time >= veh.gun2.phase)
                if(veh.gun2.vehicle_enter)
-               if(veh.gun2.vehicle_enter())
-               {
-                       setself(this);
+               if(veh.gun2.vehicle_enter(veh, pl))
                        return;
-               }
-
-               setself(this);
        }
 
        if(teamplay)
@@ -1106,7 +1088,7 @@ void vehicles_enter(entity pl, entity veh)
        CSQCModel_UnlinkEntity(veh);
        Vehicle info = Vehicles_from(veh.vehicleid);
        info.vr_enter(info, veh);
-       setself(this);
+       setself(oldself);
 
        antilag_clear(pl, CS(pl));
 }
@@ -1167,7 +1149,7 @@ void vehicles_spawn()
 
        FOREACH_CLIENT(IS_PLAYER(it) && it.hook.aiment == self, RemoveGrapplingHook(it));
 
-       vehicles_reset_colors();
+       vehicles_reset_colors(self);
 
        Vehicle info = Vehicles_from(self.vehicleid);
        info.vr_spawn(info, self);
@@ -1175,121 +1157,118 @@ void vehicles_spawn()
        CSQCMODEL_AUTOINIT(self);
 }
 
-bool vehicle_initialize(entity veh, bool nodrop)
-{SELFPARAM();
+bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
+{
        if(!autocvar_g_vehicles)
                return false;
 
-       if(!veh.vehicleid)
+       if(!info.vehicleid)
                return false;
 
-       if(!veh.tur_head) {
-               Vehicle info = Vehicles_from(veh.vehicleid);
+       if(!this.tur_head)
                info.vr_precache(info);
-       }
 
-       if(self.targetname && self.targetname != "")
+       if(this.targetname && this.targetname != "")
        {
-               self.vehicle_controller = find(world, target, self.targetname);
-               if(!self.vehicle_controller)
+               this.vehicle_controller = find(world, target, this.targetname);
+               if(!this.vehicle_controller)
                {
                        bprint("^1WARNING: ^7Vehicle with invalid .targetname\n");
-                       self.active = ACTIVE_ACTIVE;
+                       this.active = ACTIVE_ACTIVE;
                }
                else
                {
-                       self.team = self.vehicle_controller.team;
-                       self.use = vehicle_use;
+                       this.team = this.vehicle_controller.team;
+                       this.use = vehicle_use;
 
                        if(teamplay)
                        {
-                               if(self.vehicle_controller.team == 0)
-                                       self.active = ACTIVE_NOT;
+                               if(this.vehicle_controller.team == 0)
+                                       this.active = ACTIVE_NOT;
                                else
-                                       self.active = ACTIVE_ACTIVE;
+                                       this.active = ACTIVE_ACTIVE;
                        }
                }
        }
-       else { self.active = ACTIVE_ACTIVE; }
+       else { this.active = ACTIVE_ACTIVE; }
 
-       if(self.team && (!teamplay || !autocvar_g_vehicles_teams))
-               self.team = 0;
+       if(this.team && (!teamplay || !autocvar_g_vehicles_teams))
+               this.team = 0;
 
-       if(self.mdl == "" || !self.mdl)
-               _setmodel(self, veh.model);
+       if(this.mdl == "" || !this.mdl)
+               _setmodel(this, info.model);
        else
-               _setmodel(self, self.mdl);
-
-       self.vehicle_flags |= VHF_ISVEHICLE;
-
-       self.vehicle_viewport           = new(vehicle_viewport);
-       self.vehicle_hudmodel           = new(vehicle_hudmodel);
-       self.tur_head                           = new(tur_head);
-       self.tur_head.owner                     = self;
-       self.takedamage                         = DAMAGE_NO;
-       self.bot_attack                         = true;
-       self.iscreature                         = true;
-       self.teleportable                       = false; // no teleporting for vehicles, too buggy
-       self.damagedbycontents          = true;
-       self.vehicleid                          = veh.vehicleid;
-       self.PlayerPhysplug                     = veh.PlayerPhysplug;
-       self.event_damage                       = func_null;
-       self.touch                                      = vehicles_touch;
-       self.think                                      = vehicles_spawn;
-       self.nextthink                          = time;
-       self.effects                            = EF_NODRAW;
-       self.dphitcontentsmask          = DPCONTENTS_BODY | DPCONTENTS_SOLID;
+               _setmodel(this, this.mdl);
+
+       this.vehicle_flags |= VHF_ISVEHICLE;
+
+       this.vehicle_viewport           = new(vehicle_viewport);
+       this.vehicle_hudmodel           = new(vehicle_hudmodel);
+       this.tur_head                           = new(tur_head);
+       this.tur_head.owner                     = this;
+       this.takedamage                         = DAMAGE_NO;
+       this.bot_attack                         = true;
+       this.iscreature                         = true;
+       this.teleportable                       = false; // no teleporting for vehicles, too buggy
+       this.damagedbycontents          = true;
+       this.vehicleid                          = info.vehicleid;
+       this.PlayerPhysplug                     = info.PlayerPhysplug;
+       this.event_damage                       = func_null;
+       this.touch                                      = vehicles_touch;
+       this.think                                      = vehicles_spawn;
+       this.nextthink                          = time;
+       this.effects                            = EF_NODRAW;
+       this.dphitcontentsmask          = DPCONTENTS_BODY | DPCONTENTS_SOLID;
 
        if(autocvar_g_playerclip_collisions)
-               self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
+               this.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
 
        if(autocvar_g_nodepthtestplayers)
-               self.effects |= EF_NODEPTHTEST;
+               this.effects |= EF_NODEPTHTEST;
 
        if(autocvar_g_fullbrightplayers)
-               self.effects |= EF_FULLBRIGHT;
+               this.effects |= EF_FULLBRIGHT;
 
-       _setmodel(self.vehicle_hudmodel, veh.hud_model);
-       setmodel(self.vehicle_viewport, MDL_Null);
+       _setmodel(this.vehicle_hudmodel, info.hud_model);
+       setmodel(this.vehicle_viewport, MDL_Null);
 
-       if(veh.head_model != "")
+       if(info.head_model != "")
        {
-               _setmodel(self.tur_head, veh.head_model);
-               setattachment(self.tur_head, self, veh.tag_head);
-               setattachment(self.vehicle_hudmodel, self.tur_head, veh.tag_hud);
-               setattachment(self.vehicle_viewport, self.vehicle_hudmodel, veh.tag_view);
+               _setmodel(this.tur_head, info.head_model);
+               setattachment(this.tur_head, this, info.tag_head);
+               setattachment(this.vehicle_hudmodel, this.tur_head, info.tag_hud);
+               setattachment(this.vehicle_viewport, this.vehicle_hudmodel, info.tag_view);
        }
        else
        {
-               setattachment(self.tur_head, self, "");
-               setattachment(self.vehicle_hudmodel, self, veh.tag_hud);
-               setattachment(self.vehicle_viewport, self.vehicle_hudmodel, veh.tag_view);
+               setattachment(this.tur_head, this, "");
+               setattachment(this.vehicle_hudmodel, this, info.tag_hud);
+               setattachment(this.vehicle_viewport, this.vehicle_hudmodel, info.tag_view);
        }
 
-       setsize(self, veh.mins, veh.maxs);
+       setsize(this, info.mins, info.maxs);
 
        if(!nodrop)
        {
-               setorigin(self, self.origin);
-               tracebox(self.origin + '0 0 100', veh.mins, veh.maxs, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
-               setorigin(self, trace_endpos);
+               setorigin(this, this.origin);
+               tracebox(this.origin + '0 0 100', info.mins, info.maxs, this.origin - '0 0 10000', MOVE_WORLDONLY, this);
+               setorigin(this, trace_endpos);
        }
 
-       self.pos1 = self.origin;
-       self.pos2 = self.angles;
-       self.tur_head.team = self.team;
+       this.pos1 = this.origin;
+       this.pos2 = this.angles;
+       this.tur_head.team = this.team;
 
-       Vehicle info = Vehicles_from(veh.vehicleid);
-       info.vr_setup(info, veh);
+       info.vr_setup(info, this);
 
-       if(self.active == ACTIVE_NOT)
-               self.nextthink = 0; // wait until activated
+       if(this.active == ACTIVE_NOT)
+               this.nextthink = 0; // wait until activated
        else if(autocvar_g_vehicles_delayspawn)
-               self.nextthink = time + self.respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter);
+               this.nextthink = time + this.respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter);
        else
-               self.nextthink = time + game_starttime;
+               this.nextthink = time + game_starttime;
 
-       if(MUTATOR_CALLHOOK(VehicleSpawn))
+       if(MUTATOR_CALLHOOK(VehicleSpawn, this))
                return false;
 
        return true;
index 06b91784bfb984afa84c14d62e46a63760dd244b..6cc322ef9ca610a8ead5dcd8543723d5a059aa4a 100644 (file)
@@ -3,6 +3,7 @@
 #ifdef SVQC
 
 #include <common/turrets/sv_turrets.qh>
+#include "vehicle.qh"
 
 // vehicle cvars
 bool autocvar_g_vehicles = true;
@@ -81,7 +82,7 @@ const float   DAMAGE_TARGETDRONE = 10;
 .bool(int _imp) vehicles_impulse;
 .int vehicle_weapon2mode = _STAT(VEHICLESTAT_W2MODE);
 .void(int exit_flags) vehicle_exit;
-.bool() vehicle_enter;
+.bool(entity this, entity player) vehicle_enter;
 const int VHEF_NORMAL = 0;  /// User pressed exit key
 const int VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
 const int VHEF_RELEASE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
@@ -99,7 +100,7 @@ float vehicles_exit_running;
 .float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
 
 void vehicles_exit(float eject);
-float vehicle_initialize(entity vehicle, float nodrop);
+bool vehicle_initialize(entity this, Vehicle info, float nodrop);
 bool vehicle_impulse(entity this, int imp);
 bool vehicles_crushable(entity e);
 
diff --git a/qcsrc/common/vehicles/vehicle/_mod.inc b/qcsrc/common/vehicles/vehicle/_mod.inc
new file mode 100644 (file)
index 0000000..fbead47
--- /dev/null
@@ -0,0 +1,9 @@
+// generated file; do not modify
+#include "bumblebee.qc"
+#include "bumblebee_weapons.qc"
+#include "racer.qc"
+#include "racer_weapon.qc"
+#include "raptor.qc"
+#include "raptor_weapons.qc"
+#include "spiderbot.qc"
+#include "spiderbot_weapons.qc"
index 115a83ba4add5f1e322f6f77e47a60131f1b4231..c3c0861e95ef257187904119fc0a3938a0e604ac 100644 (file)
@@ -2,7 +2,7 @@
 #define VEHICLE_BUMBLEBEE
 #include "bumblebee.qh"
 
-#include "bumblebee_weapons.qc"
+#include "bumblebee_weapons.qh"
 
 CLASS(Bumblebee, Vehicle)
 /* spawnflags */ ATTRIB(Bumblebee, spawnflags, int, VHF_DMGSHAKE);
@@ -23,6 +23,10 @@ CLASS(Bumblebee, Vehicle)
 ENDCLASS(Bumblebee)
 REGISTER_VEHICLE(BUMBLEBEE, NEW(Bumblebee));
 
+#ifndef MENUQC
+       MODEL(VEH_BUMBLEBEE_GUNCOCKPIT, "models/vehicles/wakizashi_cockpit.dpm");
+#endif
+
 #endif
 
 #ifdef IMPLEMENTATION
@@ -31,8 +35,6 @@ const float BRG_SETUP = 2;
 const float BRG_START = 4;
 const float BRG_END = 8;
 
-#include "bumblebee_weapons.qc"
-
 #ifdef SVQC
 float autocvar_g_vehicle_bumblebee_respawntime = 60;
 
@@ -287,10 +289,9 @@ void bumblebee_gunner_exit(int _exitflag)
        player.vehicle = world;
 }
 
-bool bumblebee_gunner_enter()
-{SELFPARAM();
-       entity vehic = self;
-       entity player = other;
+bool bumblebee_gunner_enter(entity this, entity player)
+{
+       entity vehic = this;
        entity gunner = world;
 
        if(!vehic.gunner1 && !vehic.gunner2 && ((time >= vehic.gun1.phase) + (time >= vehic.gun2.phase)) == 2)
@@ -383,7 +384,7 @@ void bumblebee_touch()
                float phase_time = (time >= self.gun1.phase) + (time >= self.gun2.phase);
 
                if(time >= other.vehicle_enter_delay && phase_time)
-               if(bumblebee_gunner_enter())
+               if(bumblebee_gunner_enter(self, other))
                        return;
        }
 
@@ -717,14 +718,14 @@ void bumblebee_diethink()
 
 spawnfunc(vehicle_bumblebee)
 {
-       if(!autocvar_g_vehicle_bumblebee) { remove(self); return; }
-       if(!vehicle_initialize(VEH_BUMBLEBEE, false)) { remove(self); return; }
+       if(!autocvar_g_vehicle_bumblebee) { remove(this); return; }
+       if(!vehicle_initialize(this, VEH_BUMBLEBEE, false)) { remove(this); return; }
 }
 
 METHOD(Bumblebee, vr_impact, void(Bumblebee thisveh, entity instance))
 {
     if(autocvar_g_vehicle_bumblebee_bouncepain)
-        vehicles_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z);
+        vehicles_impact(instance, autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z);
 }
 METHOD(Bumblebee, vr_enter, void(Bumblebee thisveh, entity instance))
 {
@@ -800,11 +801,11 @@ METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
     self.vehicle_exit(VHEF_EJECT);
 
     fixedmakevectors(self.angles);
-    vehicle_tossgib(self.gun1, self.velocity + v_right * 300 + v_up * 100 + randomvec() * 200, "cannon_right", rint(random()), rint(random()), 6, randomvec() * 200);
-    vehicle_tossgib(self.gun2, self.velocity + v_right * -300 + v_up * 100 + randomvec() * 200, "cannon_left", rint(random()), rint(random()), 6, randomvec() * 200);
-    vehicle_tossgib(self.gun3, self.velocity + v_forward * 300 + v_up * -100 + randomvec() * 200, "raygun", rint(random()), rint(random()), 6, randomvec() * 300);
+    vehicle_tossgib(instance, self.gun1, self.velocity + v_right * 300 + v_up * 100 + randomvec() * 200, "cannon_right", rint(random()), rint(random()), 6, randomvec() * 200);
+    vehicle_tossgib(instance, self.gun2, self.velocity + v_right * -300 + v_up * 100 + randomvec() * 200, "cannon_left", rint(random()), rint(random()), 6, randomvec() * 200);
+    vehicle_tossgib(instance, self.gun3, self.velocity + v_forward * 300 + v_up * -100 + randomvec() * 200, "raygun", rint(random()), rint(random()), 6, randomvec() * 300);
 
-    entity _body = vehicle_tossgib(self, self.velocity + randomvec() * 200, "", rint(random()), rint(random()), 6, randomvec() * 100);
+    entity _body = vehicle_tossgib(instance, self, self.velocity + randomvec() * 200, "", rint(random()), rint(random()), 6, randomvec() * 100);
 
     if(random() > 0.5)
         _body.touch = bumblebee_blowup;
@@ -880,8 +881,8 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
         setorigin(self.gun3, ofs);
         self.angles = self.gun3.pos1;
 
-        vehicle_addplayerslot(self, self.gun1, HUD_BUMBLEBEE_GUN, "models/vehicles/wakizashi_cockpit.dpm", bumblebee_gunner_frame, bumblebee_gunner_exit, bumblebee_gunner_enter);
-        vehicle_addplayerslot(self, self.gun2, HUD_BUMBLEBEE_GUN, "models/vehicles/wakizashi_cockpit.dpm", bumblebee_gunner_frame, bumblebee_gunner_exit, bumblebee_gunner_enter);
+        vehicle_addplayerslot(self, self.gun1, HUD_BUMBLEBEE_GUN, MDL_VEH_BUMBLEBEE_GUNCOCKPIT, bumblebee_gunner_frame, bumblebee_gunner_exit, bumblebee_gunner_enter);
+        vehicle_addplayerslot(self, self.gun2, HUD_BUMBLEBEE_GUN, MDL_VEH_BUMBLEBEE_GUNCOCKPIT, bumblebee_gunner_frame, bumblebee_gunner_exit, bumblebee_gunner_enter);
 
         setorigin(self.vehicle_hudmodel, '50 0 -5');    // Move cockpit forward - down.
         setorigin(self.vehicle_viewport, '5 0 2');    // Move camera forward up
@@ -918,25 +919,24 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
 }
 METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
 {
-    SELFPARAM();
     if(autocvar_g_vehicle_bumblebee_energy)
     if(autocvar_g_vehicle_bumblebee_energy_regen)
-        self.vehicle_flags |= VHF_ENERGYREGEN;
+        instance.vehicle_flags |= VHF_ENERGYREGEN;
 
     if(autocvar_g_vehicle_bumblebee_shield)
-        self.vehicle_flags |= VHF_HASSHIELD;
+        instance.vehicle_flags |= VHF_HASSHIELD;
 
     if(autocvar_g_vehicle_bumblebee_shield_regen)
-        self.vehicle_flags |= VHF_SHIELDREGEN;
+        instance.vehicle_flags |= VHF_SHIELDREGEN;
 
     if(autocvar_g_vehicle_bumblebee_health_regen)
-        self.vehicle_flags |= VHF_HEALTHREGEN;
+        instance.vehicle_flags |= VHF_HEALTHREGEN;
 
-    self.vehicle_exit = bumblebee_exit;
-    self.respawntime = autocvar_g_vehicle_bumblebee_respawntime;
-    self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
-    self.max_health = self.vehicle_health;
-    self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
+    instance.vehicle_exit = bumblebee_exit;
+    instance.respawntime = autocvar_g_vehicle_bumblebee_respawntime;
+    instance.vehicle_health = autocvar_g_vehicle_bumblebee_health;
+    instance.max_health = instance.vehicle_health;
+    instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
 }
 
 #endif // SVQC
index b043038921460bb2768aca34238932a49352e566..37dfaef1d9c8599ba644f9fbe9093f5db9680c06 100644 (file)
@@ -6,4 +6,8 @@
 void CSQC_BUMBLE_GUN_HUD();
 #endif
 
+#ifdef SVQC
+float raptor_altitude(float amax);
+#endif
+
 #endif
index f6ae848586ce8d5b58d340212d4697285222b307..00b796dda059a9bd7905b88c5f39d364de8ac2c8 100644 (file)
@@ -1,9 +1,4 @@
-#ifndef VEHICLE_BUMBLEBEE_WEAPONS_H
-#define VEHICLE_BUMBLEBEE_WEAPONS_H
-
-#include <common/weapons/all.qh>
-
-#endif
+#include "bumblebee_weapons.qh"
 
 #ifdef IMPLEMENTATION
 
@@ -11,16 +6,6 @@ REGISTER_NET_LINKED(ENT_CLIENT_BUMBLE_RAYGUN)
 
 #ifdef SVQC
 
-float autocvar_g_vehicle_bumblebee_cannon_cost = 2;
-float autocvar_g_vehicle_bumblebee_cannon_damage = 60;
-float autocvar_g_vehicle_bumblebee_cannon_radius = 225;
-float autocvar_g_vehicle_bumblebee_cannon_refire = 0.2;
-float autocvar_g_vehicle_bumblebee_cannon_speed = 20000;
-float autocvar_g_vehicle_bumblebee_cannon_spread = 0.02;
-float autocvar_g_vehicle_bumblebee_cannon_force = -35;
-
-bool bumble_raygun_send(entity this, entity to, int sf);
-
 void bumblebee_fire_cannon(entity this, entity _gun, string _tagname, entity _owner)
 {
     vector v = gettaginfo(_gun, gettagindex(_gun, _tagname));
diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh
new file mode 100644 (file)
index 0000000..73fed55
--- /dev/null
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <common/weapons/all.qh>
+
+float autocvar_g_vehicle_bumblebee_cannon_cost = 2;
+float autocvar_g_vehicle_bumblebee_cannon_damage = 60;
+float autocvar_g_vehicle_bumblebee_cannon_radius = 225;
+float autocvar_g_vehicle_bumblebee_cannon_refire = 0.2;
+float autocvar_g_vehicle_bumblebee_cannon_speed = 20000;
+float autocvar_g_vehicle_bumblebee_cannon_spread = 0.02;
+float autocvar_g_vehicle_bumblebee_cannon_force = -35;
+
+#ifdef SVQC
+void bumblebee_fire_cannon(entity this, entity _gun, string _tagname, entity _owner);
+bool bumble_raygun_send(entity this, entity to, int sf);
+#endif
index 7ec82cc67265ab6cc6bbc2e56b8c88912d5fe46e..da259784f64a5c7c45a2bfe5192571b49b96a3d8 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VEHICLE_RACER
 #define VEHICLE_RACER
 
-#include "racer_weapon.qc"
+#include "racer_weapon.qh"
 
 CLASS(Racer, Vehicle)
 /* spawnflags */ ATTRIB(Racer, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
@@ -26,8 +26,6 @@ REGISTER_VEHICLE(RACER, NEW(Racer));
 
 #ifdef IMPLEMENTATION
 
-#include "racer_weapon.qc"
-
 #ifdef SVQC
 #include <common/triggers/trigger/impulse.qh>
 
@@ -311,6 +309,8 @@ bool racer_frame(entity this)
        this.movement = vehic.velocity += df * PHYS_INPUT_TIMELENGTH;
 
 #ifdef SVQC
+       setself(vehic);
+
        Weapon wep1 = WEP_RACER;
        if (!forbidWeaponUse(this))
        if (PHYS_INPUT_BUTTON_ATCK(this))
@@ -329,6 +329,8 @@ bool racer_frame(entity this)
                wep1.wr_think(wep1, vehic, weaponentity, 1);
        }
 
+       setself(this);
+
        if(autocvar_g_vehicle_racer_rocket_locktarget)
        {
                vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime,
@@ -517,8 +519,8 @@ void racer_deadtouch()
 
 spawnfunc(vehicle_racer)
 {
-       if(!autocvar_g_vehicle_racer) { remove(self); return; }
-       if(!vehicle_initialize(VEH_RACER, false)) { remove(self); return; }
+       if(!autocvar_g_vehicle_racer) { remove(this); return; }
+       if(!vehicle_initialize(this, VEH_RACER, false)) { remove(this); return; }
 }
 
 #endif // SVQC
@@ -562,7 +564,7 @@ METHOD(Racer, vr_impact, void(Racer thisveh, entity instance))
 {
 #ifdef SVQC
     if(autocvar_g_vehicle_racer_bouncepain)
-        vehicles_impact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
+        vehicles_impact(instance, autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
 #endif
 }
 
@@ -667,29 +669,26 @@ METHOD(Racer, vr_crosshair, void(Racer thisveh))
 METHOD(Racer, vr_setup, void(Racer thisveh, entity instance))
 {
 #ifdef SVQC
-    SELFPARAM();
-    self.vehicle_exit = racer_exit;
-#endif
+    instance.vehicle_exit = racer_exit;
 
-#ifdef SVQC
     // we have no need to network energy
     if(autocvar_g_vehicle_racer_energy)
     if(autocvar_g_vehicle_racer_energy_regen)
-        self.vehicle_flags |= VHF_ENERGYREGEN;
+        instance.vehicle_flags |= VHF_ENERGYREGEN;
 
     if(autocvar_g_vehicle_racer_shield)
-        self.vehicle_flags |= VHF_HASSHIELD;
+        instance.vehicle_flags |= VHF_HASSHIELD;
 
     if(autocvar_g_vehicle_racer_shield_regen)
-        self.vehicle_flags |= VHF_SHIELDREGEN;
+        instance.vehicle_flags |= VHF_SHIELDREGEN;
 
     if(autocvar_g_vehicle_racer_health_regen)
-        self.vehicle_flags |= VHF_HEALTHREGEN;
+        instance.vehicle_flags |= VHF_HEALTHREGEN;
 
-    self.respawntime = autocvar_g_vehicle_racer_respawntime;
-    self.vehicle_health = autocvar_g_vehicle_racer_health;
-    self.vehicle_shield = autocvar_g_vehicle_racer_shield;
-    self.max_health = self.vehicle_health;
+    instance.respawntime = autocvar_g_vehicle_racer_respawntime;
+    instance.vehicle_health = autocvar_g_vehicle_racer_health;
+    instance.vehicle_shield = autocvar_g_vehicle_racer_shield;
+    instance.max_health = instance.vehicle_health;
 #endif
 
 #ifdef CSQC
index 9d8a830530cb0d26b77865744b35c6a4eb563c7b..ee86a622974ef0bff1fc37826730ff1978a69565 100644 (file)
@@ -1,46 +1,9 @@
-#ifndef VEHICLE_RACER_WEAPON_H
-#define VEHICLE_RACER_WEAPON_H
-
-#include <common/weapons/all.qh>
-
-CLASS(RacerAttack, PortoLaunch)
-/* flags     */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(RacerAttack, impulse, int, 3);
-/* refname   */ ATTRIB(RacerAttack, netname, string, "racercannon");
-/* wepname   */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon"));
-ENDCLASS(RacerAttack)
-REGISTER_WEAPON(RACER, NEW(RacerAttack));
-
-// TODO: move into implementation
-#ifdef SVQC
-void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
-#endif
-
-#endif
+#include "racer_weapon.qh"
 
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
 
-float autocvar_g_vehicle_racer_cannon_cost = 2;
-float autocvar_g_vehicle_racer_cannon_damage = 15;
-float autocvar_g_vehicle_racer_cannon_radius = 100;
-float autocvar_g_vehicle_racer_cannon_refire = 0.05;
-float autocvar_g_vehicle_racer_cannon_speed = 15000;
-float autocvar_g_vehicle_racer_cannon_spread = 0.0125;
-float autocvar_g_vehicle_racer_cannon_force = 50;
-
-float autocvar_g_vehicle_racer_rocket_accel = 1600;
-float autocvar_g_vehicle_racer_rocket_damage = 100;
-float autocvar_g_vehicle_racer_rocket_radius = 125;
-float autocvar_g_vehicle_racer_rocket_force = 350;
-float autocvar_g_vehicle_racer_rocket_speed = 900;
-float autocvar_g_vehicle_racer_rocket_turnrate = 0.2;
-float autocvar_g_vehicle_racer_rocket_refire = 3;
-
-float autocvar_g_vehicle_racer_rocket_climbspeed = 1600;
-float autocvar_g_vehicle_racer_rocket_locked_maxangle = 1.8;
-
 void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
 METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qh b/qcsrc/common/vehicles/vehicle/racer_weapon.qh
new file mode 100644 (file)
index 0000000..fc9e352
--- /dev/null
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <common/weapons/all.qh>
+
+CLASS(RacerAttack, PortoLaunch)
+/* flags     */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(RacerAttack, impulse, int, 3);
+/* refname   */ ATTRIB(RacerAttack, netname, string, "racercannon");
+/* wepname   */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon"));
+ENDCLASS(RacerAttack)
+REGISTER_WEAPON(RACER, NEW(RacerAttack));
+
+// TODO: move into implementation
+#ifdef SVQC
+void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
+#endif
+
+float autocvar_g_vehicle_racer_cannon_cost = 2;
+float autocvar_g_vehicle_racer_cannon_damage = 15;
+float autocvar_g_vehicle_racer_cannon_radius = 100;
+float autocvar_g_vehicle_racer_cannon_refire = 0.05;
+float autocvar_g_vehicle_racer_cannon_speed = 15000;
+float autocvar_g_vehicle_racer_cannon_spread = 0.0125;
+float autocvar_g_vehicle_racer_cannon_force = 50;
+
+float autocvar_g_vehicle_racer_rocket_accel = 1600;
+float autocvar_g_vehicle_racer_rocket_damage = 100;
+float autocvar_g_vehicle_racer_rocket_radius = 125;
+float autocvar_g_vehicle_racer_rocket_force = 350;
+float autocvar_g_vehicle_racer_rocket_speed = 900;
+float autocvar_g_vehicle_racer_rocket_turnrate = 0.2;
+float autocvar_g_vehicle_racer_rocket_refire = 3;
+
+float autocvar_g_vehicle_racer_rocket_climbspeed = 1600;
+float autocvar_g_vehicle_racer_rocket_locked_maxangle = 1.8;
index beb0e74c8b9382082078e668f14f9dd11ff04317..8b2f9e01b89a7160ade80bf7d2a90f5ac992d5c4 100644 (file)
@@ -2,7 +2,7 @@
 #define VEHICLE_RAPTOR
 #include "raptor.qh"
 
-#include "raptor_weapons.qc"
+#include "raptor_weapons.qh"
 
 CLASS(Raptor, Vehicle)
 /* spawnflags */ ATTRIB(Raptor, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
@@ -27,8 +27,6 @@ REGISTER_VEHICLE(RAPTOR, NEW(Raptor));
 
 #ifdef IMPLEMENTATION
 
-#include "raptor_weapons.qc"
-
 #ifdef SVQC
 
 bool autocvar_g_vehicle_raptor = true;
@@ -202,7 +200,7 @@ bool raptor_frame(entity this)
        if(IS_DEAD(vehic))
        {
                PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
-               return 1;
+               return;
        }
        crosshair_trace(this);
 
@@ -387,6 +385,9 @@ bool raptor_frame(entity this)
        UpdateAuxiliaryXhair(this, trace_endpos, '0 1 0', 0);
        */
 
+       // TODO: fix wr_checkammo and its use of self!
+       setself(vehic);
+
        Weapon wep1 = WEP_RAPTOR;
        if(!forbidWeaponUse(this))
        if(PHYS_INPUT_BUTTON_ATCK(this))
@@ -431,27 +432,32 @@ bool raptor_frame(entity this)
                }
        }
 
+       setself(this);
+
        vehic.bomb1.alpha = vehic.bomb2.alpha = (time - vehic.lip) / (vehic.delay - vehic.lip);
        this.vehicle_reload2 = bound(0, vehic.bomb1.alpha * 100, 100);
        this.vehicle_ammo2 = (this.vehicle_reload2 == 100) ? 100 : 0;
 
        if(vehic.bomb1.cnt < time)
        {
-               entity _missile = findchainentity(enemy, vehic);
-               float _incomming = 0;
-               while(_missile)
+               bool incoming = false;
+               FOREACH_ENTITY_ENT(enemy, vehic,
                {
-                       if(_missile.flags & FL_PROJECTILE)
-                       if(MISSILE_IS_TRACKING(_missile))
-                       if(vdist(vehic.origin - _missile.origin, <, 2 * autocvar_g_vehicle_raptor_flare_range))
-                               ++_incomming;
+                       if(it.flags & FL_PROJECTILE)
+                       if(MISSILE_IS_TRACKING(it))
+                       if(vdist(vehic.origin - it.origin, <, 2 * autocvar_g_vehicle_raptor_flare_range))
+                       {
+                               incoming = true;
+                               break;
+                       }
+               });
 
-                       _missile = _missile.chain;
+               if(incoming)
+               {
+                       msg_entity = this;
+                       soundto(MSG_ONE, vehic, CH_PAIN_SINGLE, SND(VEH_MISSILE_ALARM), VOL_BASE, ATTEN_NONE);
                }
 
-               if(_incomming)
-                       sound(vehic, CH_PAIN_SINGLE, SND_VEH_MISSILE_ALARM, VOL_BASE, ATTEN_NONE);
-
                vehic.bomb1.cnt = time + 1;
        }
 
@@ -602,14 +608,14 @@ float raptor_impulse(float _imp)
 
 spawnfunc(vehicle_raptor)
 {
-       if(!autocvar_g_vehicle_raptor) { remove(self); return; }
-       if(!vehicle_initialize(VEH_RAPTOR, false)) { remove(self); return; }
+       if(!autocvar_g_vehicle_raptor) { remove(this); return; }
+       if(!vehicle_initialize(this, VEH_RAPTOR, false)) { remove(this); return; }
 }
 
 METHOD(Raptor, vr_impact, void(Raptor thisveh, entity instance))
 {
     if(autocvar_g_vehicle_raptor_bouncepain)
-        vehicles_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
+        vehicles_impact(instance, autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
 }
 METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance))
 {
@@ -747,24 +753,23 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance))
 }
 METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance))
 {
-    SELFPARAM();
     if(autocvar_g_vehicle_raptor_shield)
-        self.vehicle_flags |= VHF_HASSHIELD;
+        instance.vehicle_flags |= VHF_HASSHIELD;
 
     if(autocvar_g_vehicle_raptor_shield_regen)
-        self.vehicle_flags |= VHF_SHIELDREGEN;
+        instance.vehicle_flags |= VHF_SHIELDREGEN;
 
     if(autocvar_g_vehicle_raptor_health_regen)
-        self.vehicle_flags |= VHF_HEALTHREGEN;
+        instance.vehicle_flags |= VHF_HEALTHREGEN;
 
     if(autocvar_g_vehicle_raptor_energy_regen)
-        self.vehicle_flags |= VHF_ENERGYREGEN;
+        instance.vehicle_flags |= VHF_ENERGYREGEN;
 
-    self.vehicle_exit = raptor_exit;
-    self.respawntime = autocvar_g_vehicle_raptor_respawntime;
-    self.vehicle_health = autocvar_g_vehicle_raptor_health;
-    self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
-    self.max_health = self.vehicle_health;
+    instance.vehicle_exit = raptor_exit;
+    instance.respawntime = autocvar_g_vehicle_raptor_respawntime;
+    instance.vehicle_health = autocvar_g_vehicle_raptor_health;
+    instance.vehicle_shield = autocvar_g_vehicle_raptor_shield;
+    instance.max_health = instance.vehicle_health;
 }
 
 #endif
index eda7d026fed3a2f004b333bc7c8238f8338349ce..c51fa154f7925155680db346c788409e6e02c9b0 100644 (file)
@@ -1,56 +1,9 @@
-#ifndef VEHICLE_RAPTOR_WEAPONS_H
-#define VEHICLE_RAPTOR_WEAPONS_H
-
-#include <common/weapons/all.qh>
-
-CLASS(RaptorCannon, PortoLaunch)
-/* flags     */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(RaptorCannon, impulse, int, 3);
-/* refname   */ ATTRIB(RaptorCannon, netname, string, "raptorcannon");
-/* wepname   */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon"));
-ENDCLASS(RaptorCannon)
-REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon));
-
-CLASS(RaptorBomb, PortoLaunch)
-/* flags     */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(RaptorBomb, impulse, int, 3);
-/* refname   */ ATTRIB(RaptorBomb, netname, string, "raptorbomb");
-/* wepname   */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb"));
-ENDCLASS(RaptorBomb)
-REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb));
-
-CLASS(RaptorFlare, PortoLaunch)
-/* flags     */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse   */ ATTRIB(RaptorFlare, impulse, int, 3);
-/* refname   */ ATTRIB(RaptorFlare, netname, string, "raptorflare");
-/* wepname   */ ATTRIB(RaptorFlare, m_name, string, _("Raptor flare"));
-ENDCLASS(RaptorFlare)
-REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare));
-
-#endif
+#include "raptor_weapons.qh"
 
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
 
-float autocvar_g_vehicle_raptor_cannon_cost = 1;
-float autocvar_g_vehicle_raptor_cannon_damage = 10;
-float autocvar_g_vehicle_raptor_cannon_radius = 60;
-float autocvar_g_vehicle_raptor_cannon_refire = 0.03;
-float autocvar_g_vehicle_raptor_cannon_speed = 24000;
-float autocvar_g_vehicle_raptor_cannon_spread = 0.01;
-float autocvar_g_vehicle_raptor_cannon_force = 25;
-
-float autocvar_g_vehicle_raptor_bomblets = 8;
-float autocvar_g_vehicle_raptor_bomblet_alt = 750;
-float autocvar_g_vehicle_raptor_bomblet_time = 0.5;
-float autocvar_g_vehicle_raptor_bomblet_damage = 55;
-float autocvar_g_vehicle_raptor_bomblet_spread = 0.4;
-float autocvar_g_vehicle_raptor_bomblet_edgedamage = 25;
-float autocvar_g_vehicle_raptor_bomblet_radius = 350;
-float autocvar_g_vehicle_raptor_bomblet_force = 150;
-float autocvar_g_vehicle_raptor_bomblet_explode_delay = 0.4;
-
 METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     entity player = isPlayer ? actor : actor.owner;
@@ -85,7 +38,6 @@ METHOD(RaptorCannon, wr_checkammo1, bool(RacerAttack thiswep)) {
     return isPlayer || veh.vehicle_energy >= autocvar_g_vehicle_raptor_cannon_cost;
 }
 
-float autocvar_g_vehicle_raptor_bombs_refire = 5;
 
 void raptor_bombdrop();
 METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
@@ -100,11 +52,6 @@ METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, .entity weaponen
     }
 }
 
-float autocvar_g_vehicle_raptor_flare_refire = 5;
-float autocvar_g_vehicle_raptor_flare_lifetime = 10;
-float autocvar_g_vehicle_raptor_flare_chase = 0.9;
-float autocvar_g_vehicle_raptor_flare_range = 2000;
-
 void raptor_flare_think();
 void raptor_flare_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 void raptor_flare_touch();
diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh
new file mode 100644 (file)
index 0000000..0b3af41
--- /dev/null
@@ -0,0 +1,53 @@
+#pragma once
+
+#include <common/weapons/all.qh>
+
+CLASS(RaptorCannon, PortoLaunch)
+/* flags     */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(RaptorCannon, impulse, int, 3);
+/* refname   */ ATTRIB(RaptorCannon, netname, string, "raptorcannon");
+/* wepname   */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon"));
+ENDCLASS(RaptorCannon)
+REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon));
+
+CLASS(RaptorBomb, PortoLaunch)
+/* flags     */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(RaptorBomb, impulse, int, 3);
+/* refname   */ ATTRIB(RaptorBomb, netname, string, "raptorbomb");
+/* wepname   */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb"));
+ENDCLASS(RaptorBomb)
+REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb));
+
+CLASS(RaptorFlare, PortoLaunch)
+/* flags     */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse   */ ATTRIB(RaptorFlare, impulse, int, 3);
+/* refname   */ ATTRIB(RaptorFlare, netname, string, "raptorflare");
+/* wepname   */ ATTRIB(RaptorFlare, m_name, string, _("Raptor flare"));
+ENDCLASS(RaptorFlare)
+REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare));
+
+
+float autocvar_g_vehicle_raptor_cannon_cost = 1;
+float autocvar_g_vehicle_raptor_cannon_damage = 10;
+float autocvar_g_vehicle_raptor_cannon_radius = 60;
+float autocvar_g_vehicle_raptor_cannon_refire = 0.03;
+float autocvar_g_vehicle_raptor_cannon_speed = 24000;
+float autocvar_g_vehicle_raptor_cannon_spread = 0.01;
+float autocvar_g_vehicle_raptor_cannon_force = 25;
+
+float autocvar_g_vehicle_raptor_bomblets = 8;
+float autocvar_g_vehicle_raptor_bomblet_alt = 750;
+float autocvar_g_vehicle_raptor_bomblet_time = 0.5;
+float autocvar_g_vehicle_raptor_bomblet_damage = 55;
+float autocvar_g_vehicle_raptor_bomblet_spread = 0.4;
+float autocvar_g_vehicle_raptor_bomblet_edgedamage = 25;
+float autocvar_g_vehicle_raptor_bomblet_radius = 350;
+float autocvar_g_vehicle_raptor_bomblet_force = 150;
+float autocvar_g_vehicle_raptor_bomblet_explode_delay = 0.4;
+
+float autocvar_g_vehicle_raptor_bombs_refire = 5;
+
+float autocvar_g_vehicle_raptor_flare_refire = 5;
+float autocvar_g_vehicle_raptor_flare_lifetime = 10;
+float autocvar_g_vehicle_raptor_flare_chase = 0.9;
+float autocvar_g_vehicle_raptor_flare_range = 2000;
index fa2f6f9ccafd1837b4406332a271999bf5f49ff4..57f1310c4b8cf618f21b8f12b2f2ba39aa13e7a4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VEHICLE_SPIDERBOT
 #define VEHICLE_SPIDERBOT
 
-#include "spiderbot_weapons.qc"
+#include "spiderbot_weapons.qh"
 
 CLASS(Spiderbot, Vehicle)
 /* spawnflags */ ATTRIB(Spiderbot, spawnflags, int, VHF_DMGSHAKE);
@@ -33,8 +33,6 @@ const int SBRM_GUIDE = 2;
 const int SBRM_ARTILLERY = 3;
 const int SBRM_LAST = 3;
 
-#include "spiderbot_weapons.qc"
-
 #ifdef SVQC
 bool autocvar_g_vehicle_spiderbot = true;
 
@@ -77,8 +75,8 @@ bool spiderbot_frame(entity this)
 
        if(intermission_running)
        {
-               self.vehicle.velocity = '0 0 0';
-               self.vehicle.avelocity = '0 0 0';
+               vehic.velocity = '0 0 0';
+               vehic.avelocity = '0 0 0';
                return;
        }
 
@@ -130,7 +128,7 @@ bool spiderbot_frame(entity this)
        //fixedmakevectors(vehic.angles);
        makevectors(vehic.angles + '-2 0 0' * vehic.angles_x);
 
-       WITH(entity, self, vehic, movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit));
+       movelib_groundalign4point(vehic, autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
 
        if(IS_ONGROUND(vehic))
                vehic.jump_delay = time; // reset now so movement can begin
@@ -286,8 +284,8 @@ bool spiderbot_frame(entity this)
                        v_forward = normalize(v_forward);
                        v += v_forward * 50;
 
-                       WITH(entity, self, this, fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
-                               autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0));
+                       fireBullet(this, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
+                               autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
 
                        sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
                        //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
@@ -311,7 +309,7 @@ bool spiderbot_frame(entity this)
                                                                                   autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, false);
 
 
-       WITH(entity, self, vehic, spiderbot_rocket_do());
+       spiderbot_rocket_do(vehic);
 
        if(vehic.vehicle_flags  & VHF_SHIELDREGEN)
                vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, true);
@@ -538,14 +536,14 @@ bool spiderbot_impulse(int _imp)
 
 spawnfunc(vehicle_spiderbot)
 {
-       if(!autocvar_g_vehicle_spiderbot) { remove(self); return; }
-       if(!vehicle_initialize(VEH_SPIDERBOT, false)) { remove(self); return; }
+       if(!autocvar_g_vehicle_spiderbot) { remove(this); return; }
+       if(!vehicle_initialize(this, VEH_SPIDERBOT, false)) { remove(this); return; }
 }
 
 METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh, entity instance))
 {
     if(autocvar_g_vehicle_spiderbot_bouncepain)
-        vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
+        vehicles_impact(instance, autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
 }
 METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance))
 {
@@ -620,21 +618,20 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
 }
 METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
 {
-    SELFPARAM();
     if(autocvar_g_vehicle_spiderbot_shield)
-        self.vehicle_flags |= VHF_HASSHIELD;
+        instance.vehicle_flags |= VHF_HASSHIELD;
 
     if(autocvar_g_vehicle_spiderbot_shield_regen)
-        self.vehicle_flags |= VHF_SHIELDREGEN;
+        instance.vehicle_flags |= VHF_SHIELDREGEN;
 
     if(autocvar_g_vehicle_spiderbot_health_regen)
-        self.vehicle_flags |= VHF_HEALTHREGEN;
+        instance.vehicle_flags |= VHF_HEALTHREGEN;
 
-    self.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
-    self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
-    self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
-    self.max_health = self.vehicle_health;
-    self.pushable = true; // spiderbot can use jumppads
+    instance.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
+    instance.vehicle_health = autocvar_g_vehicle_spiderbot_health;
+    instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
+    instance.max_health = instance.vehicle_health;
+    instance.pushable = true; // spiderbot can use jumppads
 }
 
 #endif // SVQC
index 38817b15b758339d29f034bf014bed71475591ca..afa57de2dad1f0fa328520996595a4892b716b0d 100644 (file)
@@ -1,39 +1,9 @@
-#ifndef VEHICLE_SPIDERBOT_WEAPONS_H
-#define VEHICLE_SPIDERBOT_WEAPONS_H
-
-#include <common/weapons/all.qh>
-
-#endif
+#include "spiderbot_weapons.qh"
 
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
 
-// 400 (x2) DPS
-float autocvar_g_vehicle_spiderbot_minigun_damage = 24;
-float autocvar_g_vehicle_spiderbot_minigun_refire = 0.06;
-float autocvar_g_vehicle_spiderbot_minigun_spread = 0.015;
-int autocvar_g_vehicle_spiderbot_minigun_ammo_cost = 1;
-int autocvar_g_vehicle_spiderbot_minigun_ammo_max = 100;
-int autocvar_g_vehicle_spiderbot_minigun_ammo_regen = 40;
-float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause = 1;
-float autocvar_g_vehicle_spiderbot_minigun_force = 9;
-float autocvar_g_vehicle_spiderbot_minigun_solidpenetration = 32;
-
-float autocvar_g_vehicle_spiderbot_rocket_damage = 50;
-float autocvar_g_vehicle_spiderbot_rocket_force = 150;
-float autocvar_g_vehicle_spiderbot_rocket_radius = 250;
-float autocvar_g_vehicle_spiderbot_rocket_speed = 3500;
-float autocvar_g_vehicle_spiderbot_rocket_spread = 0.05;
-float autocvar_g_vehicle_spiderbot_rocket_refire = 0.1;
-// volley
-float autocvar_g_vehicle_spiderbot_rocket_refire2 = 0.025;
-float autocvar_g_vehicle_spiderbot_rocket_reload = 4;
-float autocvar_g_vehicle_spiderbot_rocket_health = 100;
-float autocvar_g_vehicle_spiderbot_rocket_noise = 0.2;
-float autocvar_g_vehicle_spiderbot_rocket_turnrate = 0.25;
-float autocvar_g_vehicle_spiderbot_rocket_lifetime = 20;
-
 void spiderbot_rocket_artillery()
 {SELFPARAM();
     self.nextthink = time;
@@ -76,14 +46,14 @@ void spiderbot_rocket_guided()
         self.use();
 }
 
-void spiderbot_guide_release()
-{SELFPARAM();
+void spiderbot_guide_release(entity this)
+{
     entity rkt;
-    rkt = findchainentity(realowner, self.owner);
+    rkt = findchainentity(realowner, this.owner);
     if(!rkt)
         return;
 
-    crosshair_trace(self.owner);
+    crosshair_trace(this.owner);
     while(rkt)
     {
         if(rkt.think == spiderbot_rocket_guided)
@@ -169,74 +139,74 @@ vector spiberbot_calcartillery(vector org, vector tgt, float ht)
     return sdir * vs + '0 0 1' * vz;
 }
 
-void spiderbot_rocket_do()
-{SELFPARAM();
+void spiderbot_rocket_do(entity this)
+{;
     vector v;
     entity rocket = world;
 
-    if (self.wait != -10)
+    if (this.wait != -10)
     {
-        if (PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.vehicle_weapon2mode == SBRM_GUIDE)
+        if (PHYS_INPUT_BUTTON_ATCK2(this.owner) && this.vehicle_weapon2mode == SBRM_GUIDE)
         {
-            if (self.wait == 1)
-            if (self.tur_head.frame == 9 || self.tur_head.frame == 1)
+            if (this.wait == 1)
+            if (this.tur_head.frame == 9 || this.tur_head.frame == 1)
             {
-                if(self.gun2.cnt < time && self.tur_head.frame == 9)
-                    self.tur_head.frame = 1;
+                if(this.gun2.cnt < time && this.tur_head.frame == 9)
+                    this.tur_head.frame = 1;
 
                 return;
             }
-            self.wait = 1;
+            this.wait = 1;
         }
         else
         {
-            if(self.wait)
-                spiderbot_guide_release();
+            if(this.wait)
+                spiderbot_guide_release(this);
 
-            self.wait = 0;
+            this.wait = 0;
         }
     }
 
-    if(self.gun2.cnt > time)
+    if(this.gun2.cnt > time)
         return;
 
-    if (self.tur_head.frame >= 9)
+    if (this.tur_head.frame >= 9)
     {
-        self.tur_head.frame = 1;
-        self.wait = 0;
+        this.tur_head.frame = 1;
+        this.wait = 0;
     }
 
-    if(self.wait != -10)
-    if(!PHYS_INPUT_BUTTON_ATCK2(self.owner))
+    if(this.wait != -10)
+    if(!PHYS_INPUT_BUTTON_ATCK2(this.owner))
         return;
 
-    if(forbidWeaponUse(self.owner))
+    if(forbidWeaponUse(this.owner))
         return;
 
-    v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
+    v = gettaginfo(this.tur_head,gettagindex(this.tur_head,"tag_fire"));
 
-    switch(self.vehicle_weapon2mode)
+    switch(this.vehicle_weapon2mode)
     {
         case SBRM_VOLLY:
-            rocket = vehicles_projectile(self, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
+            rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
                                    v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
-            crosshair_trace(self.owner);
+                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, this.owner);
+            crosshair_trace(this.owner);
             float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
             _dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
             rocket.nextthink  = time + (_dist / autocvar_g_vehicle_spiderbot_rocket_speed);
             rocket.think        = vehicles_projectile_explode;
 
-            if(PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.tur_head.frame == 1)
-                self.wait = -10;
+            if(PHYS_INPUT_BUTTON_ATCK2(this.owner) && this.tur_head.frame == 1)
+                this.wait = -10;
             break;
         case SBRM_GUIDE:
-            rocket = vehicles_projectile(self, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
+            rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
                                    v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner);
-            crosshair_trace(self.owner);
+                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, this.owner);
+            crosshair_trace(this.owner);
             rocket.pos1           = trace_endpos;
             rocket.nextthink  = time;
             rocket.think         = spiderbot_rocket_guided;
@@ -244,21 +214,21 @@ void spiderbot_rocket_do()
 
         break;
         case SBRM_ARTILLERY:
-            rocket = vehicles_projectile(self, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
+            rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
                                    v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
+                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, this.owner);
 
-            crosshair_trace(self.owner);
+            crosshair_trace(this.owner);
 
             rocket.pos1           = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius);
             rocket.pos1_z         = trace_endpos_z;
 
-            traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+            traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, this);
             float h1 = 0.75 * vlen(v - trace_endpos);
 
             //v = trace_endpos;
-            traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+            traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, this);
             float h2 = 0.75 * vlen(rocket.pos1 - v);
 
             rocket.velocity  = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2));
@@ -271,13 +241,13 @@ void spiderbot_rocket_do()
 
     rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
 
-    self.tur_head.frame += 1;
-    if (self.tur_head.frame == 9)
-        self.attack_finished_single[0] = autocvar_g_vehicle_spiderbot_rocket_reload;
+    this.tur_head.frame += 1;
+    if (this.tur_head.frame == 9)
+        this.attack_finished_single[0] = autocvar_g_vehicle_spiderbot_rocket_reload;
     else
-        self.attack_finished_single[0] = ((self.vehicle_weapon2mode ==  SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
+        this.attack_finished_single[0] = ((this.vehicle_weapon2mode ==  SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
 
-    self.gun2.cnt = time + self.attack_finished_single[0];
+    this.gun2.cnt = time + this.attack_finished_single[0];
 }
 
 #endif
diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh
new file mode 100644 (file)
index 0000000..61e2b02
--- /dev/null
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <common/weapons/all.qh>
+
+#ifdef SVQC
+void spiderbot_rocket_do(entity this);
+#endif
+
+// 400 (x2) DPS
+float autocvar_g_vehicle_spiderbot_minigun_damage = 24;
+float autocvar_g_vehicle_spiderbot_minigun_refire = 0.06;
+float autocvar_g_vehicle_spiderbot_minigun_spread = 0.015;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_cost = 1;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_max = 100;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_regen = 40;
+float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause = 1;
+float autocvar_g_vehicle_spiderbot_minigun_force = 9;
+float autocvar_g_vehicle_spiderbot_minigun_solidpenetration = 32;
+
+float autocvar_g_vehicle_spiderbot_rocket_damage = 50;
+float autocvar_g_vehicle_spiderbot_rocket_force = 150;
+float autocvar_g_vehicle_spiderbot_rocket_radius = 250;
+float autocvar_g_vehicle_spiderbot_rocket_speed = 3500;
+float autocvar_g_vehicle_spiderbot_rocket_spread = 0.05;
+float autocvar_g_vehicle_spiderbot_rocket_refire = 0.1;
+// volley
+float autocvar_g_vehicle_spiderbot_rocket_refire2 = 0.025;
+float autocvar_g_vehicle_spiderbot_rocket_reload = 4;
+float autocvar_g_vehicle_spiderbot_rocket_health = 100;
+float autocvar_g_vehicle_spiderbot_rocket_noise = 0.2;
+float autocvar_g_vehicle_spiderbot_rocket_turnrate = 0.25;
+float autocvar_g_vehicle_spiderbot_rocket_lifetime = 20;
diff --git a/qcsrc/common/weapons/_mod.inc b/qcsrc/common/weapons/_mod.inc
new file mode 100644 (file)
index 0000000..d2c6fb8
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "all.qc"
+#include "calculations.qc"
+#include "config.qc"
index 5bf03fdbe8e8219378fad6546f8d63fbb6f2f4a6..9b9046aa4c668b126bb023f9ff157517f5b3d3c3 100644 (file)
@@ -115,7 +115,7 @@ STATIC_INIT_LATE(W_PROP_reloader)
 {
     SELFPARAM();
     entity e = W_PROP_reloader = new_pure(W_PROP_reloader);
-    WITH(entity, self, e, (e.think = W_PROP_think)());
+    WITHSELF(e, (e.think = W_PROP_think)());
 }
 #endif
 
index bd5172bdace8100137285939c321c58a02306017..ef115b220d5e699df07c440c59bb2fc528fc8587 100644 (file)
@@ -3,6 +3,10 @@
 #include <common/items/item/pickup.qh>
 #include <common/stats.qh>
 
+#ifdef SVQC
+#include <common/effects/qc/all.qh>
+#endif
+
 const int MAX_WEAPONSLOTS = 2;
 .entity weaponentities[MAX_WEAPONSLOTS];
 
diff --git a/qcsrc/common/weapons/weapon/_mod.inc b/qcsrc/common/weapons/weapon/_mod.inc
new file mode 100644 (file)
index 0000000..7852f1e
--- /dev/null
@@ -0,0 +1,21 @@
+// generated file; do not modify
+#include "arc.qc"
+#include "blaster.qc"
+#include "crylink.qc"
+#include "devastator.qc"
+#include "electro.qc"
+#include "fireball.qc"
+#include "hagar.qc"
+#include "hlac.qc"
+#include "hook.qc"
+#include "machinegun.qc"
+#include "minelayer.qc"
+#include "mortar.qc"
+#include "porto.qc"
+#include "rifle.qc"
+#include "seeker.qc"
+#include "shockwave.qc"
+#include "shotgun.qc"
+#include "tuba.qc"
+#include "vaporizer.qc"
+#include "vortex.qc"
index d30afff01dc6eeb92223cb7ad979ce3637a0577a..3c23e33e779ffb64c059d6742210d6965514d91b 100644 (file)
@@ -251,7 +251,7 @@ void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float dam
        this.angles = vectoangles(this.velocity);
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, this.think));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, this.think));
 }
 
 void W_Arc_Bolt_Touch()
@@ -687,7 +687,7 @@ void W_Arc_Beam(float burst)
        beam.beam_bursting = burst;
        Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
 
-       WITH(entity, self, beam, beam.think());
+       WITHSELF(beam, beam.think());
 }
 
 void Arc_Smoke()
index 23c4da6c468bcf92297daaebe1e6c45053b6e588..f9f3008ff834c80ab1cdec6758d5e1f93178c395 100644 (file)
@@ -146,7 +146,7 @@ void W_Blaster_Attack(
 
        if (time >= missile.nextthink)
        {
-               WITH(entity, self, missile, missile.think());
+               WITHSELF(missile, missile.think());
        }
 }
 
index e8697afd1e96fdb47041bcc9b50d7c7869d94314..2d930ad7212a8b83920e659e8b6992b0e81ef7c2 100644 (file)
@@ -344,7 +344,7 @@ void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float d
        this.angles = vectoangles(this.velocity);
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, W_Devastator_Explode));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, W_Devastator_Explode));
 }
 
 void W_Devastator_Attack(Weapon thiswep)
index 4dc3bf86753d95cf1478269677eb14acdad44c08..a6db7c9b71ce578845d5058793ed29a1444a340b 100644 (file)
@@ -179,7 +179,7 @@ void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float dam
        if(this.health <= 0)
        {
                this.cnt = 1;
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, W_Fireball_Explode));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, W_Fireball_Explode));
        }
 }
 
index 2d5085fb115c82df9083585c3fefd6a4372bf0e1..b764a9e66f679984fd056c539c698cd0bd7feb5e 100644 (file)
@@ -100,7 +100,7 @@ void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage
        this.angles = vectoangles(this.velocity);
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, this.think));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, this.think));
 }
 
 void W_Hagar_Touch()
index c335e8c5bc8b00fd182d8dc61fbff8d2a697fcb4..91c2840e6d35e47fefeb0dc3a1a12905949f3c7c 100644 (file)
@@ -129,7 +129,7 @@ void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage,
        this.health = this.health - damage;
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(this.realowner, W_Hook_Explode2));
+               WITHSELF(this, W_PrepareExplosionByDamage(this.realowner, W_Hook_Explode2));
 }
 
 void W_Hook_Touch2()
@@ -262,7 +262,7 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
     {
         if (actor.hook)
             RemoveGrapplingHook(actor);
-        WITH(entity, self, actor, FireGrapplingHook());
+        WITHSELF(actor, FireGrapplingHook());
         actor.hook_state &= ~HOOK_FIRING;
         actor.hook_refire = max(actor.hook_refire, time + autocvar_g_balance_grapplehook_refire * W_WeaponRateFactor());
     }
@@ -484,6 +484,9 @@ void Draw_GrapplingHook(entity this)
 void Remove_GrapplingHook(entity this)
 {
        sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
+
+       if(csqcplayer && csqcplayer.hook == this)
+               csqcplayer.hook = NULL;
 }
 
 NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
@@ -502,6 +505,8 @@ NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
                int myowner = ReadByte();
                self.owner = playerslots[myowner - 1];
                self.sv_entnum = myowner;
+               if(csqcplayer && myowner == player_localentnum)
+                       csqcplayer.hook = self;
                switch(self.HookType)
                {
                        default:
index cb5edb1ad2159b0ed35560a8e89123b99de95934..355eada3c7b9f6c31cddd8675dc745b9c4d669a6 100644 (file)
@@ -119,9 +119,9 @@ void W_MachineGun_Attack(Weapon thiswep, int deathtype, .entity weaponentity)
        ATTACK_FINISHED(self, slot) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor();
 
        if(self.misc_bulletcounter == 1)
-               fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
+               fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
        else
-               fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
+               fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
 
        Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
@@ -192,7 +192,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity
        }
 
        machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * actor.misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
-       fireBullet(w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
+       fireBullet(actor, w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
 
        actor.misc_bulletcounter = actor.misc_bulletcounter + 1;
 
@@ -218,7 +218,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit
                actor.punchangle_y = random() - 0.5;
        }
 
-       fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
+       fireBullet(actor, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
 
        Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
index a40afe5a96d9aec1e83bf331411a1d64719f6f5f..c6e0fb86bce692d211e72ec39a24f89f29886060 100644 (file)
@@ -308,7 +308,7 @@ void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float da
        this.angles = vectoangles(this.velocity);
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, W_MineLayer_Explode));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, W_MineLayer_Explode));
 }
 
 void W_MineLayer_Attack(Weapon thiswep)
index 61ca5132625bbd3f6685f413a7e1d3ed39f4e3fc..7c9b908947e31fd78e40e0613d7aa38147a68906 100644 (file)
@@ -116,7 +116,7 @@ void W_Mortar_Grenade_Damage(entity this, entity inflictor, entity attacker, flo
        this.health = this.health - damage;
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, this.use));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, this.use));
 }
 
 void W_Mortar_Grenade_Think1()
index 1ff725d1f44034859ee417ff819e6600e9b84052..b9488889ddf69c81d639e522905c6906d8685c3f 100644 (file)
@@ -105,7 +105,7 @@ void W_Porto_Remove(entity p)
 {SELFPARAM();
        if(p.porto_current.realowner == p && p.porto_current.classname == "porto")
        {
-               WITH(entity, self, p.porto_current, W_Porto_Fail(1));
+               WITHSELF(p.porto_current, W_Porto_Fail(1));
        }
 }
 
index 7c0e3173386e137c04003a1f158cfc51ea1a41f9..606770579880aa4f177ec878bc8c30ace0eb53c7 100644 (file)
@@ -73,7 +73,7 @@ void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pFor
        }
 
        for(i = 0; i < pShots; ++i)
-               fireBullet(w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
+               fireBullet(self, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
 
        if(autocvar_g_casings >= 2)
                SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
index e151756720f11d444120827dbc86f633f625a58d..34b6e895f3af59977f130f90b9cd8ec3f83fcc90 100644 (file)
@@ -220,7 +220,7 @@ void W_Seeker_Missile_Damage(entity this, entity inflictor, entity attacker, flo
                this.health = this.health - damage;
 
        if(this.health <= 0)
-               WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, W_Seeker_Missile_Explode));
+               WITHSELF(this, W_PrepareExplosionByDamage(attacker, W_Seeker_Missile_Explode));
 }
 
 /*
index 72f3d7a772c4012eb2ac8f6b05868a164e5d84d1..1a23189402d8c28f6d52e62b54d39d94b83ec378 100644 (file)
@@ -67,7 +67,7 @@ void W_Shotgun_Attack(Weapon thiswep, float isprimary)
 
        W_SetupShot(self, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
        for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
-               fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
+               fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
 
        Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
 
index 0faccbbb73eec00d61f717dd45cb5da2b56851ea..c0c434561736764acd3231140665e0152774b647 100644 (file)
@@ -144,14 +144,14 @@ REGISTER_MUTATOR(vortex_charge, true);
 MUTATOR_HOOKFUNCTION(vortex_charge, GetPressedKeys)
 {SELFPARAM();
        // WEAPONTODO
-       float xyspeed = vlen(vec2(self.velocity));
-       if (PS(self).m_weapon == WEP_VORTEX && WEP_CVAR(vortex, charge) && WEP_CVAR(vortex, charge_velocity_rate) && xyspeed > WEP_CVAR(vortex, charge_minspeed))
+       float xyspeed = vlen(vec2(this.velocity));
+       if (PS(this).m_weapon == WEP_VORTEX && WEP_CVAR(vortex, charge) && WEP_CVAR(vortex, charge_velocity_rate) && xyspeed > WEP_CVAR(vortex, charge_minspeed))
        {
                // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
                xyspeed = min(xyspeed, WEP_CVAR(vortex, charge_maxspeed));
                float f = (xyspeed - WEP_CVAR(vortex, charge_minspeed)) / (WEP_CVAR(vortex, charge_maxspeed) - WEP_CVAR(vortex, charge_minspeed));
                // add the extra charge
-               self.vortex_charge = min(1, self.vortex_charge + WEP_CVAR(vortex, charge_velocity_rate) * f * PHYS_INPUT_TIMELENGTH);
+               this.vortex_charge = min(1, this.vortex_charge + WEP_CVAR(vortex, charge_velocity_rate) * f * PHYS_INPUT_TIMELENGTH);
        }
 }
 
@@ -382,7 +382,7 @@ METHOD(Vortex, wr_impacteffect, void(entity thiswep))
     vector org2 = w_org + w_backoff * 6;
     pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
     if(!w_issilent)
-        sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);
+        sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);
 }
 METHOD(Vortex, wr_init, void(entity thiswep))
 {
index 6f88d906745ce260173600b54ef85373206215a3..0fee57ec18e87aac641444bd8d424cb82afa106c 100644 (file)
     #define TC(T, sym) MACRO_BEGIN MACRO_END
 #else
     #define TC(T, sym) MACRO_BEGIN \
-        if (!is_##T(sym)) LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+        if (!is_##T(sym)) { \
+            LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+            isnt_##T(sym); \
+        } \
     MACRO_END
 #endif
 
-bool is_float (float  this) { return true; }
-bool is_vector(vector this) { return true; }
-bool is_string(string this) { return true; }
-bool is_entity(entity this) { return true; }
-bool is_int   (float  this) { return this == floor(this); }
-bool is_bool  (float  this) { return this == true || this == false; }
+#define   is_float(        this) (true || ftoe(this))
+#define isnt_float(        this)
+#define   is_vector(       this) (true || vtos(this))
+#define isnt_vector(       this)
+#define   is_string(       this) (true || stof(this))
+#define isnt_string(       this)
+#define   is_entity(       this) (true || etof(this))
+#define isnt_entity(       this)
+bool      is_int(    float this) { return this == floor(this); }
+void    isnt_int(    float this) { print(ftos(this)); }
+bool      is_bool(   float this) { return this == true || this == false; }
+void    isnt_bool(   float this) { print(ftos(this)); }
 
 #include "warpzone/mathlib.qc"
 
diff --git a/qcsrc/lib/_mod.inc b/qcsrc/lib/_mod.inc
new file mode 100644 (file)
index 0000000..fd811e7
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "angle.qc"
+#include "p2mathlib.qc"
+#include "random.qc"
+#include "sortlist.qc"
+#include "test.qc"
+#include "urllib.qc"
diff --git a/qcsrc/lib/csqcmodel/_mod.inc b/qcsrc/lib/csqcmodel/_mod.inc
new file mode 100644 (file)
index 0000000..1d4c6ec
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "cl_model.qc"
+#include "cl_player.qc"
+#include "interpolate.qc"
+#include "sv_model.qc"
index b923062bc9a9a35115ea48cbec1aef192d27ccff..56014121f8936bf128492fcb0a4ac5e35c0754eb 100644 (file)
@@ -28,7 +28,7 @@
                SELFPARAM();
                this.think     = SUB_Remove_self;
                this.nextthink = time;
-               WITH(entity, self, this.owner, this.use());
+               WITHSELF(this.owner, this.use());
        }
 
 /*
index eaac63f5eff415c8d7a5aec8fa815b70a3cbe433..fae834b49fa684b8f973ec9730c7047d0e6ae59b 100644 (file)
        } MACRO_END
 
 #if defined(CSQC)
+    entity(entity start, .string fld, string match) _findstring = #18;
        entity(.string fld, string match, .entity tofield) _findchainstring_tofield = #402;
+
+    entity(entity start, .entity fld, entity match) _findentity = #98;
        entity(.entity fld, entity match, .entity tofield) _findchainentity_tofield = #403;
+
+    entity(entity start, .float fld, float match) _findfloat = #98;
        entity(.float fld, float match, .entity tofield) _findchainfloat_tofield = #403;
+
+       entity(entity start, .float fld, float match) _findflags = #449;
        entity(.float fld, float match, .entity tofield) _findchainflags_tofield = #450;
 #elif defined(SVQC)
+    entity(entity start, .string fld, string match) _findstring = #18;
        entity(.string fld, string match, .entity tofield) _findchainstring_tofield = #402;
+
+    entity(entity start, .entity fld, entity match) _findentity = #98;
        entity(.entity fld, entity match, .entity tofield) _findchainentity_tofield = #403;
+
+    entity(entity start, .float fld, float match) _findfloat = #98;
        entity(.float fld, float match, .entity tofield) _findchainfloat_tofield = #403;
+
+       entity(entity start, .float fld, float match) _findflags = #449;
        entity(.float fld, float match, .entity tofield) _findchainflags_tofield = #450;
 #elif defined(MENUQC)
+    entity(entity start, .string fld, string match) _findstring = #24;
        entity(.string fld, string match, .entity tofield) _findchainstring_tofield = #26;
+
+    entity(entity start, .entity fld, entity match) _findentity = #25;
        entity(.entity fld, entity match, .entity tofield) _findchainentity_tofield = #27;
+
+    entity(entity start, .float fld, float match) _findfloat = #25;
        entity(.float fld, float match, .entity tofield) _findchainfloat_tofield = #27;
+
+       entity(entity start, .float fld, float match) _findflags = #87;
        entity(.float fld, float match, .entity tofield) _findchainflags_tofield = #88;
 #endif
 
 #define ORDERED(F) F##_UNORDERED
+#define _FOREACH_ENTITY_FIND_ORDERED(T, fld, match, cond, body) \
+    MACRO_BEGIN { \
+        int _i = 0; \
+        for (entity _it = NULL; (_it = _find##T(_it, fld, match)); ++_i) \
+        { \
+            const noref int i = _i; \
+            ITER_CONST noref entity it = _it; \
+            if (cond) LAMBDA(body) \
+        } \
+    } MACRO_END
+#define _FOREACH_ENTITY_FIND_UNORDERED(id, T, fld, match, cond, body) \
+       MACRO_BEGIN { \
+               if (_FOREACH_ENTITY_FIND_##T##_##id##mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_FIND_##T##_##id##mutex); \
+               _FOREACH_ENTITY_FIND_##T##_##id##mutex = __FUNC__; \
+               entity _foundchain_first = _findchain##T##_tofield(fld, match, _FOREACH_ENTITY_FIND_##T##_next##id); \
+               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_FIND_##T##_next##id, cond, body); \
+               _FOREACH_ENTITY_FIND_##T##_##id##mutex = string_null; \
+       } MACRO_END
 
 #define FOREACH_ENTITY(cond, body) ORDERED(FOREACH_ENTITY)(cond, body)
 #define FOREACH_ENTITY_ORDERED(cond, body) \
                { \
                        const noref int i = _i; \
                        ITER_CONST noref entity it = _it; \
-                       if (cond) { LAMBDA(body) } \
+                       if (cond) LAMBDA(body) \
                } \
        } MACRO_END
 /** marker field, always NULL */
 .entity _FOREACH_ENTITY_fld;
+.entity _FOREACH_ENTITY_FIND_entity_nextall; noref string _FOREACH_ENTITY_FIND_entity_allmutex;
+#define FOREACH_ENTITY_UNORDERED(cond, body) _FOREACH_ENTITY_FIND_UNORDERED(all, entity, _FOREACH_ENTITY_fld, NULL, cond, body)
 
-.entity _FOREACH_ENTITY_next;
-noref string _FOREACH_ENTITY_mutex;
-#define FOREACH_ENTITY_UNORDERED(cond, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_mutex); \
-               _FOREACH_ENTITY_mutex = __FUNC__; \
-               entity _foundchain_first = _findchainentity_tofield(_FOREACH_ENTITY_fld, NULL, _FOREACH_ENTITY_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_next, cond, body); \
-               _FOREACH_ENTITY_mutex = string_null; \
-       } MACRO_END
-
+#define FOREACH_ENTITY_FLAGS(fld, match, body) ORDERED(FOREACH_ENTITY_FLAGS)(fld, match, body)
+#define FOREACH_ENTITY_FLAGS_ORDERED(fld, match, body) _FOREACH_ENTITY_FIND_ORDERED(flags, fld, match, true, body)
+.entity _FOREACH_ENTITY_FIND_flags_next; noref string _FOREACH_ENTITY_FIND_flags_mutex;
+#define FOREACH_ENTITY_FLAGS_UNORDERED(fld, match, body) _FOREACH_ENTITY_FIND_UNORDERED(, flags, fld, match, true, body)
 
 #ifndef MENUQC
-entity(vector org, float rad, .entity tofield) _findradius_tofield = #22;
+entity(vector org, float rad, .entity tofield) _findchainradius_tofield = #22;
 #define FOREACH_ENTITY_RADIUS(org, dist, cond, body) FOREACH_ENTITY_RADIUS_UNORDERED(org, dist, cond, body)
-.entity _FOREACH_ENTITY_RADIUS_next;
-noref string _FOREACH_ENTITY_RADIUS_mutex;
-#define FOREACH_ENTITY_RADIUS_UNORDERED(org, dist, cond, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_RADIUS_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_RADIUS_mutex); \
-               _FOREACH_ENTITY_RADIUS_mutex = __FUNC__; \
-               entity _foundchain_first = _findradius_tofield(org, dist, _FOREACH_ENTITY_RADIUS_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_RADIUS_next, cond, body); \
-               _FOREACH_ENTITY_RADIUS_mutex = string_null; \
-       } MACRO_END
+.entity _FOREACH_ENTITY_FIND_radius_next; noref string _FOREACH_ENTITY_FIND_radius_mutex;
+#define FOREACH_ENTITY_RADIUS_UNORDERED(org, dist, cond, body) _FOREACH_ENTITY_FIND_UNORDERED(, radius, org, dist, cond, body)
 #endif
 
-
-#define FOREACH_ENTITY_CLASS(class, cond, body) ORDERED(FOREACH_ENTITY_CLASS)(class, cond, body)
-#define FOREACH_ENTITY_CLASS_ORDERED(class, cond, body) FOREACH_ENTITY_ORDERED(it.classname == class && (cond), body)
-.entity _FOREACH_ENTITY_CLASS_next;
-noref string _FOREACH_ENTITY_CLASS_mutex;
-#define FOREACH_ENTITY_CLASS_UNORDERED(class, cond, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_CLASS_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_CLASS_mutex); \
-               _FOREACH_ENTITY_CLASS_mutex = __FUNC__; \
-               entity _foundchain_first = _findchainstring_tofield(classname, class, _FOREACH_ENTITY_CLASS_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_CLASS_next, cond, body); \
-               _FOREACH_ENTITY_CLASS_mutex = string_null; \
-       } MACRO_END
-
-
-
 #define FOREACH_ENTITY_FLOAT(fld, match, body) ORDERED(FOREACH_ENTITY_FLOAT)(fld, match, body)
-#define FOREACH_ENTITY_FLOAT_ORDERED(fld, match, body) FOREACH_ENTITY_ORDERED(it.fld == match, body)
-.entity _FOREACH_ENTITY_FLOAT_next;
-noref string _FOREACH_ENTITY_FLOAT_mutex;
-#define FOREACH_ENTITY_FLOAT_UNORDERED(fld, match, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_FLOAT_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_FLOAT_mutex); \
-               _FOREACH_ENTITY_FLOAT_mutex = __FUNC__; \
-               entity _foundchain_first = _findchainfloat_tofield(fld, match, _FOREACH_ENTITY_FLOAT_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_FLOAT_next, true, body); \
-               _FOREACH_ENTITY_FLOAT_mutex = string_null; \
-       } MACRO_END
-
-
-
-#define FOREACH_ENTITY_FLAGS(fld, match, body) ORDERED(FOREACH_ENTITY_FLAGS)(fld, match, body)
-#define FOREACH_ENTITY_FLAGS_ORDERED(fld, match, body) FOREACH_ENTITY_ORDERED(it.fld & match, body)
-.entity _FOREACH_ENTITY_FLAGS_next;
-noref string _FOREACH_ENTITY_FLAGS_mutex;
-#define FOREACH_ENTITY_FLAGS_UNORDERED(fld, match, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_FLAGS_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_FLAGS_mutex); \
-               _FOREACH_ENTITY_FLAGS_mutex = __FUNC__; \
-               entity _foundchain_first = _findchainflags_tofield(fld, match, _FOREACH_ENTITY_FLAGS_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_FLAGS_next, true, body); \
-               _FOREACH_ENTITY_FLAGS_mutex = string_null; \
-       } MACRO_END
-
-
+#define FOREACH_ENTITY_FLOAT_ORDERED(fld, match, body) _FOREACH_ENTITY_FIND_ORDERED(float, fld, match, true, body)
+.entity _FOREACH_ENTITY_FIND_float_next; noref string _FOREACH_ENTITY_FIND_float_mutex;
+#define FOREACH_ENTITY_FLOAT_UNORDERED(fld, match, body) _FOREACH_ENTITY_FIND_UNORDERED(, float, fld, match, true, body)
 
 #define FOREACH_ENTITY_ENT(fld, match, body) ORDERED(FOREACH_ENTITY_ENT)(fld, match, body)
-#define FOREACH_ENTITY_ENT_ORDERED(fld, match, body) FOREACH_ENTITY_ORDERED(it.fld == match, body)
-.entity _FOREACH_ENTITY_ENT_next;
-noref string _FOREACH_ENTITY_ENT_mutex;
-#define FOREACH_ENTITY_ENT_UNORDERED(fld, match, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_ENT_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_ENT_mutex); \
-               _FOREACH_ENTITY_ENT_mutex = __FUNC__; \
-               entity _foundchain_first = _findchainentity_tofield(fld, match, _FOREACH_ENTITY_ENT_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_ENT_next, true, body); \
-               _FOREACH_ENTITY_ENT_mutex = string_null; \
-       } MACRO_END
-
-
+#define FOREACH_ENTITY_ENT_ORDERED(fld, match, body) _FOREACH_ENTITY_FIND_ORDERED(entity, fld, match, true, body)
+.entity _FOREACH_ENTITY_FIND_entity_next; noref string _FOREACH_ENTITY_FIND_entity_mutex;
+#define FOREACH_ENTITY_ENT_UNORDERED(fld, match, body) _FOREACH_ENTITY_FIND_UNORDERED(, entity, fld, match, true, body)
 
 #define FOREACH_ENTITY_STRING(fld, match, body) ORDERED(FOREACH_ENTITY_STRING)(fld, match, body)
-#define FOREACH_ENTITY_STRING_ORDERED(fld, match, body) FOREACH_ENTITY_ORDERED(it.fld == match, body)
-.entity _FOREACH_ENTITY_STRING_next;
-noref string _FOREACH_ENTITY_STRING_mutex;
-#define FOREACH_ENTITY_STRING_UNORDERED(fld, match, body) \
-       MACRO_BEGIN { \
-               if (_FOREACH_ENTITY_STRING_mutex) LOG_SEVEREF("Loop mutex held by %s", _FOREACH_ENTITY_STRING_mutex); \
-               _FOREACH_ENTITY_STRING_mutex = __FUNC__; \
-               entity _foundchain_first = _findchainstring_tofield(fld, match, _FOREACH_ENTITY_STRING_next); \
-               FOREACH_LIST(_foundchain, _FOREACH_ENTITY_STRING_next, true, body); \
-               _FOREACH_ENTITY_STRING_mutex = string_null; \
-       } MACRO_END
+#define FOREACH_ENTITY_STRING_ORDERED(fld, match, body) _FOREACH_ENTITY_FIND_ORDERED(string, fld, match, true, body)
+.entity _FOREACH_ENTITY_FIND_string_next; noref string _FOREACH_ENTITY_FIND_string_mutex;
+#define FOREACH_ENTITY_STRING_UNORDERED(fld, match, body) _FOREACH_ENTITY_FIND_UNORDERED(, string, fld, match, true, body)
+
+#define FOREACH_ENTITY_CLASS(class, cond, body) ORDERED(FOREACH_ENTITY_CLASS)(class, cond, body)
+#define FOREACH_ENTITY_CLASS_ORDERED(class, cond, body) _FOREACH_ENTITY_FIND_ORDERED(string, classname, class, cond, body)
+.entity _FOREACH_ENTITY_FIND_string_nextclazz; noref string _FOREACH_ENTITY_FIND_string_clazzmutex;
+#define FOREACH_ENTITY_CLASS_UNORDERED(class, cond, body) _FOREACH_ENTITY_FIND_UNORDERED(clazz, string, classname, class, cond, body)
index 68c974dc31adc66faf5728c455fbaed42f8f1d1b..02a25cdad0d0679d577c00191a9835e4750f5084 100644 (file)
@@ -38,9 +38,11 @@ string(string...) strcat0n = #53;
 string(string...) strcat0n = #115;
 #endif
 
+#define __SOURCELOC__ (sprintf("^9"__FILE__"^7"  ":"  "^9%s^7"  ":"  "^9"STR(__LINE__)"^7", __FUNC__))
+
 #define _LOG(f, level, s) \
        MACRO_BEGIN { \
-               f(sprintf("^9[::^7" PROGNAME "^9::" level "^9] [" __FILE__ "^7:^9%s^7:^9" STR(__LINE__) "] \n^7%s\n", __FUNC__, s)); \
+               f(sprintf("^9[::^7" PROGNAME "^9::" level "^9] [%s^9]\n^7%s\n", __SOURCELOC__, s)); \
        } MACRO_END
 
 #define  LOG_FATAL(...) _LOG_FATAL(strcat0n(__VA_ARGS__))
index 47d6af7186144f1dfc41a157ffa7867c3358096a..03e5c9dd8941d6a1143effdf28ce3290638f9333 100644 (file)
@@ -41,7 +41,7 @@ STATIC_INIT(RegisterTempEntities_renumber) { FOREACH(TempEntities, true, it.m_id
        #define REGISTER_NET_LINKED(id) \
                [[accumulate]] NET_HANDLE(id, bool isnew) \
                { \
-                       this = self; \
+                       this = __self; \
                        this.sourceLoc = __FILE__ ":" STR(__LINE__); \
                        if (!this) isnew = true; \
                } \
@@ -145,8 +145,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        void UncustomizeEntitiesRun()
        {
-           SELFPARAM();
-               FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITH(entity, self, it, it.uncustomizeentityforclient()));
+               FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITHSELF(it, it.uncustomizeentityforclient()));
        }
 
        STRING_ITERATOR(g_buf, string_null, 0);
index e4f8d289ebf4d5587310179bdd49977d9aeb8620..e1e3193308c4a0fe021301445e827dedd97a4ec8 100644 (file)
@@ -6,6 +6,7 @@
 
 #ifdef MENUQC
        #define NULL (0, null_entity)
+       #define world NULL
 #else
        #define NULL (0, world)
 #endif
@@ -174,6 +175,7 @@ STATIC_INIT(RegisterClasses)
        entityclass(cname, base);               \
        class(cname).bool instanceOf##cname;    \
     bool is_##cname(entity e) { return e.instanceOf##cname; } \
+    void isnt_##cname(entity e) { eprint(e); } \
        VTBL(cname, base)                       \
        _INIT_STATIC(cname)                     \
        {                                       \
index 2b96cf7c4655316047e2d9d44d6f2526c42c6999..7ce923c537d8242ff77cd73f336ab438d173f57b 100644 (file)
@@ -157,7 +157,7 @@ void Registry_send(string id, string hash);
                FOREACH(id, true, s = strcat(s, join, it.registered_id)); \
                s = substring(s, strlen(join), -1); \
                string h = REGISTRY_HASH(id) = strzone(digest_hex(algo, s)); \
-               LOG_TRACEF(#id ": %s\n[%s]\n", h, s); \
+               LOG_DEBUGF(#id ": %s\n[%s]\n", h, s); \
        } \
        void Registry_check(string r, string sv) \
        { \
index 99bea5be7cd7ca5b0b8bc02963e4398d9ca0755c..5d53694c72294ed2c5b077f586ad1ee0e0ad422e 100644 (file)
@@ -2,33 +2,33 @@
 
 // Transition from global 'self' to local 'this'
 
-[[alias("self")]] entity __self;
-
 // Step 1: auto oldself
 #if 1
-       #define SELFPARAM() noref entity this = __self
-       #define setself(s) (__self = s)
-       #define self __self
+    #define SELFPARAM() noref const entity this = self
 #endif
 
-// Step 2: check SELFPARAM() is present for functions that use self
-#if 0
-       #define SELFPARAM() [[alias("__self")]] noref entity this = __self
-       #define setself(s) (__self = s)
-       #define self this
+// Step 2: const self
+#if 1
+    #define self (0, self)
+    [[alias("self")]] entity __self;
+    #define setself(s) (__self = s)
+    #define WITHSELF(value, block) WITH(entity, __self, value, (0, block))
 #endif
 
-// Step 3: const self
+// Step 3: propagate SELFPARAM()
+#if 1
+    #undef self
+    #define self (this, self)
+#endif
+
+// Step 4: kill unstructured setself
 #if 0
-       #define SELFPARAM() noref const entity this = __self
-       entity setself(entity e) { return self = e; }
-       entity getself() { return self; }
-       #define self getself()
+    #undef setself
 #endif
 
-// Step 4: enable when possible
-// TODO: Remove SELFPARAM in favor of a parameter
+// Step 5: this should work
 #if 0
-       #define SELFPARAM() noref const entity this = __self
-       #define self this
+    #define self (0, this)
 #endif
+
+// Step 6: Remove SELFPARAM in favor of a parameter
index 9d1090bac1dbe40711a6ed10139894a5fca96ba4..22047bbc9daac0d285478015cbecbcf14ceb6303 100644 (file)
@@ -35,11 +35,11 @@ noref bool require_spawnfunc_prefix;
                void __spawnfunc_##id(entity this); \
                [[accumulate]] void spawnfunc_##id(entity this) \
                { \
-                       if (self == __spawnfunc_expect) \
+                       if (__self == __spawnfunc_expect) \
                        { \
                                /* engine call */ \
                                __spawnfunc_expect = NULL; \
-                               this = self; \
+                               this = __self; \
                        } \
                        else \
                        { \
diff --git a/qcsrc/lib/warpzone/_mod.inc b/qcsrc/lib/warpzone/_mod.inc
new file mode 100644 (file)
index 0000000..ef257d6
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "anglestransform.qc"
+#include "client.qc"
+#include "common.qc"
+#include "mathlib.qc"
+#include "server.qc"
+#include "util_server.qc"
index 89f6b84afcef4d306989867fe4c2bb6160247922..6467dad35a4d57b4fcebe762166b70216ef2fbec 100644 (file)
@@ -29,139 +29,139 @@ void WarpZone_Touch ();
 NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew)
 {
        warpzone_warpzones_exist = 1;
-       if (!self.enemy)
+       if (!this.enemy)
        {
-               self.enemy = new(warpzone_from);
+               this.enemy = new(warpzone_from);
        }
-       self.classname = "trigger_warpzone";
+       this.classname = "trigger_warpzone";
 
        int f = ReadByte();
-       self.warpzone_isboxy = (f & 1);
+       this.warpzone_isboxy = (f & 1);
        if(f & 4)
        {
-               self.origin_x = ReadCoord();
-               self.origin_y = ReadCoord();
-               self.origin_z = ReadCoord();
+               this.origin_x = ReadCoord();
+               this.origin_y = ReadCoord();
+               this.origin_z = ReadCoord();
        }
        else
-               self.origin = '0 0 0';
-       self.modelindex = ReadShort();
-       self.mins_x = ReadCoord();
-       self.mins_y = ReadCoord();
-       self.mins_z = ReadCoord();
-       self.maxs_x = ReadCoord();
-       self.maxs_y = ReadCoord();
-       self.maxs_z = ReadCoord();
-       self.scale = ReadByte() / 16;
-       self.enemy.oldorigin_x = ReadCoord();
-       self.enemy.oldorigin_y = ReadCoord();
-       self.enemy.oldorigin_z = ReadCoord();
-       self.enemy.avelocity_x = ReadCoord();
-       self.enemy.avelocity_y = ReadCoord();
-       self.enemy.avelocity_z = ReadCoord();
-       self.oldorigin_x = ReadCoord();
-       self.oldorigin_y = ReadCoord();
-       self.oldorigin_z = ReadCoord();
-       self.avelocity_x = ReadCoord();
-       self.avelocity_y = ReadCoord();
-       self.avelocity_z = ReadCoord();
+               this.origin = '0 0 0';
+       this.modelindex = ReadShort();
+       this.mins_x = ReadCoord();
+       this.mins_y = ReadCoord();
+       this.mins_z = ReadCoord();
+       this.maxs_x = ReadCoord();
+       this.maxs_y = ReadCoord();
+       this.maxs_z = ReadCoord();
+       this.scale = ReadByte() / 16;
+       this.enemy.oldorigin_x = ReadCoord();
+       this.enemy.oldorigin_y = ReadCoord();
+       this.enemy.oldorigin_z = ReadCoord();
+       this.enemy.avelocity_x = ReadCoord();
+       this.enemy.avelocity_y = ReadCoord();
+       this.enemy.avelocity_z = ReadCoord();
+       this.oldorigin_x = ReadCoord();
+       this.oldorigin_y = ReadCoord();
+       this.oldorigin_z = ReadCoord();
+       this.avelocity_x = ReadCoord();
+       this.avelocity_y = ReadCoord();
+       this.avelocity_z = ReadCoord();
 
        if(f & 2)
        {
-               self.warpzone_fadestart = ReadShort();
-               self.warpzone_fadeend = max(self.warpzone_fadestart + 1, ReadShort());
+               this.warpzone_fadestart = ReadShort();
+               this.warpzone_fadeend = max(this.warpzone_fadestart + 1, ReadShort());
        }
        else
        {
-               self.warpzone_fadestart = 0;
-               self.warpzone_fadeend = 0;
+               this.warpzone_fadestart = 0;
+               this.warpzone_fadeend = 0;
        }
 
        // common stuff
-       WarpZone_SetUp(self, self.enemy.oldorigin, self.enemy.avelocity, self.oldorigin, self.avelocity);
+       WarpZone_SetUp(this, this.enemy.oldorigin, this.enemy.avelocity, this.oldorigin, this.avelocity);
 
        // link me
-       //setmodel(self, self.model);
-       setorigin(self, self.origin);
-       setsize(self, self.mins, self.maxs);
+       //setmodel(this, this.model);
+       setorigin(this, this.origin);
+       setsize(this, this.mins, this.maxs);
 
        // how to draw
        // engine currently wants this
-       setpredraw(self, WarpZone_Fade_PreDraw);
+       setpredraw(this, WarpZone_Fade_PreDraw);
 
-       //self.move_touch = WarpZone_Touch;
+       //this.move_touch = WarpZone_Touch;
        return true;
 }
 
 NET_HANDLE(ENT_CLIENT_WARPZONE_CAMERA, bool isnew)
 {
        warpzone_cameras_exist = 1;
-       self.classname = "func_warpzone_camera";
+       this.classname = "func_warpzone_camera";
 
        int f = ReadByte();
        if(f & 4)
        {
-               self.origin_x = ReadCoord();
-               self.origin_y = ReadCoord();
-               self.origin_z = ReadCoord();
+               this.origin_x = ReadCoord();
+               this.origin_y = ReadCoord();
+               this.origin_z = ReadCoord();
        }
        else
-               self.origin = '0 0 0';
-       self.modelindex = ReadShort();
-       self.mins_x = ReadCoord();
-       self.mins_y = ReadCoord();
-       self.mins_z = ReadCoord();
-       self.maxs_x = ReadCoord();
-       self.maxs_y = ReadCoord();
-       self.maxs_z = ReadCoord();
-       self.scale = ReadByte() / 16;
-       self.oldorigin_x = ReadCoord();
-       self.oldorigin_y = ReadCoord();
-       self.oldorigin_z = ReadCoord();
-       self.avelocity_x = ReadCoord();
-       self.avelocity_y = ReadCoord();
-       self.avelocity_z = ReadCoord();
+               this.origin = '0 0 0';
+       this.modelindex = ReadShort();
+       this.mins_x = ReadCoord();
+       this.mins_y = ReadCoord();
+       this.mins_z = ReadCoord();
+       this.maxs_x = ReadCoord();
+       this.maxs_y = ReadCoord();
+       this.maxs_z = ReadCoord();
+       this.scale = ReadByte() / 16;
+       this.oldorigin_x = ReadCoord();
+       this.oldorigin_y = ReadCoord();
+       this.oldorigin_z = ReadCoord();
+       this.avelocity_x = ReadCoord();
+       this.avelocity_y = ReadCoord();
+       this.avelocity_z = ReadCoord();
 
        if(f & 2)
        {
-               self.warpzone_fadestart = ReadShort();
-               self.warpzone_fadeend = max(self.warpzone_fadestart + 1, ReadShort());
+               this.warpzone_fadestart = ReadShort();
+               this.warpzone_fadeend = max(this.warpzone_fadestart + 1, ReadShort());
        }
        else
        {
-               self.warpzone_fadestart = 0;
-               self.warpzone_fadeend = 0;
+               this.warpzone_fadestart = 0;
+               this.warpzone_fadeend = 0;
        }
 
        // common stuff
-       WarpZone_Camera_SetUp(self, self.oldorigin, self.avelocity);
+       WarpZone_Camera_SetUp(this, this.oldorigin, this.avelocity);
 
        // engine currently wants this
-       self.drawmask = MASK_NORMAL;
+       this.drawmask = MASK_NORMAL;
 
        // link me
-       //setmodel(self, self.model);
-       setorigin(self, self.origin);
-       setsize(self, self.mins, self.maxs);
+       //setmodel(this, this.model);
+       setorigin(this, this.origin);
+       setsize(this, this.mins, this.maxs);
 
        // how to draw
        // engine currently wants this
-       setpredraw(self, WarpZone_Fade_PreDraw);
+       setpredraw(this, WarpZone_Fade_PreDraw);
        return true;
 }
 
 void CL_RotateMoves(vector ang) = #638;
 NET_HANDLE(ENT_CLIENT_WARPZONE_TELEPORTED, bool isnew)
 {
-       self.classname = "warpzone_teleported";
+       this.classname = "warpzone_teleported";
        vector v;
        v.x = ReadCoord();
        v.y = ReadCoord();
        v.z = ReadCoord();
        return = true;
        if (!isnew) return;
-       self.warpzone_transform = v;
-       setproperty(VF_CL_VIEWANGLES, WarpZone_TransformVAngles(self, getpropertyvec(VF_CL_VIEWANGLES)));
+       this.warpzone_transform = v;
+       setproperty(VF_CL_VIEWANGLES, WarpZone_TransformVAngles(this, getpropertyvec(VF_CL_VIEWANGLES)));
        if(checkextension("DP_CSQC_ROTATEMOVES"))
                CL_RotateMoves(v);
                //CL_RotateMoves('0 90 0');
@@ -226,8 +226,7 @@ vector WarpZone_FixNearClip(vector o, vector c0, vector c1, vector c2, vector c3
 
 void WarpZone_FixPMove()
 {
-       entity e;
-       e = WarpZone_Find(pmove_org, pmove_org);
+       entity e = WarpZone_Find(pmove_org, pmove_org);
        if(e)
        {
                pmove_org = WarpZone_TransformOrigin(e, pmove_org);
index 7309ff79b8c16b4e7280f79600a3a0f1e9f77ed6..130e1b2d14b82be54b0619811c6f0cb553a056d2 100644 (file)
@@ -42,22 +42,22 @@ float autocvar_cl_warpzone_usetrace = 1;
 vector WarpZone_camera_transform(vector org, vector ang)
 {SELFPARAM();
        vector vf, vr, vu;
-       if(self.warpzone_fadestart)
-               if(vdist(org - self.origin - 0.5 * (self.mins + self.maxs), >, self.warpzone_fadeend + 400))
+       if(this.warpzone_fadestart)
+               if(vdist(org - this.origin - 0.5 * (this.mins + this.maxs), >, this.warpzone_fadeend + 400))
                        return org;
                        // don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
                        // unneeded on client, on server this helps a lot
        vf = v_forward;
        vr = v_right;
        vu = v_up;
-       org = WarpZone_TransformOrigin(self, org);
-       vf = WarpZone_TransformVelocity(self, vf);
-       vr = WarpZone_TransformVelocity(self, vr);
-       vu = WarpZone_TransformVelocity(self, vu);
+       org = WarpZone_TransformOrigin(this, org);
+       vf = WarpZone_TransformVelocity(this, vf);
+       vr = WarpZone_TransformVelocity(this, vr);
+       vu = WarpZone_TransformVelocity(this, vu);
        if(autocvar_cl_warpzone_usetrace)
-               traceline(self.warpzone_targetorigin, org, MOVE_NOMONSTERS, world);
+               traceline(this.warpzone_targetorigin, org, MOVE_NOMONSTERS, world);
        else
-               trace_endpos = self.warpzone_targetorigin;
+               trace_endpos = this.warpzone_targetorigin;
        v_forward = vf;
        v_right = vr;
        v_up = vu;
@@ -80,14 +80,14 @@ void WarpZone_SetUp(entity e, vector my_org, vector my_ang, vector other_org, ve
 vector WarpZone_Camera_camera_transform(vector org, vector ang)
 {SELFPARAM();
        // a fixed camera view
-       if(self.warpzone_fadestart)
-               if(vdist(org - self.origin - 0.5 * (self.mins + self.maxs), >, self.warpzone_fadeend + 400))
+       if(this.warpzone_fadestart)
+               if(vdist(org - this.origin - 0.5 * (this.mins + this.maxs), >, this.warpzone_fadeend + 400))
                        return org;
                        // don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
                        // unneeded on client, on server this helps a lot
-       trace_endpos = self.warpzone_origin;
-       makevectors(self.warpzone_angles);
-       return self.warpzone_origin;
+       trace_endpos = this.warpzone_origin;
+       makevectors(this.warpzone_angles);
+       return this.warpzone_origin;
 }
 
 void WarpZone_Camera_SetUp(entity e, vector my_org, vector my_ang) // we assume that e.oldorigin and e.avelocity point to view origin and direction
@@ -670,9 +670,9 @@ entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
 void WarpZone_RefSys_GC()
 {SELFPARAM();
        // garbage collect unused reference systems
-       self.nextthink = time + 1;
-       if(self.owner.WarpZone_refsys != self)
-               remove(self);
+       this.nextthink = time + 1;
+       if(this.owner.WarpZone_refsys != this)
+               remove(this);
 }
 void WarpZone_RefSys_CheckCreate(entity me)
 {
@@ -788,7 +788,7 @@ entity WarpZone_RefSys_SpawnSameRefSys(entity me)
 
 float WarpZoneLib_ExactTrigger_Touch()
 {SELFPARAM();
-       return !WarpZoneLib_BoxTouchesBrush(other.absmin, other.absmax, self, other);
+       return !WarpZoneLib_BoxTouchesBrush(other.absmin, other.absmax, this, other);
 }
 
 
index 4f15d62123d366ad2c6d00bb5d4598798e817265..2f8471180aac2169dbd943f5e1faff318c849341 100644 (file)
@@ -71,12 +71,12 @@ void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector
 }
 
 #ifdef SVQC
-bool WarpZone_Teleported_Send(entity to, int sf)
-{SELFPARAM();
+bool WarpZone_Teleported_Send(entity this, entity to, int sf)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
-       WriteCoord(MSG_ENTITY, self.angles.x);
-       WriteCoord(MSG_ENTITY, self.angles.y);
-       WriteCoord(MSG_ENTITY, self.angles.z);
+       WriteCoord(MSG_ENTITY, this.angles.x);
+       WriteCoord(MSG_ENTITY, this.angles.y);
+       WriteCoord(MSG_ENTITY, this.angles.z);
        return true;
 }
 #endif
@@ -169,7 +169,8 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
 
                entity ts = new(warpzone_teleported);
                setmodel(ts, MDL_Null);
-               ts.SendEntity = WarpZone_Teleported_Send;
+               ts.SendEntity = SendEntity_self;
+               ts.SendEntity3 = WarpZone_Teleported_Send;
                ts.SendFlags = 0xFFFFFF;
                ts.drawonlytoclient = player;
                ts.think = SUB_Remove_self;
@@ -209,9 +210,9 @@ void WarpZone_Touch ()
                return;
 
 #ifdef SVQC
-       if(WarpZone_PlaneDist(self, other.origin + other.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
+       if(WarpZone_PlaneDist(this, other.origin + other.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
 #elif defined(CSQC)
-       if(WarpZone_PlaneDist(self, other.move_origin + other.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
+       if(WarpZone_PlaneDist(this, other.move_origin + other.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
 #endif
                return;
 
@@ -236,24 +237,24 @@ void WarpZone_Touch ()
        #endif
        else
                f = -1;
-       if(WarpZone_Teleport(self, other, f, 0))
+       if(WarpZone_Teleport(this, other, f, 0))
        {
 #ifdef SVQC
                string save1, save2;
                activator = other;
 
-               save1 = self.target; self.target = string_null;
-               save2 = self.target3; self.target3 = string_null;
+               save1 = this.target; this.target = string_null;
+               save2 = this.target3; this.target3 = string_null;
                SUB_UseTargets();
-               if (!self.target) self.target = save1;
-               if (!self.target3) self.target3 = save2;
+               if (!this.target) this.target = save1;
+               if (!this.target3) this.target3 = save2;
 
-               setself(self.enemy);
-               save1 = self.target; self.target = string_null;
-               save2 = self.target2; self.target2 = string_null;
+               setself(this.enemy);
+               save1 = this.target; this.target = string_null;
+               save2 = this.target2; this.target2 = string_null;
                SUB_UseTargets();
-               if (!self.target) self.target = save1;
-               if (!self.target2) self.target2 = save2;
+               if (!this.target) this.target = save1;
+               if (!this.target2) this.target2 = save2;
                setself(this);
 #endif
        }
@@ -264,100 +265,100 @@ void WarpZone_Touch ()
 }
 
 #ifdef SVQC
-bool WarpZone_Send(entity to, int sendflags)
-{SELFPARAM();
+bool WarpZone_Send(entity this, entity to, int sendflags)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_WARPZONE);
 
        // we must send this flag for clientside to match properly too
        int f = 0;
-       if(self.warpzone_isboxy)
+       if(this.warpzone_isboxy)
                BITSET_ASSIGN(f, 1);
-       if(self.warpzone_fadestart)
+       if(this.warpzone_fadestart)
                BITSET_ASSIGN(f, 2);
-       if(self.origin != '0 0 0')
+       if(this.origin != '0 0 0')
                BITSET_ASSIGN(f, 4);
        WriteByte(MSG_ENTITY, f);
 
        // we need THESE to render the warpzone (and cull properly)...
        if(f & 4)
        {
-               WriteCoord(MSG_ENTITY, self.origin.x);
-               WriteCoord(MSG_ENTITY, self.origin.y);
-               WriteCoord(MSG_ENTITY, self.origin.z);
+               WriteCoord(MSG_ENTITY, this.origin.x);
+               WriteCoord(MSG_ENTITY, this.origin.y);
+               WriteCoord(MSG_ENTITY, this.origin.z);
        }
 
-       WriteShort(MSG_ENTITY, self.modelindex);
-       WriteCoord(MSG_ENTITY, self.mins.x);
-       WriteCoord(MSG_ENTITY, self.mins.y);
-       WriteCoord(MSG_ENTITY, self.mins.z);
-       WriteCoord(MSG_ENTITY, self.maxs.x);
-       WriteCoord(MSG_ENTITY, self.maxs.y);
-       WriteCoord(MSG_ENTITY, self.maxs.z);
-       WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
+       WriteShort(MSG_ENTITY, this.modelindex);
+       WriteCoord(MSG_ENTITY, this.mins.x);
+       WriteCoord(MSG_ENTITY, this.mins.y);
+       WriteCoord(MSG_ENTITY, this.mins.z);
+       WriteCoord(MSG_ENTITY, this.maxs.x);
+       WriteCoord(MSG_ENTITY, this.maxs.y);
+       WriteCoord(MSG_ENTITY, this.maxs.z);
+       WriteByte(MSG_ENTITY, bound(1, this.scale * 16, 255));
 
        // we need THESE to calculate the proper transform
-       WriteCoord(MSG_ENTITY, self.warpzone_origin.x);
-       WriteCoord(MSG_ENTITY, self.warpzone_origin.y);
-       WriteCoord(MSG_ENTITY, self.warpzone_origin.z);
-       WriteCoord(MSG_ENTITY, self.warpzone_angles.x);
-       WriteCoord(MSG_ENTITY, self.warpzone_angles.y);
-       WriteCoord(MSG_ENTITY, self.warpzone_angles.z);
-       WriteCoord(MSG_ENTITY, self.warpzone_targetorigin.x);
-       WriteCoord(MSG_ENTITY, self.warpzone_targetorigin.y);
-       WriteCoord(MSG_ENTITY, self.warpzone_targetorigin.z);
-       WriteCoord(MSG_ENTITY, self.warpzone_targetangles.x);
-       WriteCoord(MSG_ENTITY, self.warpzone_targetangles.y);
-       WriteCoord(MSG_ENTITY, self.warpzone_targetangles.z);
+       WriteCoord(MSG_ENTITY, this.warpzone_origin.x);
+       WriteCoord(MSG_ENTITY, this.warpzone_origin.y);
+       WriteCoord(MSG_ENTITY, this.warpzone_origin.z);
+       WriteCoord(MSG_ENTITY, this.warpzone_angles.x);
+       WriteCoord(MSG_ENTITY, this.warpzone_angles.y);
+       WriteCoord(MSG_ENTITY, this.warpzone_angles.z);
+       WriteCoord(MSG_ENTITY, this.warpzone_targetorigin.x);
+       WriteCoord(MSG_ENTITY, this.warpzone_targetorigin.y);
+       WriteCoord(MSG_ENTITY, this.warpzone_targetorigin.z);
+       WriteCoord(MSG_ENTITY, this.warpzone_targetangles.x);
+       WriteCoord(MSG_ENTITY, this.warpzone_targetangles.y);
+       WriteCoord(MSG_ENTITY, this.warpzone_targetangles.z);
 
        if(f & 2)
        {
-               WriteShort(MSG_ENTITY, self.warpzone_fadestart);
-               WriteShort(MSG_ENTITY, self.warpzone_fadeend);
+               WriteShort(MSG_ENTITY, this.warpzone_fadestart);
+               WriteShort(MSG_ENTITY, this.warpzone_fadeend);
        }
 
        return true;
 }
 
-bool WarpZone_Camera_Send(entity to, int sendflags)
-{SELFPARAM();
+bool WarpZone_Camera_Send(entity this, entity to, int sendflags)
+{
        int f = 0;
        WriteHeader(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
 
-       if(self.warpzone_fadestart)
+       if(this.warpzone_fadestart)
                BITSET_ASSIGN(f, 2);
-       if(self.origin != '0 0 0')
+       if(this.origin != '0 0 0')
                BITSET_ASSIGN(f, 4);
        WriteByte(MSG_ENTITY, f);
 
        // we need THESE to render the warpzone (and cull properly)...
        if(f & 4)
        {
-               WriteCoord(MSG_ENTITY, self.origin.x);
-               WriteCoord(MSG_ENTITY, self.origin.y);
-               WriteCoord(MSG_ENTITY, self.origin.z);
+               WriteCoord(MSG_ENTITY, this.origin.x);
+               WriteCoord(MSG_ENTITY, this.origin.y);
+               WriteCoord(MSG_ENTITY, this.origin.z);
        }
 
-       WriteShort(MSG_ENTITY, self.modelindex);
-       WriteCoord(MSG_ENTITY, self.mins.x);
-       WriteCoord(MSG_ENTITY, self.mins.y);
-       WriteCoord(MSG_ENTITY, self.mins.z);
-       WriteCoord(MSG_ENTITY, self.maxs.x);
-       WriteCoord(MSG_ENTITY, self.maxs.y);
-       WriteCoord(MSG_ENTITY, self.maxs.z);
-       WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
+       WriteShort(MSG_ENTITY, this.modelindex);
+       WriteCoord(MSG_ENTITY, this.mins.x);
+       WriteCoord(MSG_ENTITY, this.mins.y);
+       WriteCoord(MSG_ENTITY, this.mins.z);
+       WriteCoord(MSG_ENTITY, this.maxs.x);
+       WriteCoord(MSG_ENTITY, this.maxs.y);
+       WriteCoord(MSG_ENTITY, this.maxs.z);
+       WriteByte(MSG_ENTITY, bound(1, this.scale * 16, 255));
 
        // we need THESE to calculate the proper transform
-       WriteCoord(MSG_ENTITY, self.enemy.origin.x);
-       WriteCoord(MSG_ENTITY, self.enemy.origin.y);
-       WriteCoord(MSG_ENTITY, self.enemy.origin.z);
-       WriteCoord(MSG_ENTITY, self.enemy.angles.x);
-       WriteCoord(MSG_ENTITY, self.enemy.angles.y);
-       WriteCoord(MSG_ENTITY, self.enemy.angles.z);
+       WriteCoord(MSG_ENTITY, this.enemy.origin.x);
+       WriteCoord(MSG_ENTITY, this.enemy.origin.y);
+       WriteCoord(MSG_ENTITY, this.enemy.origin.z);
+       WriteCoord(MSG_ENTITY, this.enemy.angles.x);
+       WriteCoord(MSG_ENTITY, this.enemy.angles.y);
+       WriteCoord(MSG_ENTITY, this.enemy.angles.z);
 
        if(f & 2)
        {
-               WriteShort(MSG_ENTITY, self.warpzone_fadestart);
-               WriteShort(MSG_ENTITY, self.warpzone_fadeend);
+               WriteShort(MSG_ENTITY, this.warpzone_fadestart);
+               WriteShort(MSG_ENTITY, this.warpzone_fadeend);
        }
 
        return true;
@@ -456,7 +457,7 @@ float WarpZone_Projectile_Touch()
        // engine now aborts moves on teleport, so this SHOULD not happen any more
        // but if this is called from TouchAreaGrid of the projectile moving,
        // then this won't do
-       if(time == self.warpzone_teleport_time)
+       if(time == this.warpzone_teleport_time)
                return true;
 
 #ifdef SVQC
@@ -490,7 +491,7 @@ float WarpZone_Projectile_Touch()
                save_inopen = trace_inopen;
                save_inwater = trace_inwater;
                float f;
-               if((f = WarpZone_CheckProjectileImpact(self)) != 0)
+               if((f = WarpZone_CheckProjectileImpact(this)) != 0)
                        return (f > 0);
                trace_dpstartcontents = save_dpstartcontents;
                trace_dphitcontents = save_dphitcontents;
@@ -519,84 +520,84 @@ float WarpZone_Projectile_Touch()
 
 void WarpZone_InitStep_FindOriginTarget()
 {SELFPARAM();
-       if(self.killtarget != "")
+       if(this.killtarget != "")
        {
-               self.aiment = find(world, targetname, self.killtarget);
-               if(self.aiment == world)
+               this.aiment = find(world, targetname, this.killtarget);
+               if(this.aiment == world)
                {
                        error("Warp zone with nonexisting killtarget");
                        return;
                }
-               self.killtarget = string_null;
+               this.killtarget = string_null;
        }
 }
 
 void WarpZonePosition_InitStep_FindTarget()
 {SELFPARAM();
-       if(self.target == "")
+       if(this.target == "")
        {
                error("Warp zone position with no target");
                return;
        }
-       self.enemy = find(world, targetname, self.target);
-       if(self.enemy == world)
+       this.enemy = find(world, targetname, this.target);
+       if(this.enemy == world)
        {
                error("Warp zone position with nonexisting target");
                return;
        }
-       if(self.enemy.aiment)
+       if(this.enemy.aiment)
        {
                // already is positioned
                error("Warp zone position targeting already oriented warpzone");
                return;
        }
-       self.enemy.aiment = self;
+       this.enemy.aiment = this;
 }
 
 void WarpZoneCamera_Think()
 {SELFPARAM();
-       if(self.warpzone_save_origin != self.origin
-       || self.warpzone_save_angles != self.angles
-       || self.warpzone_save_eorigin != self.enemy.origin
-       || self.warpzone_save_eangles != self.enemy.angles)
+       if(this.warpzone_save_origin != this.origin
+       || this.warpzone_save_angles != this.angles
+       || this.warpzone_save_eorigin != this.enemy.origin
+       || this.warpzone_save_eangles != this.enemy.angles)
        {
-               WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
-               self.warpzone_save_origin = self.origin;
-               self.warpzone_save_angles = self.angles;
-               self.warpzone_save_eorigin = self.enemy.origin;
-               self.warpzone_save_eangles = self.enemy.angles;
+               WarpZone_Camera_SetUp(this, this.enemy.origin, this.enemy.angles);
+               this.warpzone_save_origin = this.origin;
+               this.warpzone_save_angles = this.angles;
+               this.warpzone_save_eorigin = this.enemy.origin;
+               this.warpzone_save_eangles = this.enemy.angles;
        }
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 void WarpZoneCamera_InitStep_FindTarget()
 {SELFPARAM();
        entity e;
        float i;
-       if(self.target == "")
+       if(this.target == "")
        {
                error("Camera with no target");
                return;
        }
-       self.enemy = world;
-       for(e = world, i = 0; (e = find(e, targetname, self.target)); )
+       this.enemy = world;
+       for(e = world, i = 0; (e = find(e, targetname, this.target)); )
                if(random() * ++i < 1)
-                       self.enemy = e;
-       if(self.enemy == world)
+                       this.enemy = e;
+       if(this.enemy == world)
        {
                error("Camera with nonexisting target");
                return;
        }
        warpzone_cameras_exist = 1;
-       WarpZone_Camera_SetUp(self, self.enemy.origin, self.enemy.angles);
-       self.SendFlags = 0xFFFFFF;
-       if(self.spawnflags & 1)
+       WarpZone_Camera_SetUp(this, this.enemy.origin, this.enemy.angles);
+       this.SendFlags = 0xFFFFFF;
+       if(this.spawnflags & 1)
        {
-               self.think = WarpZoneCamera_Think;
-               self.nextthink = time;
+               this.think = WarpZoneCamera_Think;
+               this.nextthink = time;
        }
        else
-               self.nextthink = 0;
+               this.nextthink = 0;
 }
 
 void WarpZone_InitStep_UpdateTransform()
@@ -607,26 +608,26 @@ void WarpZone_InitStep_UpdateTransform()
        float i_s, i_t, n_t;
        string tex;
 
-       org = self.origin;
+       org = this.origin;
        if(org == '0 0 0')
-               org = 0.5 * (self.mins + self.maxs);
+               org = 0.5 * (this.mins + this.maxs);
 
        norm = point = '0 0 0';
        area = 0;
        for(i_s = 0; ; ++i_s)
        {
-               tex = getsurfacetexture(self, i_s);
+               tex = getsurfacetexture(this, i_s);
                if (!tex)
                        break; // this is beyond the last one
                if(tex == "textures/common/trigger" || tex == "trigger")
                        continue;
-               n_t = getsurfacenumtriangles(self, i_s);
+               n_t = getsurfacenumtriangles(this, i_s);
                for(i_t = 0; i_t < n_t; ++i_t)
                {
-                       tri = getsurfacetriangle(self, i_s, i_t);
-                       a = getsurfacepoint(self, i_s, tri.x);
-                       b = getsurfacepoint(self, i_s, tri.y);
-                       c = getsurfacepoint(self, i_s, tri.z);
+                       tri = getsurfacetriangle(this, i_s, i_t);
+                       a = getsurfacepoint(this, i_s, tri.x);
+                       b = getsurfacepoint(this, i_s, tri.y);
+                       c = getsurfacepoint(this, i_s, tri.z);
                        n = cross(c - a, b - a);
                        area = area + vlen(n);
                        norm = norm + n;
@@ -639,32 +640,32 @@ void WarpZone_InitStep_UpdateTransform()
                point = point * (1 / (3 * area));
                if(vdist(norm, <, 0.99))
                {
-                       LOG_INFO("trigger_warpzone near ", vtos(self.aiment.origin), " is nonplanar. BEWARE.\n");
+                       LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE.\n");
                        area = 0; // no autofixing in this case
                }
                norm = normalize(norm);
        }
 
        ang = '0 0 0';
-       if(self.aiment)
+       if(this.aiment)
        {
-               org = self.aiment.origin;
-               ang = self.aiment.angles;
+               org = this.aiment.origin;
+               ang = this.aiment.angles;
                if(area > 0)
                {
                        org = org - ((org - point) * norm) * norm; // project to plane
                        makevectors(ang);
                        if(norm * v_forward < 0)
                        {
-                               LOG_INFO("Position target of trigger_warpzone near ", vtos(self.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
+                               LOG_INFO("Position target of trigger_warpzone near ", vtos(this.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
                                norm = -1 * norm;
                        }
                        ang = vectoangles2(norm, v_up); // keep rotation, but turn exactly against plane
                        ang.x = -ang.x;
                        if(norm * v_forward < 0.99)
-                               LOG_INFO("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
-                       if(vdist(org - self.aiment.origin, >, 0.5))
-                               LOG_INFO("trigger_warpzone near ", vtos(self.aiment.origin), " has been moved to match the plane (", vtos(self.aiment.origin), " -> ", vtos(org), ").\n");
+                               LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang), "\n");
+                       if(vdist(org - this.aiment.origin, >, 0.5))
+                               LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been moved to match the plane (", vtos(this.aiment.origin), " -> ", vtos(org), ").\n");
                }
        }
        else if(area > 0)
@@ -676,15 +677,15 @@ void WarpZone_InitStep_UpdateTransform()
        else
                error("cannot infer origin/angles for this warpzone, please use a killtarget or a trigger_warpzone_position");
 
-       self.warpzone_origin = org;
-       self.warpzone_angles = ang;
+       this.warpzone_origin = org;
+       this.warpzone_angles = ang;
 }
 
 void WarpZone_InitStep_ClearTarget()
 {SELFPARAM();
-       if(self.enemy)
-               self.enemy.enemy = world;
-       self.enemy = world;
+       if(this.enemy)
+               this.enemy.enemy = world;
+       this.enemy = world;
 }
 
 entity warpzone_first; .entity warpzone_next;
@@ -693,51 +694,51 @@ void WarpZone_InitStep_FindTarget()
        float i;
        entity e, e2;
 
-       if(self.enemy)
+       if(this.enemy)
                return;
 
        // this way only one of the two ents needs to target
-       if(self.target != "")
+       if(this.target != "")
        {
-               self.enemy = self; // so the if(!e.enemy) check also skips self, saves one IF
+               this.enemy = this; // so the if(!e.enemy) check also skips this, saves one IF
 
                e2 = world;
-               for(e = world, i = 0; (e = find(e, targetname, self.target)); )
+               for(e = world, i = 0; (e = find(e, targetname, this.target)); )
                        if(!e.enemy)
-                               if(e.classname == self.classname) // possibly non-warpzones may use the same targetname!
+                               if(e.classname == this.classname) // possibly non-warpzones may use the same targetname!
                                        if(random() * ++i < 1)
                                                e2 = e;
                if(!e2)
                {
-                       self.enemy = world;
+                       this.enemy = world;
                        error("Warpzone with non-existing target");
                        return;
                }
-               self.enemy = e2;
-               e2.enemy = self;
+               this.enemy = e2;
+               e2.enemy = this;
        }
 }
 
 void WarpZone_Think();
 void WarpZone_InitStep_FinalizeTransform()
 {SELFPARAM();
-       if(!self.enemy || self.enemy.enemy != self)
+       if(!this.enemy || this.enemy.enemy != this)
        {
                error("Invalid warp zone detected. Killed.");
                return;
        }
 
        warpzone_warpzones_exist = 1;
-       WarpZone_SetUp(self, self.warpzone_origin, self.warpzone_angles, self.enemy.warpzone_origin, self.enemy.warpzone_angles);
-       self.touch = WarpZone_Touch;
-       self.SendFlags = 0xFFFFFF;
-       if(self.spawnflags & 1)
+       WarpZone_SetUp(this, this.warpzone_origin, this.warpzone_angles, this.enemy.warpzone_origin, this.enemy.warpzone_angles);
+       this.touch = WarpZone_Touch;
+       this.SendFlags = 0xFFFFFF;
+       if(this.spawnflags & 1)
        {
-               self.think = WarpZone_Think;
-               self.nextthink = time;
+               this.think = WarpZone_Think;
+               this.nextthink = time;
        }
        else
-               self.nextthink = 0;
+               this.nextthink = 0;
 }
 
 float warpzone_initialized;
@@ -748,8 +749,8 @@ entity warpzone_camera_first;
 spawnfunc(misc_warpzone_position)
 {
        // "target", "angles", "origin"
-       self.warpzone_next = warpzone_position_first;
-       warpzone_position_first = self;
+       this.warpzone_next = warpzone_position_first;
+       warpzone_position_first = this;
 }
 spawnfunc(trigger_warpzone_position)
 {
@@ -765,53 +766,55 @@ spawnfunc(trigger_warpzone)
        //              the map, with another killtarget to designate its
        //              orientation
 
-       if(!self.scale)
-               self.scale = self.modelscale;
-       if(!self.scale)
-               self.scale = 1;
+       if(!this.scale)
+               this.scale = this.modelscale;
+       if(!this.scale)
+               this.scale = 1;
        string m;
-       m = self.model;
+       m = this.model;
        WarpZoneLib_ExactTrigger_Init();
        if(m != "")
        {
                precache_model(m);
-               _setmodel(self, m); // no precision needed
+               _setmodel(this, m); // no precision needed
        }
-       setorigin(self, self.origin);
-       if(self.scale)
-               setsize(self, self.mins * self.scale, self.maxs * self.scale);
+       setorigin(this, this.origin);
+       if(this.scale)
+               setsize(this, this.mins * this.scale, this.maxs * this.scale);
        else
-               setsize(self, self.mins, self.maxs);
-       self.SendEntity = WarpZone_Send;
-       self.SendFlags = 0xFFFFFF;
-       BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
-       self.warpzone_next = warpzone_first;
-       warpzone_first = self;
+               setsize(this, this.mins, this.maxs);
+       this.SendEntity = SendEntity_self;
+       this.SendEntity3 = WarpZone_Send;
+       this.SendFlags = 0xFFFFFF;
+       BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
+       this.warpzone_next = warpzone_first;
+       warpzone_first = this;
 }
 spawnfunc(func_camera)
 {
-       if(!self.scale)
-               self.scale = self.modelscale;
-       if(!self.scale)
-               self.scale = 1;
-       if(self.model != "")
+       if(!this.scale)
+               this.scale = this.modelscale;
+       if(!this.scale)
+               this.scale = 1;
+       if(this.model != "")
        {
-               precache_model(self.model);
-               _setmodel(self, self.model); // no precision needed
+               precache_model(this.model);
+               _setmodel(this, this.model); // no precision needed
        }
-       setorigin(self, self.origin);
-       if(self.scale)
-               setsize(self, self.mins * self.scale, self.maxs * self.scale);
+       setorigin(this, this.origin);
+       if(this.scale)
+               setsize(this, this.mins * this.scale, this.maxs * this.scale);
        else
-               setsize(self, self.mins, self.maxs);
-       if(!self.solid)
-               self.solid = SOLID_BSP;
-       else if(self.solid < 0)
-               self.solid = SOLID_NOT;
-       self.SendEntity = WarpZone_Camera_Send;
-       self.SendFlags = 0xFFFFFF;
-       self.warpzone_next = warpzone_camera_first;
-       warpzone_camera_first = self;
+               setsize(this, this.mins, this.maxs);
+       if(!this.solid)
+               this.solid = SOLID_BSP;
+       else if(this.solid < 0)
+               this.solid = SOLID_NOT;
+       this.SendEntity = SendEntity_self;
+       this.SendEntity3 = WarpZone_Camera_Send;
+       this.SendFlags = 0xFFFFFF;
+       this.warpzone_next = warpzone_camera_first;
+       warpzone_camera_first = this;
 }
 void WarpZones_Reconnect()
 {SELFPARAM();
@@ -873,7 +876,7 @@ void WarpZone_StartFrame()
                if(warpzone_warpzones_exist)
                        WarpZone_StoreProjectileData(it);
 
-               if((IS_OBSERVER(it) || it.solid == SOLID_NOT))
+               if(IS_OBSERVER(it) || it.solid == SOLID_NOT)
                if(IS_CLIENT(it)) // we don't care about it being a bot
                {
                        other = it; // player
@@ -888,10 +891,13 @@ void WarpZone_StartFrame()
                        }
 
                        // teleporters
-                       setself(Teleport_Find(it.origin + it.mins, it.origin + it.maxs));
-                       if (self)
-                       if (!WarpZoneLib_ExactTrigger_Touch())
-                               Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
+                       if(other.teleportable)
+                       {
+                               setself(Teleport_Find(it.origin + it.mins, it.origin + it.maxs));
+                               if (self)
+                               if (!WarpZoneLib_ExactTrigger_Touch())
+                                       Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
+                       }
                }
        });
        setself(this);
@@ -933,7 +939,7 @@ void trigger_warpzone_reconnect_use()
 
 spawnfunc(trigger_warpzone_reconnect)
 {
-       self.use = trigger_warpzone_reconnect_use;
+       this.use = trigger_warpzone_reconnect_use;
 }
 
 spawnfunc(target_warpzone_reconnect)
@@ -941,15 +947,15 @@ spawnfunc(target_warpzone_reconnect)
        spawnfunc_trigger_warpzone_reconnect(this); // both names make sense here :(
 }
 
-void WarpZone_PlayerPhysics_FixVAngle()
-{SELFPARAM();
+void WarpZone_PlayerPhysics_FixVAngle(entity this)
+{
 #ifndef WARPZONE_DONT_FIX_VANGLE
-       if(IS_REAL_CLIENT(self))
-       if(self.v_angle.z <= 360) // if not already adjusted
-       if(time - self.ping * 0.001 < self.warpzone_teleport_time)
+       if(IS_REAL_CLIENT(this))
+       if(this.v_angle.z <= 360) // if not already adjusted
+       if(time - this.ping * 0.001 < this.warpzone_teleport_time)
        {
-               self.v_angle = WarpZone_TransformVAngles(self.warpzone_teleport_zone, self.v_angle);
-               self.v_angle_z += 720; // mark as adjusted
+               this.v_angle = WarpZone_TransformVAngles(this.warpzone_teleport_zone, this.v_angle);
+               this.v_angle_z += 720; // mark as adjusted
        }
 #endif
 }
index 0e0594a1ba403d0ea422a6e8a66a9f9e8a464ae7..db0ba59cc0c812f76a74290b110c2a6471ec13aa 100644 (file)
@@ -13,7 +13,7 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback();
 //const float ENT_CLIENT_WARPZONE;
 //const float ENT_CLIENT_WARPZONE_CAMERA;
 
-void WarpZone_PlayerPhysics_FixVAngle();
+void WarpZone_PlayerPhysics_FixVAngle(entity this);
 
 void WarpZone_PostInitialize_Callback();
 #endif
index 92c347a153dbd782b2a4828356f3015405ea8196..be232a28187af10a9f059ea2044eff531160be82 100644 (file)
 void WarpZoneLib_ExactTrigger_Init()
 {SELFPARAM();
        vector mi, ma;
-       if (self.movedir == '0 0 0')
-       if (self.angles != '0 0 0')
+       if (this.movedir == '0 0 0')
+       if (this.angles != '0 0 0')
        {
-               makevectors (self.angles);
-               self.movedir = v_forward;
+               makevectors (this.angles);
+               this.movedir = v_forward;
        }
-       if(self.model == "")
+       if(this.model == "")
        {
                // It's a box! No need to match with exacttriggers.
-               self.warpzone_isboxy = 1;
+               this.warpzone_isboxy = 1;
        }
        else
        {
-               mi = self.mins;
-               ma = self.maxs;
-               precache_model(self.model);
-               _setmodel(self, self.model);
+               mi = this.mins;
+               ma = this.maxs;
+               precache_model(this.model);
+               _setmodel(this, this.model);
                // let mapper-set mins/maxs override the model's bounds if set
                if(mi != '0 0 0' || ma != '0 0 0')
                {
                        // It's a box! No need to match with exacttriggers.
-                       self.mins = mi;
-                       self.maxs = ma;
-                       self.warpzone_isboxy = 1;
+                       this.mins = mi;
+                       this.maxs = ma;
+                       this.warpzone_isboxy = 1;
                }
        }
-       setorigin(self, self.origin);
-       if(self.scale)
-               setsize(self, self.mins * self.scale, self.maxs * self.scale);
+       setorigin(this, this.origin);
+       if(this.scale)
+               setsize(this, this.mins * this.scale, this.maxs * this.scale);
        else
-               setsize(self, self.mins, self.maxs);
-       self.movetype = MOVETYPE_NONE;
-       self.solid = SOLID_TRIGGER;
-       self.model = "";
+               setsize(this, this.mins, this.maxs);
+       this.movetype = MOVETYPE_NONE;
+       this.solid = SOLID_TRIGGER;
+       this.model = "";
 }
diff --git a/qcsrc/menu/_mod.inc b/qcsrc/menu/_mod.inc
new file mode 100644 (file)
index 0000000..589808e
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "draw.qc"
+#include "item.qc"
+#include "menu.qc"
diff --git a/qcsrc/menu/anim/_mod.inc b/qcsrc/menu/anim/_mod.inc
new file mode 100644 (file)
index 0000000..c8048a1
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "animation.qc"
+#include "animhost.qc"
+#include "easing.qc"
+#include "keyframe.qc"
index 3aa3e43057447ea63b43a8bb996d5881b36369f4..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 (file)
@@ -1,137 +1 @@
-#include "anim/animation.qc"
-#include "anim/animhost.qc"
-#include "anim/easing.qc"
-#include "anim/keyframe.qc"
 
-#include "item.qc"
-#include "item/borderimage.qc"
-#include "item/button.qc"
-#include "item/checkbox.qc"
-#include "item/container.qc"
-#include "item/dialog.qc"
-#include "item/image.qc"
-#include "item/inputbox.qc"
-#include "item/inputcontainer.qc"
-#include "item/label.qc"
-#include "item/listbox.qc"
-#include "item/modalcontroller.qc"
-#include "item/nexposee.qc"
-#include "item/radiobutton.qc"
-#include "item/slider.qc"
-#include "item/tab.qc"
-#include "item/textslider.qc"
-
-#include "xonotic/bigbutton.qc"
-#include "xonotic/bigcommandbutton.qc"
-#include "xonotic/button.qc"
-#include "xonotic/campaign.qc"
-#include "xonotic/charmap.qc"
-#include "xonotic/checkbox.qc"
-#include "xonotic/checkbox_slider_invalid.qc"
-#include "xonotic/checkbox_string.qc"
-#include "xonotic/colorbutton.qc"
-#include "xonotic/colorpicker.qc"
-#include "xonotic/colorpicker_string.qc"
-#include "xonotic/commandbutton.qc"
-#include "xonotic/credits.qc"
-#include "xonotic/crosshairpicker.qc"
-#include "xonotic/crosshairpreview.qc"
-#include "xonotic/cvarlist.qc"
-#include "xonotic/datasource.qc"
-#include "xonotic/demolist.qc"
-#include "xonotic/dialog.qc"
-#include "xonotic/dialog_credits.qc"
-#include "xonotic/dialog_firstrun.qc"
-#include "xonotic/dialog_hudpanel_ammo.qc"
-#include "xonotic/dialog_hudpanel_centerprint.qc"
-#include "xonotic/dialog_hudpanel_chat.qc"
-#include "xonotic/dialog_hudpanel_engineinfo.qc"
-#include "xonotic/dialog_hudpanel_healtharmor.qc"
-#include "xonotic/dialog_hudpanel_infomessages.qc"
-#include "xonotic/dialog_hudpanel_itemstime.qc"
-#include "xonotic/dialog_hudpanel_modicons.qc"
-#include "xonotic/dialog_hudpanel_notification.qc"
-#include "xonotic/dialog_hudpanel_physics.qc"
-#include "xonotic/dialog_hudpanel_powerups.qc"
-#include "xonotic/dialog_hudpanel_pressedkeys.qc"
-#include "xonotic/dialog_hudpanel_quickmenu.qc"
-#include "xonotic/dialog_hudpanel_racetimer.qc"
-#include "xonotic/dialog_hudpanel_radar.qc"
-#include "xonotic/dialog_hudpanel_score.qc"
-#include "xonotic/dialog_hudpanel_timer.qc"
-#include "xonotic/dialog_hudpanel_vote.qc"
-#include "xonotic/dialog_hudpanel_weapons.qc"
-#include "xonotic/dialog_hudsetup_exit.qc"
-#include "xonotic/dialog_monstertools.qc"
-#include "xonotic/dialog_multiplayer.qc"
-#include "xonotic/dialog_multiplayer_create.qc"
-#include "xonotic/dialog_multiplayer_create_mapinfo.qc"
-#include "xonotic/dialog_multiplayer_create_mutators.qc"
-#include "xonotic/dialog_multiplayer_join.qc"
-#include "xonotic/dialog_multiplayer_join_serverinfo.qc"
-#include "xonotic/dialog_multiplayer_media.qc"
-#include "xonotic/dialog_multiplayer_media_demo.qc"
-#include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
-#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
-#include "xonotic/dialog_multiplayer_media_musicplayer.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
-#include "xonotic/dialog_multiplayer_profile.qc"
-#include "xonotic/dialog_quit.qc"
-#include "xonotic/dialog_sandboxtools.qc"
-#include "xonotic/dialog_settings.qc"
-#include "xonotic/dialog_settings_audio.qc"
-#include "xonotic/dialog_settings_effects.qc"
-#include "xonotic/dialog_settings_game.qc"
-#include "xonotic/dialog_settings_game_crosshair.qc"
-#include "xonotic/dialog_settings_game_hudconfirm.qc"
-#include "xonotic/dialog_settings_game_hud.qc"
-#include "xonotic/dialog_settings_game_messages.qc"
-#include "xonotic/dialog_settings_game_model.qc"
-#include "xonotic/dialog_settings_game_view.qc"
-#include "xonotic/dialog_settings_game_weapons.qc"
-#include "xonotic/dialog_settings_input.qc"
-#include "xonotic/dialog_settings_input_userbind.qc"
-#include "xonotic/dialog_settings_misc.qc"
-#include "xonotic/dialog_settings_misc_cvars.qc"
-#include "xonotic/dialog_settings_misc_reset.qc"
-#include "xonotic/dialog_settings_user.qc"
-#include "xonotic/dialog_settings_user_languagewarning.qc"
-#include "xonotic/dialog_settings_video.qc"
-#include "xonotic/dialog_singleplayer.qc"
-#include "xonotic/dialog_singleplayer_winner.qc"
-#include "xonotic/dialog_teamselect.qc"
-#include "xonotic/gametypelist.qc"
-#include "xonotic/hudskinlist.qc"
-#include "xonotic/image.qc"
-#include "xonotic/inputbox.qc"
-#include "xonotic/keybinder.qc"
-#include "xonotic/languagelist.qc"
-#include "xonotic/listbox.qc"
-#include "xonotic/mainwindow.qc"
-#include "xonotic/maplist.qc"
-#include "xonotic/nexposee.qc"
-#include "xonotic/picker.qc"
-#include "xonotic/playerlist.qc"
-#include "xonotic/playermodel.qc"
-#include "xonotic/playlist.qc"
-#include "xonotic/radiobutton.qc"
-#include "xonotic/rootdialog.qc"
-#include "xonotic/screenshotimage.qc"
-#include "xonotic/screenshotlist.qc"
-#include "xonotic/serverlist.qc"
-#include "xonotic/skinlist.qc"
-#include "xonotic/slider.qc"
-#include "xonotic/slider_decibels.qc"
-#include "xonotic/slider_particles.qc"
-#include "xonotic/slider_picmip.qc"
-#include "xonotic/slider_resolution.qc"
-#include "xonotic/slider_sbfadetime.qc"
-#include "xonotic/soundlist.qc"
-#include "xonotic/statslist.qc"
-#include "xonotic/tabcontroller.qc"
-#include "xonotic/tab.qc"
-#include "xonotic/textlabel.qc"
-#include "xonotic/textslider.qc"
-#include "xonotic/weaponarenacheckbox.qc"
-#include "xonotic/weaponslist.qc"
diff --git a/qcsrc/menu/command/_mod.inc b/qcsrc/menu/command/_mod.inc
new file mode 100644 (file)
index 0000000..061d60a
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qc"
+#include "menu_cmd.qc"
diff --git a/qcsrc/menu/command/all.qc b/qcsrc/menu/command/all.qc
new file mode 100644 (file)
index 0000000..283cca0
--- /dev/null
@@ -0,0 +1 @@
+#include <common/command/all.qc>
index 6b944c90e419c1acf66357bbee5f009e1610986a..0f87cbb0959cb38df039f1cac70f796cabd0185b 100644 (file)
@@ -78,7 +78,7 @@ void GameCommand(string theCommand)
                {
                        LOG_INFO(_("Available options:\n"));
 
-                       FOREACH_ENTITY_ORDERED(it.name != "", LAMBDA(
+                       FOREACH_ENTITY_ORDERED(it.name != "", {
                                if (it.classname == "vtbl") continue;
                                string s = it.name;
                                if (filter)
@@ -87,7 +87,7 @@ void GameCommand(string theCommand)
                                        s = substring(s, strlen(filter), strlen(s) - strlen(filter));
                                }
                                LOG_INFOF(" %s\n", s);
-                       ));
+                       });
                }
                else if (argc == 2 && !isdemo())     // don't allow this command in demos
                {
index edac51ce7256311fa1bb19f97aef239f53635dd0..1d31e95a9c7d5c513ea9f2766da4c574a1d7eca3 100644 (file)
@@ -89,6 +89,8 @@
                return 0;  // unhandled
        }
 
+    void m_play_focus_sound();
+
        METHOD(Item, focusEnter, void(Item this))
        {
                if (this.allowFocusSound) m_play_focus_sound();
diff --git a/qcsrc/menu/item/_mod.inc b/qcsrc/menu/item/_mod.inc
new file mode 100644 (file)
index 0000000..a470788
--- /dev/null
@@ -0,0 +1,17 @@
+// generated file; do not modify
+#include "borderimage.qc"
+#include "button.qc"
+#include "checkbox.qc"
+#include "container.qc"
+#include "dialog.qc"
+#include "image.qc"
+#include "inputbox.qc"
+#include "inputcontainer.qc"
+#include "label.qc"
+#include "listbox.qc"
+#include "modalcontroller.qc"
+#include "nexposee.qc"
+#include "radiobutton.qc"
+#include "slider.qc"
+#include "tab.qc"
+#include "textslider.qc"
index e523a51937943b340b3e94f473c84e32b58753ae..913cdbe34b43f6bb068c7e8748e301da57386397 100644 (file)
@@ -671,6 +671,7 @@ void m_tooltip(vector pos)
 
 void m_draw(float width, float height)
 {
+       if (clientstate() == CS_DISCONNECTED) m_toggle(true);
        m_gamestatus();
 
        execute_next_frame();
@@ -877,10 +878,10 @@ void m_toggle(int mode)
 void Shutdown()
 {
        m_hide();
-       FOREACH_ENTITY_ORDERED(it.destroy, LAMBDA(
+       FOREACH_ENTITY_ORDERED(it.destroy, {
                if (it.classname == "vtbl") continue;
                it.destroy(it);
-       ));
+       });
 }
 
 void m_focus_item_chain(entity outermost, entity innermost)
diff --git a/qcsrc/menu/mutators/_mod.inc b/qcsrc/menu/mutators/_mod.inc
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
index b032f6e906f0405777ec2f7e9ca1991603ba40c8..57a34c36c7d9c0776876957a32968222b36e8f45 100644 (file)
@@ -1,16 +1,11 @@
-#include "../lib/_all.inc"
-
-#define world NULL
-
-#include "classes.inc"
-
-#include "draw.qc"
-#include "menu.qc"
-
-#include <common/command/all.qc>
-#include "command/menu_cmd.qc"
-
-#include "xonotic/util.qc"
+#include <lib/_all.inc>
+
+#include "_mod.inc"
+#include "anim/_mod.inc"
+#include "command/_mod.inc"
+#include "item/_mod.inc"
+#include "mutators/_mod.inc"
+#include "xonotic/_mod.inc"
 
 #include <common/_all.inc>
 
diff --git a/qcsrc/menu/xonotic/_mod.inc b/qcsrc/menu/xonotic/_mod.inc
new file mode 100644 (file)
index 0000000..4702bbf
--- /dev/null
@@ -0,0 +1,116 @@
+// generated file; do not modify
+#include "bigbutton.qc"
+#include "bigcommandbutton.qc"
+#include "button.qc"
+#include "campaign.qc"
+#include "charmap.qc"
+#include "checkbox.qc"
+#include "checkbox_slider_invalid.qc"
+#include "checkbox_string.qc"
+#include "colorbutton.qc"
+#include "colorpicker.qc"
+#include "colorpicker_string.qc"
+#include "commandbutton.qc"
+#include "credits.qc"
+#include "crosshairpicker.qc"
+#include "crosshairpreview.qc"
+#include "cvarlist.qc"
+#include "datasource.qc"
+#include "demolist.qc"
+#include "dialog.qc"
+#include "dialog_credits.qc"
+#include "dialog_firstrun.qc"
+#include "dialog_hudpanel_ammo.qc"
+#include "dialog_hudpanel_centerprint.qc"
+#include "dialog_hudpanel_chat.qc"
+#include "dialog_hudpanel_engineinfo.qc"
+#include "dialog_hudpanel_healtharmor.qc"
+#include "dialog_hudpanel_infomessages.qc"
+#include "dialog_hudpanel_itemstime.qc"
+#include "dialog_hudpanel_modicons.qc"
+#include "dialog_hudpanel_notification.qc"
+#include "dialog_hudpanel_physics.qc"
+#include "dialog_hudpanel_powerups.qc"
+#include "dialog_hudpanel_pressedkeys.qc"
+#include "dialog_hudpanel_quickmenu.qc"
+#include "dialog_hudpanel_racetimer.qc"
+#include "dialog_hudpanel_radar.qc"
+#include "dialog_hudpanel_score.qc"
+#include "dialog_hudpanel_timer.qc"
+#include "dialog_hudpanel_vote.qc"
+#include "dialog_hudpanel_weapons.qc"
+#include "dialog_hudsetup_exit.qc"
+#include "dialog_monstertools.qc"
+#include "dialog_multiplayer.qc"
+#include "dialog_multiplayer_create.qc"
+#include "dialog_multiplayer_create_mapinfo.qc"
+#include "dialog_multiplayer_create_mutators.qc"
+#include "dialog_multiplayer_join.qc"
+#include "dialog_multiplayer_join_serverinfo.qc"
+#include "dialog_multiplayer_media.qc"
+#include "dialog_multiplayer_media_demo.qc"
+#include "dialog_multiplayer_media_demo_startconfirm.qc"
+#include "dialog_multiplayer_media_demo_timeconfirm.qc"
+#include "dialog_multiplayer_media_musicplayer.qc"
+#include "dialog_multiplayer_media_screenshot.qc"
+#include "dialog_multiplayer_media_screenshot_viewer.qc"
+#include "dialog_multiplayer_profile.qc"
+#include "dialog_quit.qc"
+#include "dialog_sandboxtools.qc"
+#include "dialog_settings.qc"
+#include "dialog_settings_audio.qc"
+#include "dialog_settings_effects.qc"
+#include "dialog_settings_game.qc"
+#include "dialog_settings_game_crosshair.qc"
+#include "dialog_settings_game_hud.qc"
+#include "dialog_settings_game_hudconfirm.qc"
+#include "dialog_settings_game_messages.qc"
+#include "dialog_settings_game_model.qc"
+#include "dialog_settings_game_view.qc"
+#include "dialog_settings_game_weapons.qc"
+#include "dialog_settings_input.qc"
+#include "dialog_settings_input_userbind.qc"
+#include "dialog_settings_misc.qc"
+#include "dialog_settings_misc_cvars.qc"
+#include "dialog_settings_misc_reset.qc"
+#include "dialog_settings_user.qc"
+#include "dialog_settings_user_languagewarning.qc"
+#include "dialog_settings_video.qc"
+#include "dialog_singleplayer.qc"
+#include "dialog_singleplayer_winner.qc"
+#include "dialog_teamselect.qc"
+#include "gametypelist.qc"
+#include "hudskinlist.qc"
+#include "image.qc"
+#include "inputbox.qc"
+#include "keybinder.qc"
+#include "languagelist.qc"
+#include "listbox.qc"
+#include "mainwindow.qc"
+#include "maplist.qc"
+#include "nexposee.qc"
+#include "picker.qc"
+#include "playerlist.qc"
+#include "playermodel.qc"
+#include "playlist.qc"
+#include "radiobutton.qc"
+#include "rootdialog.qc"
+#include "screenshotimage.qc"
+#include "screenshotlist.qc"
+#include "serverlist.qc"
+#include "skinlist.qc"
+#include "slider.qc"
+#include "slider_decibels.qc"
+#include "slider_particles.qc"
+#include "slider_picmip.qc"
+#include "slider_resolution.qc"
+#include "slider_sbfadetime.qc"
+#include "soundlist.qc"
+#include "statslist.qc"
+#include "tab.qc"
+#include "tabcontroller.qc"
+#include "textlabel.qc"
+#include "textslider.qc"
+#include "util.qc"
+#include "weaponarenacheckbox.qc"
+#include "weaponslist.qc"
index c43605435e389cb13d1cbfb893d6fac48b43dcc7..a32f8b5832cf01e9ecccc534be2d794d6672118f 100644 (file)
@@ -11,9 +11,12 @@ const string STR_OBSERVER = "observer";
 #define IS_OBSERVER(v) ((v).classname == STR_OBSERVER)
 
 #define IS_CLIENT(v) (v.flags & FL_CLIENT)
+/** want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v)) */
 #define IS_BOT_CLIENT(v) (clienttype(v) == CLIENTTYPE_BOT)
+#define IS_FAKE_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT)
 #define IS_REAL_CLIENT(v) (clienttype(v) == CLIENTTYPE_REAL)
-#define IS_NOT_A_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT)
+/** was: (clienttype(v) == CLIENTTYPE_NOTACLIENT) */
+#define IS_NOT_A_CLIENT(v) (!IS_CLIENT(v))
 
 #define IS_MONSTER(v) (v.flags & FL_MONSTER)
 #define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE)
diff --git a/qcsrc/server/_mod.inc b/qcsrc/server/_mod.inc
new file mode 100644 (file)
index 0000000..d502c48
--- /dev/null
@@ -0,0 +1,32 @@
+// generated file; do not modify
+#include "anticheat.qc"
+#include "antilag.qc"
+#include "campaign.qc"
+#include "cheats.qc"
+#include "cl_client.qc"
+#include "cl_impulse.qc"
+#include "cl_player.qc"
+#include "g_damage.qc"
+#include "g_hook.qc"
+#include "g_lights.qc"
+#include "g_models.qc"
+#include "g_subs.qc"
+#include "g_world.qc"
+#include "ipban.qc"
+#include "item_key.qc"
+#include "mapvoting.qc"
+#include "miscfunctions.qc"
+#include "playerdemo.qc"
+#include "portals.qc"
+#include "race.qc"
+#include "round_handler.qc"
+#include "scores.qc"
+#include "scores_rules.qc"
+#include "spawnpoints.qc"
+#include "steerlib.qc"
+#include "sv_main.qc"
+#include "teamplay.qc"
+#include "tests.qc"
+#include "t_halflife.qc"
+#include "t_quake.qc"
+#include "t_quake3.qc"
index 560d7614ca49d35a98f80080763e5ee678d733bf..d5f8e39f756aa00a52b9a9c7b48371beabb9bd39 100644 (file)
@@ -85,7 +85,7 @@ void antilag_takeback(entity e, entity store, float t)
 {
        if (e.vehicle) {
            if (e.vehicle.vehicle_flags == VHF_PLAYERSLOT) return;
-               antilag_takeback(e.vehicle, store, t);
+               antilag_takeback(e.vehicle, e.vehicle, t);
     }
 
        if (!store.antilag_takenback)
diff --git a/qcsrc/server/bot/_all.inc b/qcsrc/server/bot/_all.inc
deleted file mode 100644 (file)
index 2965baa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "aim.qc"
-#include "bot.qc"
-#include "navigation.qc"
-#include "scripting.qc"
-#include "waypoints.qc"
-
-#include "havocbot/_all.inc"
diff --git a/qcsrc/server/bot/_mod.inc b/qcsrc/server/bot/_mod.inc
new file mode 100644 (file)
index 0000000..02ef867
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "aim.qc"
+#include "bot.qc"
+#include "navigation.qc"
+#include "scripting.qc"
+#include "waypoints.qc"
index 1b69658245781cc202cf826382145e21b6945f13..ef08e308c0223767729e93005e2df70b36d83a55 100644 (file)
@@ -43,8 +43,8 @@ entity bot_spawn()
        {
                currentbots = currentbots + 1;
                bot_setnameandstuff(bot);
-               WITH(entity, self, bot, ClientConnect());
-               WITH(entity, self, bot, PutClientInServer());
+               WITHSELF(bot, ClientConnect());
+               WITHSELF(bot, PutClientInServer());
        }
        return bot;
 }
diff --git a/qcsrc/server/bot/havocbot/_all.inc b/qcsrc/server/bot/havocbot/_all.inc
deleted file mode 100644 (file)
index 2dd8c74..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "havocbot.qc"
-#include "roles.qc"
diff --git a/qcsrc/server/bot/havocbot/_mod.inc b/qcsrc/server/bot/havocbot/_mod.inc
new file mode 100644 (file)
index 0000000..fa2d660
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "havocbot.qc"
+#include "roles.qc"
index bdf57569d5a606f8912901a9160d28f70985147f..77d410653afb6146aee016bd815e79a635cea4bb 100644 (file)
@@ -479,7 +479,7 @@ void bot_list_commands()
 void SV_ParseClientCommand(string s);
 float bot_cmd_cc(entity this)
 {
-       WITH(entity, self, this, SV_ParseClientCommand(bot_cmd.bot_cmd_parm_string));
+       WITHSELF(this, SV_ParseClientCommand(bot_cmd.bot_cmd_parm_string));
        return CMD_STATUS_FINISHED;
 }
 
index 7dab5ade00d9ade8b4fc8cd717fca0a531c85c47..933f4ac63c6cf2cb4452827b33aae1c185ec3f37 100644 (file)
@@ -97,7 +97,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        cheatcount_total += n; \
        e.cheatcount += n
 #define END_CHEAT_FUNCTION() \
-       ADD_CHEATS(self,cheating); \
+       ADD_CHEATS(this, cheating); \
        return attempting
 #define IS_CHEAT(i,argc,fr) \
        if((++attempting, !CheatsAllowed(i,argc,fr))) \
@@ -358,7 +358,7 @@ float CheatCommand(float argc)
                                                e.angles = fixedvectoangles2(trace_plane_normal, v_forward);
                                                e.angles = AnglesTransform_ApplyToAngles(e.angles, '-90 0 0'); // so unrotated models work
                                        }
-                                       WITH(entity, self, e, spawnfunc_func_breakable(e));
+                                       WITHSELF(e, spawnfunc_func_breakable(e));
                                        // now, is it valid?
                                        if(f == 0)
                                        {
@@ -736,10 +736,10 @@ float CheatFrame()
        switch(0)
        {
                default:
-                       if(self.maycheat || (gamestart_sv_cheats && autocvar_sv_cheats))
+                       if(this.maycheat || (gamestart_sv_cheats && autocvar_sv_cheats))
                        {
                                // use cheat dragging if cheats are enabled
-                               crosshair_trace_plusvisibletriggers(self);
+                               crosshair_trace_plusvisibletriggers(this);
                                Drag(true, true);
                        }
                        else
@@ -779,43 +779,43 @@ float Drag(float force_allow_pick, float ischeat)
        switch(0)
        {
                default:
-                       if(Drag_IsDragging(self))
+                       if(Drag_IsDragging(this))
                        {
-                               if(PHYS_INPUT_BUTTON_DRAG(self))
+                               if(PHYS_INPUT_BUTTON_DRAG(this))
                                {
-                                       if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
+                                       if(this.impulse == 10 || this.impulse == 15 || this.impulse == 18)
                                        {
-                                               Drag_MoveForward(self);
-                                               self.impulse = 0;
+                                               Drag_MoveForward(this);
+                                               this.impulse = 0;
                                        }
-                                       else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19)
+                                       else if(this.impulse == 12 || this.impulse == 16 || this.impulse == 19)
                                        {
-                                               Drag_MoveBackward(self);
-                                               self.impulse = 0;
+                                               Drag_MoveBackward(this);
+                                               this.impulse = 0;
                                        }
-                                       else if(self.impulse >= 1 && self.impulse <= 9)
+                                       else if(this.impulse >= 1 && this.impulse <= 9)
                                        {
-                                               Drag_SetSpeed(self, self.impulse - 1);
+                                               Drag_SetSpeed(this, this.impulse - 1);
                                        }
-                                       else if(self.impulse == 14)
+                                       else if(this.impulse == 14)
                                        {
-                                               Drag_SetSpeed(self, 9);
+                                               Drag_SetSpeed(this, 9);
                                        }
 
                                        if(frametime)
-                                               Drag_Update(self);
+                                               Drag_Update(this);
                                }
                                else
                                {
-                                       Drag_Finish(self);
+                                       Drag_Finish(this);
                                }
                        }
                        else
                        {
-                               if(Drag_CanDrag(self))
-                                       if(PHYS_INPUT_BUTTON_DRAG(self))
+                               if(Drag_CanDrag(this))
+                                       if(PHYS_INPUT_BUTTON_DRAG(this))
                                        {
-                                               crosshair_trace_plusvisibletriggers(self);
+                                               crosshair_trace_plusvisibletriggers(this);
                                                entity e = trace_ent;
                                                float pick = force_allow_pick;
                                                if (e && !pick)
@@ -825,18 +825,18 @@ float Drag(float force_allow_pick, float ischeat)
                                                        // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
                                                        // it goes out of range while slinging it around.
 
-                                                       if(vlen(self.origin - e.origin) <= autocvar_g_grab_range)
+                                                       if(vlen(this.origin - e.origin) <= autocvar_g_grab_range)
                                                        {
                                                                switch(e.grab)
                                                                {
                                                                        case 0: // can't grab
                                                                                break;
                                                                        case 1: // owner can grab
-                                                                               if(e.owner == self || e.realowner == self)
+                                                                               if(e.owner == this || e.realowner == this)
                                                                                        pick = true;
                                                                                break;
                                                                        case 2: // owner and team mates can grab
-                                                                               if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
+                                                                               if(SAME_TEAM(e.owner, this) || SAME_TEAM(e.realowner, this) || e.team == this.team)
                                                                                        pick = true;
                                                                                break;
                                                                        case 3: // anyone can grab
@@ -857,7 +857,7 @@ float Drag(float force_allow_pick, float ischeat)
                                                                        Drag_Finish(e.draggedby);
                                                                if(e.tag_entity)
                                                                        detach_sameorigin(e);
-                                                               Drag_Begin(self, e, trace_endpos);
+                                                               Drag_Begin(this, e, trace_endpos);
                                                                if(ischeat)
                                                                        DID_CHEAT();
                                                                return true;
@@ -1047,38 +1047,38 @@ void Drag_MoveDrag(entity from, entity to)
 
 void DragBox_Think()
 {SELFPARAM();
-       if(self.aiment && self.enemy)
+       if(this.aiment && this.enemy)
        {
-               self.origin_x = (self.aiment.origin.x + self.enemy.origin.x) * 0.5;
-               self.origin_y = (self.aiment.origin.y + self.enemy.origin.y) * 0.5;
-               self.origin_z = (self.aiment.origin.z + self.enemy.origin.z) * 0.5;
-               self.maxs_x = fabs(self.aiment.origin.x - self.enemy.origin.x) * 0.5;
-               self.maxs_y = fabs(self.aiment.origin.y - self.enemy.origin.y) * 0.5;
-               self.maxs_z = fabs(self.aiment.origin.z - self.enemy.origin.z) * 0.5;
-               self.mins = -1 * self.maxs;
-               setorigin(self, self.origin);
-               setsize(self, self.mins, self.maxs); // link edict
+               this.origin_x = (this.aiment.origin.x + this.enemy.origin.x) * 0.5;
+               this.origin_y = (this.aiment.origin.y + this.enemy.origin.y) * 0.5;
+               this.origin_z = (this.aiment.origin.z + this.enemy.origin.z) * 0.5;
+               this.maxs_x = fabs(this.aiment.origin.x - this.enemy.origin.x) * 0.5;
+               this.maxs_y = fabs(this.aiment.origin.y - this.enemy.origin.y) * 0.5;
+               this.maxs_z = fabs(this.aiment.origin.z - this.enemy.origin.z) * 0.5;
+               this.mins = -1 * this.maxs;
+               setorigin(this, this.origin);
+               setsize(this, this.mins, this.maxs); // link edict
        }
 
-       if(self.cnt == -1) // actually race_place -1
+       if(this.cnt == -1) // actually race_place -1
        {
                // show "10 10" for qualifying spawns
-               setmodel(self.killindicator, MDL_NUM(10));
-               setmodel(self.killindicator.killindicator, MDL_NUM(10));
+               setmodel(this.killindicator, MDL_NUM(10));
+               setmodel(this.killindicator.killindicator, MDL_NUM(10));
        }
-       else if(self.cnt == -2) // actually race_place 0
+       else if(this.cnt == -2) // actually race_place 0
        {
                // show "10 0" for loser spawns
-               setmodel(self.killindicator, MDL_NUM(10));
-               setmodel(self.killindicator.killindicator, MDL_NUM(0));
+               setmodel(this.killindicator, MDL_NUM(10));
+               setmodel(this.killindicator.killindicator, MDL_NUM(0));
        }
        else
        {
-               setmodel(self.killindicator, MDL_NUM(self.cnt % 10));
-               setmodel(self.killindicator.killindicator, MDL_NUM(floor(self.cnt / 10)));
+               setmodel(this.killindicator, MDL_NUM(this.cnt % 10));
+               setmodel(this.killindicator.killindicator, MDL_NUM(floor(this.cnt / 10)));
        }
 
-       self.nextthink = time;
+       this.nextthink = time;
 }
 
 #endif
index 8a6eefe86ce153670d8af307cdb9d594396852f7..9edcf8d5f0806097e3ea7b058d28e4f4c8e662ad 100644 (file)
 
 STATIC_METHOD(Client, Add, void(Client this, int _team))
 {
-    WITH(entity, self, this, ClientConnect());
+    WITHSELF(this, ClientConnect());
     TRANSMUTE(Player, this);
     this.frame = 12; // 7
     this.team = _team;
-    WITH(entity, self, this, PutClientInServer());
+    WITHSELF(this, PutClientInServer());
 }
 
 void PutObserverInServer();
@@ -68,7 +68,8 @@ void ClientDisconnect();
 STATIC_METHOD(Client, Remove, void(Client this))
 {
     TRANSMUTE(Observer, this);
-    WITH(entity, self, this, PutClientInServer(); ClientDisconnect());
+    WITHSELF(this, PutClientInServer());
+    WITHSELF(this, ClientDisconnect());
 }
 
 void send_CSQC_teamnagger() {
@@ -607,7 +608,7 @@ void PutClientInServer()
                        string s = spot.target;
                        spot.target = string_null;
                        WITH(entity, activator, this, LAMBDA(
-                               WITH(entity, self, spot, SUB_UseTargets())
+                               WITHSELF(spot, SUB_UseTargets())
                        ));
                        spot.target = s;
                }
@@ -671,18 +672,18 @@ void ClientInit_misc()
                WriteString(channel, world.fog);
        else
                WriteString(channel, "");
-       WriteByte(channel, self.count * 255.0); // g_balance_armor_blockpercent
+       WriteByte(channel, this.count * 255.0); // g_balance_armor_blockpercent
        WriteByte(channel, serverflags); // client has to know if it should zoom or not
        WriteCoord(channel, autocvar_g_trueaim_minrange);
 }
 
 void ClientInit_CheckUpdate()
 {SELFPARAM();
-       self.nextthink = time;
-       if(self.count != autocvar_g_balance_armor_blockpercent)
+       this.nextthink = time;
+       if(this.count != autocvar_g_balance_armor_blockpercent)
        {
-               self.count = autocvar_g_balance_armor_blockpercent;
-               self.SendFlags |= 1;
+               this.count = autocvar_g_balance_armor_blockpercent;
+               this.SendFlags |= 1;
        }
 }
 
@@ -693,7 +694,7 @@ void ClientInit_Spawn()
        e.think = ClientInit_CheckUpdate;
        Net_LinkEntity(e, false, 0, ClientInit_SendEntity);
 
-       WITH(entity, self, e, ClientInit_CheckUpdate());
+       WITHSELF(e, ClientInit_CheckUpdate());
 }
 
 /*
@@ -717,7 +718,7 @@ SetChangeParms
 void SetChangeParms ()
 {SELFPARAM();
        // save parms for level change
-       parm1 = self.parm_idlesince - time;
+       parm1 = this.parm_idlesince - time;
 
        MUTATOR_CALLHOOK(SetChangeParms);
 }
@@ -759,35 +760,35 @@ void ClientKill_Now_TeamChange(entity this)
        {
                if(blockSpectators)
                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
-               WITH(entity, self, this, PutObserverInServer());
+               WITHSELF(this, PutObserverInServer());
        }
        else
-               WITH(entity, self, this, SV_ChangeTeam(this.killindicator_teamchange - 1));
+               WITHSELF(this, SV_ChangeTeam(this.killindicator_teamchange - 1));
        this.killindicator_teamchange = 0;
 }
 
 void ClientKill_Now()
 {SELFPARAM();
-       if(self.vehicle)
+       if(this.vehicle)
        {
            vehicles_exit(VHEF_RELEASE);
-           if(!self.killindicator_teamchange)
+           if(!this.killindicator_teamchange)
            {
-            self.vehicle_health = -1;
-            Damage(self, self, self, 1 , DEATH_KILL.m_id, self.origin, '0 0 0');
+            this.vehicle_health = -1;
+            Damage(this, this, this, 1 , DEATH_KILL.m_id, this.origin, '0 0 0');
            }
        }
 
-       if(self.killindicator && !wasfreed(self.killindicator))
-               remove(self.killindicator);
+       if(this.killindicator && !wasfreed(this.killindicator))
+               remove(this.killindicator);
 
-       self.killindicator = world;
+       this.killindicator = world;
 
-       if(self.killindicator_teamchange)
-               ClientKill_Now_TeamChange(self);
+       if(this.killindicator_teamchange)
+               ClientKill_Now_TeamChange(this);
 
-       if(IS_PLAYER(self))
-               Damage(self, self, self, 100000, DEATH_KILL.m_id, self.origin, '0 0 0');
+       if(IS_PLAYER(this))
+               Damage(this, this, this, 100000, DEATH_KILL.m_id, this.origin, '0 0 0');
 
        // now I am sure the player IS dead
 }
@@ -795,39 +796,39 @@ void KillIndicator_Think()
 {SELFPARAM();
        if (gameover)
        {
-               self.owner.killindicator = world;
-               remove(self);
+               this.owner.killindicator = world;
+               remove(this);
                return;
        }
 
-       if (self.owner.alpha < 0 && !self.owner.vehicle)
+       if (this.owner.alpha < 0 && !this.owner.vehicle)
        {
-               self.owner.killindicator = world;
-               remove(self);
+               this.owner.killindicator = world;
+               remove(this);
                return;
        }
 
-       if(self.cnt <= 0)
+       if(this.cnt <= 0)
        {
-               WITH(entity, self, self.owner, ClientKill_Now());
+               WITHSELF(this.owner, ClientKill_Now());
                return;
        }
-    else if(g_cts && self.health == 1) // health == 1 means that it's silent
+    else if(g_cts && this.health == 1) // health == 1 means that it's silent
     {
-        self.nextthink = time + 1;
-        self.cnt -= 1;
+        this.nextthink = time + 1;
+        this.cnt -= 1;
     }
        else
        {
-               if(self.cnt <= 10)
-                       setmodel(self, MDL_NUM(self.cnt));
-               if(IS_REAL_CLIENT(self.owner))
+               if(this.cnt <= 10)
+                       setmodel(this, MDL_NUM(this.cnt));
+               if(IS_REAL_CLIENT(this.owner))
                {
-                       if(self.cnt <= 10)
-                               { Send_Notification(NOTIF_ONE, self.owner, MSG_ANNCE, Announcer_PickNumber(CNT_KILL, self.cnt)); }
+                       if(this.cnt <= 10)
+                               { Send_Notification(NOTIF_ONE, this.owner, MSG_ANNCE, Announcer_PickNumber(CNT_KILL, this.cnt)); }
                }
-               self.nextthink = time + 1;
-               self.cnt -= 1;
+               this.nextthink = time + 1;
+               this.cnt -= 1;
        }
 }
 
@@ -846,20 +847,20 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
        if(g_race_qualifying || g_cts)
                killtime = 0;
 
-    if(MUTATOR_CALLHOOK(ClientKill, self, killtime))
+    if(MUTATOR_CALLHOOK(ClientKill, this, killtime))
        return;
 
-       self.killindicator_teamchange = targetteam;
+       this.killindicator_teamchange = targetteam;
 
-    if(!self.killindicator)
+    if(!this.killindicator)
        {
-               if(!IS_DEAD(self))
+               if(!IS_DEAD(this))
                {
-                       killtime = max(killtime, self.clientkill_nexttime - time);
-                       self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
+                       killtime = max(killtime, this.clientkill_nexttime - time);
+                       this.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
                }
 
-               if(killtime <= 0 || !IS_PLAYER(self) || IS_DEAD(self))
+               if(killtime <= 0 || !IS_PLAYER(this) || IS_DEAD(this))
                {
                        ClientKill_Now();
                }
@@ -867,21 +868,21 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
                {
                        starttime = max(time, clientkilltime);
 
-                       self.killindicator = spawn();
-                       self.killindicator.owner = self;
-                       self.killindicator.scale = 0.5;
-                       setattachment(self.killindicator, self, "");
-                       setorigin(self.killindicator, '0 0 52');
-                       self.killindicator.think = KillIndicator_Think;
-                       self.killindicator.nextthink = starttime + (self.lip) * 0.05;
-                       clientkilltime = max(clientkilltime, self.killindicator.nextthink + 0.05);
-                       self.killindicator.cnt = ceil(killtime);
-                       self.killindicator.count = bound(0, ceil(killtime), 10);
-                       //sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n"));
+                       this.killindicator = spawn();
+                       this.killindicator.owner = this;
+                       this.killindicator.scale = 0.5;
+                       setattachment(this.killindicator, this, "");
+                       setorigin(this.killindicator, '0 0 52');
+                       this.killindicator.think = KillIndicator_Think;
+                       this.killindicator.nextthink = starttime + (this.lip) * 0.05;
+                       clientkilltime = max(clientkilltime, this.killindicator.nextthink + 0.05);
+                       this.killindicator.cnt = ceil(killtime);
+                       this.killindicator.count = bound(0, ceil(killtime), 10);
+                       //sprint(this, strcat("^1You'll be dead in ", ftos(this.killindicator.cnt), " seconds\n"));
 
                        for(e = world; (e = find(e, classname, "body")) != world; )
                        {
-                               if(e.enemy != self)
+                               if(e.enemy != this)
                                        continue;
                                e.killindicator = spawn();
                                e.killindicator.owner = e;
@@ -893,38 +894,38 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
                                clientkilltime = max(clientkilltime, e.killindicator.nextthink + 0.05);
                                e.killindicator.cnt = ceil(killtime);
                        }
-                       self.lip = 0;
+                       this.lip = 0;
                }
        }
-       if(self.killindicator)
+       if(this.killindicator)
        {
                if(targetteam == 0) // just die
                {
-                       self.killindicator.colormod = '0 0 0';
-                       if(IS_REAL_CLIENT(self))
-                       if(self.killindicator.cnt > 0)
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SUICIDE, self.killindicator.cnt);
+                       this.killindicator.colormod = '0 0 0';
+                       if(IS_REAL_CLIENT(this))
+                       if(this.killindicator.cnt > 0)
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_TEAMCHANGE_SUICIDE, this.killindicator.cnt);
                }
                else if(targetteam == -1) // auto
                {
-                       self.killindicator.colormod = '0 1 0';
-                       if(IS_REAL_CLIENT(self))
-                       if(self.killindicator.cnt > 0)
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_AUTO, self.killindicator.cnt);
+                       this.killindicator.colormod = '0 1 0';
+                       if(IS_REAL_CLIENT(this))
+                       if(this.killindicator.cnt > 0)
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_TEAMCHANGE_AUTO, this.killindicator.cnt);
                }
                else if(targetteam == -2) // spectate
                {
-                       self.killindicator.colormod = '0.5 0.5 0.5';
-                       if(IS_REAL_CLIENT(self))
-                       if(self.killindicator.cnt > 0)
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SPECTATE, self.killindicator.cnt);
+                       this.killindicator.colormod = '0.5 0.5 0.5';
+                       if(IS_REAL_CLIENT(this))
+                       if(this.killindicator.cnt > 0)
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_TEAMCHANGE_SPECTATE, this.killindicator.cnt);
                }
                else
                {
-                       self.killindicator.colormod = Team_ColorRGB(targetteam);
-                       if(IS_REAL_CLIENT(self))
-                       if(self.killindicator.cnt > 0)
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, APP_TEAM_NUM(targetteam, CENTER_TEAMCHANGE), self.killindicator.cnt);
+                       this.killindicator.colormod = Team_ColorRGB(targetteam);
+                       if(IS_REAL_CLIENT(this))
+                       if(this.killindicator.cnt > 0)
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, APP_TEAM_NUM(targetteam, CENTER_TEAMCHANGE), this.killindicator.cnt);
                }
        }
 
@@ -933,8 +934,8 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
 void ClientKill ()
 {SELFPARAM();
        if(gameover) return;
-       if(self.player_blocked) return;
-       if(STAT(FROZEN, self)) return;
+       if(this.player_blocked) return;
+       if(STAT(FROZEN, this)) return;
 
        ClientKill_TeamChange(0);
 }
@@ -985,9 +986,9 @@ void ClientPreConnect ()
        if(autocvar_sv_eventlog)
        {
                GameLogEcho(sprintf(":connect:%d:%d:%s",
-                       self.playerid,
-                       etof(self),
-                       ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot")
+                       this.playerid,
+                       etof(this),
+                       ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot")
                ));
        }
 }
@@ -1143,7 +1144,7 @@ void ClientConnect()
                sv_notice_join(this);
 
        FOREACH_ENTITY_FLOAT(init_for_player_needed, true, {
-               WITH(entity, self, it, it.init_for_player(it));
+               WITHSELF(it, it.init_for_player(it));
        });
 
        MUTATOR_CALLHOOK(ClientConnect, this);
@@ -1176,15 +1177,15 @@ void ClientDisconnect()
 
        ClientState_detach(this);
 
-       Portal_ClearAll(self);
+       Portal_ClearAll(this);
 
-       Unfreeze(self);
+       Unfreeze(this);
 
-       RemoveGrapplingHook(self);
+       RemoveGrapplingHook(this);
 
        // Here, everything has been done that requires this player to be a client.
 
-       self.flags &= ~FL_CLIENT;
+       this.flags &= ~FL_CLIENT;
 
        if (this.chatbubbleentity) remove(this.chatbubbleentity);
        if (this.killindicator) remove(this.killindicator);
@@ -1193,10 +1194,10 @@ void ClientDisconnect()
 
        bot_relinkplayerlist();
 
-       if (self.netname_previous) strunzone(self.netname_previous);
-       if (self.clientstatus) strunzone(self.clientstatus);
-       if (self.weaponorder_byimpulse) strunzone(self.weaponorder_byimpulse);
-       if (self.personal) remove(self.personal);
+       if (this.netname_previous) strunzone(this.netname_previous);
+       if (this.clientstatus) strunzone(this.clientstatus);
+       if (this.weaponorder_byimpulse) strunzone(this.weaponorder_byimpulse);
+       if (this.personal) remove(this.personal);
 
        this.playerid = 0;
        ReadyCount();
@@ -1205,49 +1206,49 @@ void ClientDisconnect()
 
 void ChatBubbleThink()
 {SELFPARAM();
-       self.nextthink = time;
-       if ((self.owner.alpha < 0) || self.owner.chatbubbleentity != self)
+       this.nextthink = time;
+       if ((this.owner.alpha < 0) || this.owner.chatbubbleentity != this)
        {
-               if(self.owner) // but why can that ever be world?
-                       self.owner.chatbubbleentity = world;
-               remove(self);
+               if(this.owner) // but why can that ever be world?
+                       this.owner.chatbubbleentity = world;
+               remove(this);
                return;
        }
 
-       self.mdl = "";
+       this.mdl = "";
 
-       if ( !IS_DEAD(self.owner) && IS_PLAYER(self.owner) )
+       if ( !IS_DEAD(this.owner) && IS_PLAYER(this.owner) )
        {
-               if ( self.owner.active_minigame )
-                       self.mdl = "models/sprites/minigame_busy.iqm";
-               else if (PHYS_INPUT_BUTTON_CHAT(self.owner))
-                       self.mdl = "models/misc/chatbubble.spr";
+               if ( this.owner.active_minigame )
+                       this.mdl = "models/sprites/minigame_busy.iqm";
+               else if (PHYS_INPUT_BUTTON_CHAT(this.owner))
+                       this.mdl = "models/misc/chatbubble.spr";
        }
 
-       if ( self.model != self.mdl )
-               _setmodel(self, self.mdl);
+       if ( this.model != this.mdl )
+               _setmodel(this, this.mdl);
 
 }
 
 void UpdateChatBubble()
 {SELFPARAM();
-       if (self.alpha < 0)
+       if (this.alpha < 0)
                return;
        // spawn a chatbubble entity if needed
-       if (!self.chatbubbleentity)
-       {
-               self.chatbubbleentity = new(chatbubbleentity);
-               self.chatbubbleentity.owner = self;
-               self.chatbubbleentity.exteriormodeltoclient = self;
-               self.chatbubbleentity.think = ChatBubbleThink;
-               self.chatbubbleentity.nextthink = time;
-               setmodel(self.chatbubbleentity, MDL_CHAT); // precision set below
-               //setorigin(self.chatbubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1');
-               setorigin(self.chatbubbleentity, '0 0 15' + self.maxs_z * '0 0 1');
-               setattachment(self.chatbubbleentity, self, "");  // sticks to moving player better, also conserves bandwidth
-               self.chatbubbleentity.mdl = self.chatbubbleentity.model;
-               //self.chatbubbleentity.model = "";
-               self.chatbubbleentity.effects = EF_LOWPRECISION;
+       if (!this.chatbubbleentity)
+       {
+               this.chatbubbleentity = new(chatbubbleentity);
+               this.chatbubbleentity.owner = this;
+               this.chatbubbleentity.exteriormodeltoclient = this;
+               this.chatbubbleentity.think = ChatBubbleThink;
+               this.chatbubbleentity.nextthink = time;
+               setmodel(this.chatbubbleentity, MDL_CHAT); // precision set below
+               //setorigin(this.chatbubbleentity, this.origin + '0 0 15' + this.maxs_z * '0 0 1');
+               setorigin(this.chatbubbleentity, '0 0 15' + this.maxs_z * '0 0 1');
+               setattachment(this.chatbubbleentity, this, "");  // sticks to moving player better, also conserves bandwidth
+               this.chatbubbleentity.mdl = this.chatbubbleentity.model;
+               //this.chatbubbleentity.model = "";
+               this.chatbubbleentity.effects = EF_LOWPRECISION;
        }
 }
 
@@ -1257,163 +1258,163 @@ void UpdateChatBubble()
 /*void UpdateColorModHack()
 {
        float c;
-       c = self.clientcolors & 15;
+       c = this.clientcolors & 15;
        // LordHavoc: only bothering to support white, green, red, yellow, blue
-            if (!teamplay) self.colormod = '0 0 0';
-       else if (c ==  0) self.colormod = '1.00 1.00 1.00';
-       else if (c ==  3) self.colormod = '0.10 1.73 0.10';
-       else if (c ==  4) self.colormod = '1.73 0.10 0.10';
-       else if (c == 12) self.colormod = '1.22 1.22 0.10';
-       else if (c == 13) self.colormod = '0.10 0.10 1.73';
-       else self.colormod = '1 1 1';
+            if (!teamplay) this.colormod = '0 0 0';
+       else if (c ==  0) this.colormod = '1.00 1.00 1.00';
+       else if (c ==  3) this.colormod = '0.10 1.73 0.10';
+       else if (c ==  4) this.colormod = '1.73 0.10 0.10';
+       else if (c == 12) this.colormod = '1.22 1.22 0.10';
+       else if (c == 13) this.colormod = '0.10 0.10 1.73';
+       else this.colormod = '1 1 1';
 }*/
 
 void respawn()
 {SELFPARAM();
-       if(self.alpha >= 0 && autocvar_g_respawn_ghosts)
-       {
-               self.solid = SOLID_NOT;
-               self.takedamage = DAMAGE_NO;
-               self.movetype = MOVETYPE_FLY;
-               self.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
-               self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
-               self.effects |= CSQCMODEL_EF_RESPAWNGHOST;
-               Send_Effect(EFFECT_RESPAWN_GHOST, self.origin, '0 0 0', 1);
+       if(this.alpha >= 0 && autocvar_g_respawn_ghosts)
+       {
+               this.solid = SOLID_NOT;
+               this.takedamage = DAMAGE_NO;
+               this.movetype = MOVETYPE_FLY;
+               this.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
+               this.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
+               this.effects |= CSQCMODEL_EF_RESPAWNGHOST;
+               Send_Effect(EFFECT_RESPAWN_GHOST, this.origin, '0 0 0', 1);
                if(autocvar_g_respawn_ghosts_maxtime)
-                       SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
+                       SUB_SetFade (this, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
        }
 
-       CopyBody(self, 1);
+       CopyBody(this, 1);
 
-       self.effects |= EF_NODRAW; // prevent another CopyBody
+       this.effects |= EF_NODRAW; // prevent another CopyBody
        PutClientInServer();
 }
 
 void play_countdown(float finished, Sound samp)
 {SELFPARAM();
     TC(Sound, samp);
-       if(IS_REAL_CLIENT(self))
+       if(IS_REAL_CLIENT(this))
                if(floor(finished - time - frametime) != floor(finished - time))
                        if(finished - time < 6)
-                               sound (self, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
+                               sound (this, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
 }
 
 void player_powerups ()
 {SELFPARAM();
        // add a way to see what the items were BEFORE all of these checks for the mutator hook
-       int items_prev = self.items;
+       int items_prev = this.items;
 
-       if((self.items & IT_USING_JETPACK) && !IS_DEAD(self) && !gameover)
-               self.modelflags |= MF_ROCKET;
+       if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !gameover)
+               this.modelflags |= MF_ROCKET;
        else
-               self.modelflags &= ~MF_ROCKET;
+               this.modelflags &= ~MF_ROCKET;
 
-       self.effects &= ~(EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+       this.effects &= ~(EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
 
-       if((self.alpha < 0 || IS_DEAD(self)) && !self.vehicle) // don't apply the flags if the player is gibbed
+       if((this.alpha < 0 || IS_DEAD(this)) && !this.vehicle) // don't apply the flags if the player is gibbed
                return;
 
-       Fire_ApplyDamage(self);
-       Fire_ApplyEffect(self);
+       Fire_ApplyDamage(this);
+       Fire_ApplyEffect(this);
 
        if (!g_instagib)
        {
-               if (self.items & ITEM_Strength.m_itemid)
+               if (this.items & ITEM_Strength.m_itemid)
                {
-                       play_countdown(self.strength_finished, SND_POWEROFF);
-                       self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
-                       if (time > self.strength_finished)
+                       play_countdown(this.strength_finished, SND_POWEROFF);
+                       this.effects = this.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
+                       if (time > this.strength_finished)
                        {
-                               self.items = self.items - (self.items & ITEM_Strength.m_itemid);
-                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_STRENGTH, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_STRENGTH);
+                               this.items = this.items - (this.items & ITEM_Strength.m_itemid);
+                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_STRENGTH, this.netname);
+                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERDOWN_STRENGTH);
                        }
                }
                else
                {
-                       if (time < self.strength_finished)
+                       if (time < this.strength_finished)
                        {
-                               self.items = self.items | ITEM_Strength.m_itemid;
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_STRENGTH, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_STRENGTH);
+                               this.items = this.items | ITEM_Strength.m_itemid;
+                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname);
+                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_STRENGTH);
                        }
                }
-               if (self.items & ITEM_Shield.m_itemid)
+               if (this.items & ITEM_Shield.m_itemid)
                {
-                       play_countdown(self.invincible_finished, SND_POWEROFF);
-                       self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
-                       if (time > self.invincible_finished)
+                       play_countdown(this.invincible_finished, SND_POWEROFF);
+                       this.effects = this.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
+                       if (time > this.invincible_finished)
                        {
-                               self.items = self.items - (self.items & ITEM_Shield.m_itemid);
-                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_SHIELD, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SHIELD);
+                               this.items = this.items - (this.items & ITEM_Shield.m_itemid);
+                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_SHIELD, this.netname);
+                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERDOWN_SHIELD);
                        }
                }
                else
                {
-                       if (time < self.invincible_finished)
+                       if (time < this.invincible_finished)
                        {
-                               self.items = self.items | ITEM_Shield.m_itemid;
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SHIELD, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SHIELD);
+                               this.items = this.items | ITEM_Shield.m_itemid;
+                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SHIELD, this.netname);
+                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_SHIELD);
                        }
                }
-               if (self.items & IT_SUPERWEAPON)
+               if (this.items & IT_SUPERWEAPON)
                {
-                       if (!(self.weapons & WEPSET_SUPERWEAPONS))
+                       if (!(this.weapons & WEPSET_SUPERWEAPONS))
                        {
-                               self.superweapons_finished = 0;
-                               self.items = self.items - (self.items & IT_SUPERWEAPON);
-                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_LOST, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_SUPERWEAPON_LOST);
+                               this.superweapons_finished = 0;
+                               this.items = this.items - (this.items & IT_SUPERWEAPON);
+                               //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname);
+                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_LOST);
                        }
-                       else if (self.items & IT_UNLIMITED_SUPERWEAPONS)
+                       else if (this.items & IT_UNLIMITED_SUPERWEAPONS)
                        {
                                // don't let them run out
                        }
                        else
                        {
-                               play_countdown(self.superweapons_finished, SND_POWEROFF);
-                               if (time > self.superweapons_finished)
+                               play_countdown(this.superweapons_finished, SND_POWEROFF);
+                               if (time > this.superweapons_finished)
                                {
-                                       self.items = self.items - (self.items & IT_SUPERWEAPON);
-                                       self.weapons &= ~WEPSET_SUPERWEAPONS;
-                                       //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_BROKEN, self.netname);
-                                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
+                                       this.items = this.items - (this.items & IT_SUPERWEAPON);
+                                       this.weapons &= ~WEPSET_SUPERWEAPONS;
+                                       //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname);
+                                       Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
                                }
                        }
                }
-               else if(self.weapons & WEPSET_SUPERWEAPONS)
+               else if(this.weapons & WEPSET_SUPERWEAPONS)
                {
-                       if (time < self.superweapons_finished || (self.items & IT_UNLIMITED_SUPERWEAPONS))
+                       if (time < this.superweapons_finished || (this.items & IT_UNLIMITED_SUPERWEAPONS))
                        {
-                               self.items = self.items | IT_SUPERWEAPON;
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_PICKUP, self.netname);
-                               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
+                               this.items = this.items | IT_SUPERWEAPON;
+                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
+                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
                        }
                        else
                        {
-                               self.superweapons_finished = 0;
-                               self.weapons &= ~WEPSET_SUPERWEAPONS;
+                               this.superweapons_finished = 0;
+                               this.weapons &= ~WEPSET_SUPERWEAPONS;
                        }
                }
                else
                {
-                       self.superweapons_finished = 0;
+                       this.superweapons_finished = 0;
                }
        }
 
        if(autocvar_g_nodepthtestplayers)
-               self.effects = self.effects | EF_NODEPTHTEST;
+               this.effects = this.effects | EF_NODEPTHTEST;
 
        if(autocvar_g_fullbrightplayers)
-               self.effects = self.effects | EF_FULLBRIGHT;
+               this.effects = this.effects | EF_FULLBRIGHT;
 
        if (time >= game_starttime)
-       if (time < self.spawnshieldtime)
-               self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
+       if (time < this.spawnshieldtime)
+               this.effects = this.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
 
-       MUTATOR_CALLHOOK(PlayerPowerups, self, items_prev);
+       MUTATOR_CALLHOOK(PlayerPowerups, this, items_prev);
 }
 
 float CalcRegen(float current, float stable, float regenfactor, float regenframetime)
@@ -1477,7 +1478,7 @@ void player_regen ()
        regen_health_stable = autocvar_g_balance_health_regenstable;
        regen_health_rotstable = autocvar_g_balance_health_rotstable;
        if(!MUTATOR_CALLHOOK(PlayerRegen))
-       if(!STAT(FROZEN, self))
+       if(!STAT(FROZEN, this))
        {
                float mina, maxa, limith, limita;
                maxa = autocvar_g_balance_armor_rotstable;
@@ -1495,21 +1496,21 @@ void player_regen ()
                limith = limith * limit_mod;
                limita = limita * limit_mod;
 
-               self.armorvalue = CalcRotRegen(self.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
-               self.health = CalcRotRegen(self.health, regen_health_stable, regen_health, regen_health_linear, regen_mod * frametime * (time > self.pauseregen_finished), regen_health_rotstable, regen_health_rot, regen_health_rotlinear, rot_mod * frametime * (time > self.pauserothealth_finished), limith);
+               this.armorvalue = CalcRotRegen(this.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > this.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > this.pauserotarmor_finished), limita);
+               this.health = CalcRotRegen(this.health, regen_health_stable, regen_health, regen_health_linear, regen_mod * frametime * (time > this.pauseregen_finished), regen_health_rotstable, regen_health_rot, regen_health_rotlinear, rot_mod * frametime * (time > this.pauserothealth_finished), limith);
        }
 
        // if player rotted to death...  die!
        // check this outside above checks, as player may still be able to rot to death
-       if(self.health < 1)
+       if(this.health < 1)
        {
-               if(self.vehicle)
+               if(this.vehicle)
                        vehicles_exit(VHEF_RELEASE);
-               if(self.event_damage)
-                       self.event_damage(self, self, self, 1, DEATH_ROT.m_id, self.origin, '0 0 0');
+               if(this.event_damage)
+                       this.event_damage(this, this, this, 1, DEATH_ROT.m_id, this.origin, '0 0 0');
        }
 
-       if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+       if (!(this.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                float minf, maxf, limitf;
 
@@ -1517,19 +1518,19 @@ void player_regen ()
                minf = autocvar_g_balance_fuel_regenstable;
                limitf = autocvar_g_balance_fuel_limit;
 
-               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
+               this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
        }
 }
 
-float zoomstate_set;
+bool zoomstate_set;
 void SetZoomState(float z)
 {SELFPARAM();
-       if(z != self.zoomstate)
+       if(z != this.zoomstate)
        {
-               self.zoomstate = z;
-               ClientData_Touch(self);
+               this.zoomstate = z;
+               ClientData_Touch(this);
        }
-       zoomstate_set = 1;
+       zoomstate_set = true;
 }
 
 void GetPressedKeys()
@@ -1632,12 +1633,12 @@ void SpectateCopy(entity this, entity spectatee)
 
 bool SpectateUpdate()
 {SELFPARAM();
-       if(!self.enemy)
+       if(!this.enemy)
            return false;
 
-       if(!IS_PLAYER(self.enemy) || self == self.enemy)
+       if(!IS_PLAYER(this.enemy) || this == this.enemy)
        {
-               SetSpectatee(self, NULL);
+               SetSpectatee(this, NULL);
                return false;
        }
 
@@ -1648,14 +1649,14 @@ bool SpectateUpdate()
 
 bool SpectateSet()
 {SELFPARAM();
-       if(!IS_PLAYER(self.enemy))
+       if(!IS_PLAYER(this.enemy))
                return false;
 
-       msg_entity = self;
+       msg_entity = this;
        WriteByte(MSG_ONE, SVC_SETVIEW);
-       WriteEntity(MSG_ONE, self.enemy);
-       self.movetype = MOVETYPE_NONE;
-       accuracy_resend(self);
+       WriteEntity(MSG_ONE, this.enemy);
+       this.movetype = MOVETYPE_NONE;
+       accuracy_resend(this);
 
        if(!SpectateUpdate())
                PutObserverInServer();
@@ -1677,24 +1678,24 @@ void SetSpectatee(entity player, entity spectatee)
 
 bool Spectate(entity pl)
 {SELFPARAM();
-       if(MUTATOR_CALLHOOK(SpectateSet, self, pl))
+       if(MUTATOR_CALLHOOK(SpectateSet, this, pl))
                return false;
        pl = spec_player;
 
-       SetSpectatee(self, pl);
+       SetSpectatee(this, pl);
        return SpectateSet();
 }
 
 bool SpectateNext()
 {SELFPARAM();
-       other = find(self.enemy, classname, STR_PLAYER);
+       other = find(this.enemy, classname, STR_PLAYER);
 
-       if (MUTATOR_CALLHOOK(SpectateNext, self, other))
+       if (MUTATOR_CALLHOOK(SpectateNext, this, other))
                other = spec_player;
        else if (!other)
                other = find(other, classname, STR_PLAYER);
 
-       if(other) { SetSpectatee(self, other); }
+       if(other) { SetSpectatee(this, other); }
 
        return SpectateSet();
 }
@@ -1708,11 +1709,11 @@ bool SpectatePrev()
 
        entity first = other;
        // skip players until current spectated player
-       if(self.enemy)
-       while(other && other != self.enemy)
+       if(this.enemy)
+       while(other && other != this.enemy)
                other = other.chain;
 
-       switch (MUTATOR_CALLHOOK(SpectatePrev, self, other, first))
+       switch (MUTATOR_CALLHOOK(SpectatePrev, this, other, first))
        {
                case MUT_SPECPREV_FOUND:
                    other = spec_player;
@@ -1731,7 +1732,7 @@ bool SpectatePrev()
                }
        }
 
-       SetSpectatee(self, other);
+       SetSpectatee(this, other);
        return SpectateSet();
 }
 
@@ -1745,51 +1746,51 @@ Update a respawn countdown display.
 void ShowRespawnCountdown()
 {SELFPARAM();
        float number;
-       if(!IS_DEAD(self)) // just respawned?
+       if(!IS_DEAD(this)) // just respawned?
                return;
        else
        {
-               number = ceil(self.respawn_time - time);
+               number = ceil(this.respawn_time - time);
                if(number <= 0)
                        return;
-               if(number <= self.respawn_countdown)
+               if(number <= this.respawn_countdown)
                {
-                       self.respawn_countdown = number - 1;
-                       if(ceil(self.respawn_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
-                               { Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(CNT_RESPAWN, number)); }
+                       this.respawn_countdown = number - 1;
+                       if(ceil(this.respawn_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
+                               { Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_RESPAWN, number)); }
                }
        }
 }
 
 void LeaveSpectatorMode()
 {SELFPARAM();
-       if(self.caplayer)
+       if(this.caplayer)
                return;
-       if(nJoinAllowed(self, self))
+       if(nJoinAllowed(this, this))
        {
-               if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || (self.wasplayer && autocvar_g_changeteam_banned) || self.team_forced > 0)
+               if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || (this.wasplayer && autocvar_g_changeteam_banned) || this.team_forced > 0)
                {
-                       TRANSMUTE(Player, self);
+                       TRANSMUTE(Player, this);
 
                        if(autocvar_g_campaign || autocvar_g_balance_teams)
-                               { JoinBestTeam(self, false, true); }
+                               { JoinBestTeam(this, false, true); }
 
                        if(autocvar_g_campaign)
                                { campaign_bots_may_start = true; }
 
-                       Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_PREVENT_JOIN);
+                       Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_PREVENT_JOIN);
 
                        PutClientInServer();
 
-                       if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), self.netname); }
+                       if(IS_PLAYER(this)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), this.netname); }
                }
                else
-                       stuffcmd(self, "menu_showteamselect\n");
+                       stuffcmd(this, "menu_showteamselect\n");
        }
        else
        {
                // Player may not join because g_maxplayers is set
-               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT);
+               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT);
        }
 }
 
@@ -1840,92 +1841,92 @@ bool nJoinAllowed(entity this, entity ignore)
  */
 void checkSpectatorBlock()
 {SELFPARAM();
-       if(IS_SPEC(self) || IS_OBSERVER(self))
-       if(!self.caplayer)
-       if(IS_REAL_CLIENT(self))
+       if(IS_SPEC(this) || IS_OBSERVER(this))
+       if(!this.caplayer)
+       if(IS_REAL_CLIENT(this))
        {
-               if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
-                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
-                       dropclient(self);
+               if( time > (this.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
+                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
+                       dropclient(this);
                }
        }
 }
 
-void PrintWelcomeMessage()
-{SELFPARAM();
-       if(self.motd_actived_time == 0)
+void PrintWelcomeMessage(entity this)
+{
+       if(this.motd_actived_time == 0)
        {
                if (autocvar_g_campaign) {
-                       if ((IS_PLAYER(self) && PHYS_INPUT_BUTTON_INFO(self)) || (!IS_PLAYER(self))) {
-                               self.motd_actived_time = time;
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, campaign_message);
+                       if ((IS_PLAYER(this) && PHYS_INPUT_BUTTON_INFO(this)) || (!IS_PLAYER(this))) {
+                               this.motd_actived_time = time;
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, campaign_message);
                        }
                } else {
-                       if (PHYS_INPUT_BUTTON_INFO(self)) {
-                               self.motd_actived_time = time;
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
+                       if (PHYS_INPUT_BUTTON_INFO(this)) {
+                               this.motd_actived_time = time;
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
                        }
                }
        }
-       else if(self.motd_actived_time > 0) // showing MOTD or campaign message
+       else if(this.motd_actived_time > 0) // showing MOTD or campaign message
        {
                if (autocvar_g_campaign) {
-                       if (PHYS_INPUT_BUTTON_INFO(self))
-                               self.motd_actived_time = time;
-                       else if ((time - self.motd_actived_time > 2) && IS_PLAYER(self)) { // hide it some seconds after BUTTON_INFO has been released
-                               self.motd_actived_time = 0;
-                               Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_MOTD);
+                       if (PHYS_INPUT_BUTTON_INFO(this))
+                               this.motd_actived_time = time;
+                       else if ((time - this.motd_actived_time > 2) && IS_PLAYER(this)) { // hide it some seconds after BUTTON_INFO has been released
+                               this.motd_actived_time = 0;
+                               Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
                        }
                } else {
-                       if (PHYS_INPUT_BUTTON_INFO(self))
-                               self.motd_actived_time = time;
-                       else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
-                               self.motd_actived_time = 0;
-                               Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_MOTD);
+                       if (PHYS_INPUT_BUTTON_INFO(this))
+                               this.motd_actived_time = time;
+                       else if (time - this.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
+                               this.motd_actived_time = 0;
+                               Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
                        }
                }
        }
-       else //if(self.motd_actived_time < 0) // just connected, motd is active
+       else //if(this.motd_actived_time < 0) // just connected, motd is active
        {
-               if(PHYS_INPUT_BUTTON_INFO(self)) // BUTTON_INFO hides initial MOTD
-                       self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
-               else if(self.motd_actived_time == -2 || IS_PLAYER(self) || IS_SPEC(self))
+               if(PHYS_INPUT_BUTTON_INFO(this)) // BUTTON_INFO hides initial MOTD
+                       this.motd_actived_time = -2; // wait until BUTTON_INFO gets released
+               else if(this.motd_actived_time == -2 || IS_PLAYER(this) || IS_SPEC(this))
                {
                        // instanctly hide MOTD
-                       self.motd_actived_time = 0;
-                       Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_MOTD);
+                       this.motd_actived_time = 0;
+                       Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
                }
        }
 }
 
 void ObserverThink()
 {SELFPARAM();
-       if ( self.impulse )
+       if ( this.impulse )
        {
-               MinigameImpulse(self, self.impulse);
-               self.impulse = 0;
+               MinigameImpulse(this, this.impulse);
+               this.impulse = 0;
        }
        float prefered_movetype;
-       if (self.flags & FL_JUMPRELEASED) {
-               if (PHYS_INPUT_BUTTON_JUMP(self) && !self.version_mismatch) {
-                       self.flags &= ~FL_JUMPRELEASED;
-                       self.flags |= FL_SPAWNING;
-               } else if(PHYS_INPUT_BUTTON_ATCK(self) && !self.version_mismatch) {
-                       self.flags &= ~FL_JUMPRELEASED;
+       if (this.flags & FL_JUMPRELEASED) {
+               if (PHYS_INPUT_BUTTON_JUMP(this) && !this.version_mismatch) {
+                       this.flags &= ~FL_JUMPRELEASED;
+                       this.flags |= FL_SPAWNING;
+               } else if(PHYS_INPUT_BUTTON_ATCK(this) && !this.version_mismatch) {
+                       this.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext()) {
-                               TRANSMUTE(Spectator, self);
+                               TRANSMUTE(Spectator, this);
                        }
                } else {
-                       prefered_movetype = ((!PHYS_INPUT_BUTTON_USE(self) ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
-                       if (self.movetype != prefered_movetype)
-                               self.movetype = prefered_movetype;
+                       prefered_movetype = ((!PHYS_INPUT_BUTTON_USE(this) ? this.cvar_cl_clippedspectating : !this.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
+                       if (this.movetype != prefered_movetype)
+                               this.movetype = prefered_movetype;
                }
        } else {
-               if (!(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self))) {
-                       self.flags |= FL_JUMPRELEASED;
-                       if(self.flags & FL_SPAWNING)
+               if (!(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this))) {
+                       this.flags |= FL_JUMPRELEASED;
+                       if(this.flags & FL_SPAWNING)
                        {
-                               self.flags &= ~FL_SPAWNING;
+                               this.flags &= ~FL_SPAWNING;
                                LeaveSpectatorMode();
                                return;
                        }
@@ -1935,47 +1936,47 @@ void ObserverThink()
 
 void SpectatorThink()
 {SELFPARAM();
-       if ( self.impulse )
+       if ( this.impulse )
        {
-               if(MinigameImpulse(self, self.impulse))
-                       self.impulse = 0;
-       }
-       if (self.flags & FL_JUMPRELEASED) {
-               if (PHYS_INPUT_BUTTON_JUMP(self) && !self.version_mismatch) {
-                       self.flags &= ~FL_JUMPRELEASED;
-                       self.flags |= FL_SPAWNING;
-               } else if(PHYS_INPUT_BUTTON_ATCK(self) || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
-                       self.flags &= ~FL_JUMPRELEASED;
+               if(MinigameImpulse(this, this.impulse))
+                       this.impulse = 0;
+       }
+       if (this.flags & FL_JUMPRELEASED) {
+               if (PHYS_INPUT_BUTTON_JUMP(this) && !this.version_mismatch) {
+                       this.flags &= ~FL_JUMPRELEASED;
+                       this.flags |= FL_SPAWNING;
+               } else if(PHYS_INPUT_BUTTON_ATCK(this) || this.impulse == 10 || this.impulse == 15 || this.impulse == 18 || (this.impulse >= 200 && this.impulse <= 209)) {
+                       this.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext()) {
-                               TRANSMUTE(Spectator, self);
+                               TRANSMUTE(Spectator, this);
                        } else {
-                               TRANSMUTE(Observer, self);
+                               TRANSMUTE(Observer, this);
                                PutClientInServer();
                        }
-                       self.impulse = 0;
-               } else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19 || (self.impulse >= 220 && self.impulse <= 229)) {
-                       self.flags &= ~FL_JUMPRELEASED;
+                       this.impulse = 0;
+               } else if(this.impulse == 12 || this.impulse == 16  || this.impulse == 19 || (this.impulse >= 220 && this.impulse <= 229)) {
+                       this.flags &= ~FL_JUMPRELEASED;
                        if(SpectatePrev()) {
-                               TRANSMUTE(Spectator, self);
+                               TRANSMUTE(Spectator, this);
                        } else {
-                               TRANSMUTE(Observer, self);
+                               TRANSMUTE(Observer, this);
                                PutClientInServer();
                        }
-                       self.impulse = 0;
-               } else if (PHYS_INPUT_BUTTON_ATCK2(self)) {
-                       self.flags &= ~FL_JUMPRELEASED;
-                       TRANSMUTE(Observer, self);
+                       this.impulse = 0;
+               } else if (PHYS_INPUT_BUTTON_ATCK2(this)) {
+                       this.flags &= ~FL_JUMPRELEASED;
+                       TRANSMUTE(Observer, this);
                        PutClientInServer();
                } else {
                        if(!SpectateUpdate())
                                PutObserverInServer();
                }
        } else {
-               if (!(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self))) {
-                       self.flags |= FL_JUMPRELEASED;
-                       if(self.flags & FL_SPAWNING)
+               if (!(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this))) {
+                       this.flags |= FL_JUMPRELEASED;
+                       if(this.flags & FL_SPAWNING)
                        {
-                               self.flags &= ~FL_SPAWNING;
+                               this.flags &= ~FL_SPAWNING;
                                LeaveSpectatorMode();
                                return;
                        }
@@ -1984,16 +1985,16 @@ void SpectatorThink()
                        PutObserverInServer();
        }
 
-       self.flags |= FL_CLIENT | FL_NOTARGET;
+       this.flags |= FL_CLIENT | FL_NOTARGET;
 }
 
 void vehicles_enter (entity pl, entity veh);
 void PlayerUseKey()
 {SELFPARAM();
-       if (!IS_PLAYER(self))
+       if (!IS_PLAYER(this))
                return;
 
-       if(self.vehicle)
+       if(this.vehicle)
        {
                if(!gameover)
                {
@@ -2003,23 +2004,23 @@ void PlayerUseKey()
        }
        else if(autocvar_g_vehicles_enter)
        {
-               if(!STAT(FROZEN, self))
-               if(!IS_DEAD(self))
+               if(!STAT(FROZEN, this))
+               if(!IS_DEAD(this))
                if(!gameover)
                {
                        entity head, closest_target = world;
-                       head = WarpZone_FindRadius(self.origin, autocvar_g_vehicles_enter_radius, true);
+                       head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true);
 
                        while(head) // find the closest acceptable target to enter
                        {
                                if(head.vehicle_flags & VHF_ISVEHICLE)
                                if(!IS_DEAD(head))
-                               if(!head.owner || ((head.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(head.owner, self)))
+                               if(!head.owner || ((head.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(head.owner, this)))
                                if(head.takedamage != DAMAGE_NO)
                                {
                                        if(closest_target)
                                        {
-                                               if(vlen(self.origin - head.origin) < vlen(self.origin - closest_target.origin))
+                                               if(vlen(this.origin - head.origin) < vlen(this.origin - closest_target.origin))
                                                { closest_target = head; }
                                        }
                                        else { closest_target = head; }
@@ -2028,7 +2029,7 @@ void PlayerUseKey()
                                head = head.chain;
                        }
 
-                       if(closest_target) { vehicles_enter(self, closest_target); return; }
+                       if(closest_target) { vehicles_enter(this, closest_target); return; }
                }
        }
 
@@ -2049,372 +2050,317 @@ void() nexball_setstatus;
 .float last_vehiclecheck;
 .int items_added;
 void PlayerPreThink ()
-{SELFPARAM();
-       WarpZone_PlayerPhysics_FixVAngle();
+{
+    SELFPARAM();
+       WarpZone_PlayerPhysics_FixVAngle(this);
 
-       self.stat_game_starttime = game_starttime;
-       self.stat_round_starttime = round_starttime;
-       self.stat_allow_oldvortexbeam = autocvar_g_allow_oldvortexbeam;
-       self.stat_leadlimit = autocvar_leadlimit;
+    STAT(GAMESTARTTIME, this) = game_starttime;
+       STAT(ROUNDSTARTTIME, this) = round_starttime;
+       STAT(ALLOW_OLDVORTEXBEAM, this) = autocvar_g_allow_oldvortexbeam;
+       STAT(LEADLIMIT, this) = autocvar_leadlimit;
 
-       self.weaponsinmap = weaponsInMap;
+       STAT(WEAPONSINMAP, this) = weaponsInMap;
 
-       if(frametime)
-       {
+       if (frametime) {
                // physics frames: update anticheat stuff
-               anticheat_prethink(self);
+               anticheat_prethink(this);
        }
 
-       if(blockSpectators && frametime)
-               // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
+       if (blockSpectators && frametime) {
+               // WORKAROUND: only use dropclient in server frames (frametime set).
+               // Never use it in cl_movement frames (frametime zero).
                checkSpectatorBlock();
+    }
 
-       zoomstate_set = 0;
-
-       // Savage: Check for nameless players
-       if (isInvisibleString(self.netname)) {
-               string new_name = strzone(strcat("Player@", ftos(self.playerid)));
-               if(autocvar_sv_eventlog)
-                       GameLogEcho(strcat(":name:", ftos(self.playerid), ":", new_name));
-               if(self.netname_previous)
-                       strunzone(self.netname_previous);
-               self.netname_previous = strzone(new_name);
-               self.netname = self.netname_previous;
-               // stuffcmd(self, strcat("name ", self.netname, "\n"));
-       } else if(self.netname_previous != self.netname) {
-               if(autocvar_sv_eventlog)
-                       GameLogEcho(strcat(":name:", ftos(self.playerid), ":", self.netname));
-               if(self.netname_previous)
-                       strunzone(self.netname_previous);
-               self.netname_previous = strzone(self.netname);
+       zoomstate_set = false;
+
+       // Check for nameless players
+       if (isInvisibleString(this.netname)) {
+               this.netname = strzone(sprintf("Player#%d", this.playerid));
+               // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
+       }
+       if (this.netname != this.netname_previous) {
+               if (autocvar_sv_eventlog) {
+                       GameLogEcho(strcat(":name:", ftos(this.playerid), ":", this.netname));
+        }
+               if (this.netname_previous) strunzone(this.netname_previous);
+               this.netname_previous = strzone(this.netname);
        }
 
        // version nagging
-       if(self.version_nagtime)
-               if(self.cvar_g_xonoticversion)
-                       if(time > self.version_nagtime)
-                       {
-                               // don't notify git users
-                               if(strstrofs(self.cvar_g_xonoticversion, "git", 0) < 0 && strstrofs(self.cvar_g_xonoticversion, "autobuild", 0) < 0)
-                               {
-                                       if(strstrofs(autocvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(autocvar_g_xonoticversion, "autobuild", 0) >= 0)
-                                       {
-                                               // notify release users if connecting to git
-                                               LOG_TRACE("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
-                                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, self.cvar_g_xonoticversion);
-                                       }
-                                       else
-                                       {
-                                               float r;
-                                               r = vercmp(self.cvar_g_xonoticversion, autocvar_g_xonoticversion);
-                                               if(r < 0)
-                                               {
-                                                       // give users new version
-                                                       LOG_TRACE("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n");
-                                                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, self.cvar_g_xonoticversion);
-                                               }
-                                               else if(r > 0)
-                                               {
-                                                       // notify users about old server version
-                                                       LOG_INFO("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
-                                                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, self.cvar_g_xonoticversion);
-                                               }
-                                       }
-                               }
-                               self.version_nagtime = 0;
-                       }
+       if (this.version_nagtime && this.cvar_g_xonoticversion && time > this.version_nagtime) {
+        this.version_nagtime = 0;
+        if (strstrofs(this.cvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(this.cvar_g_xonoticversion, "autobuild", 0) >= 0) {
+            // git client
+        } else if (strstrofs(autocvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(autocvar_g_xonoticversion, "autobuild", 0) >= 0) {
+            // git server
+            Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, this.cvar_g_xonoticversion);
+        } else {
+            int r = vercmp(this.cvar_g_xonoticversion, autocvar_g_xonoticversion);
+            if (r < 0) { // old client
+                Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, this.cvar_g_xonoticversion);
+            } else if (r > 0) { // old server
+                Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, this.cvar_g_xonoticversion);
+            }
+        }
+    }
 
        // GOD MODE info
-       if(!(self.flags & FL_GODMODE)) if(self.max_armorvalue)
+       if (!(this.flags & FL_GODMODE) && this.max_armorvalue)
        {
-               Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_GODMODE_OFF, self.max_armorvalue);
-               self.max_armorvalue = 0;
+               Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_GODMODE_OFF, this.max_armorvalue);
+               this.max_armorvalue = 0;
        }
 
-       if(STAT(FROZEN, self) == 2)
+       if (STAT(FROZEN, this) == 2)
        {
-               self.revive_progress = bound(0, self.revive_progress + frametime * self.revive_speed, 1);
-               self.health = max(1, self.revive_progress * start_health);
-               self.iceblock.alpha = bound(0.2, 1 - self.revive_progress, 1);
+               this.revive_progress = bound(0, this.revive_progress + frametime * this.revive_speed, 1);
+               this.health = max(1, this.revive_progress * start_health);
+               this.iceblock.alpha = bound(0.2, 1 - this.revive_progress, 1);
 
-               if(self.revive_progress >= 1)
-                       Unfreeze(self);
+               if (this.revive_progress >= 1)
+                       Unfreeze(this);
        }
-       else if(STAT(FROZEN, self) == 3)
+       else if (STAT(FROZEN, this) == 3)
        {
-               self.revive_progress = bound(0, self.revive_progress - frametime * self.revive_speed, 1);
-               self.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * self.revive_progress );
+               this.revive_progress = bound(0, this.revive_progress - frametime * this.revive_speed, 1);
+               this.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * this.revive_progress );
 
-               if(self.health < 1)
+               if (this.health < 1)
                {
-                       if(self.vehicle)
+                       if (this.vehicle)
                                vehicles_exit(VHEF_RELEASE);
-                       self.event_damage(self, self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, self.origin, '0 0 0');
+                       this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, this.origin, '0 0 0');
                }
-               else if ( self.revive_progress <= 0 )
-                       Unfreeze(self);
+               else if (this.revive_progress <= 0)
+                       Unfreeze(this);
        }
 
        MUTATOR_CALLHOOK(PlayerPreThink);
 
        if(autocvar_g_vehicles_enter)
-       if(time > self.last_vehiclecheck)
-       if(IS_PLAYER(self))
+       if(time > this.last_vehiclecheck)
+       if(IS_PLAYER(this))
        if(!gameover)
-       if(!STAT(FROZEN, self))
-       if(!self.vehicle)
-       if(!IS_DEAD(self))
+       if(!STAT(FROZEN, this))
+       if(!this.vehicle)
+       if(!IS_DEAD(this))
        {
                entity veh;
                for(veh = world; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); )
-               if(vlen(veh.origin - self.origin) < autocvar_g_vehicles_enter_radius)
+               if(vlen(veh.origin - this.origin) < autocvar_g_vehicles_enter_radius)
                if(!IS_DEAD(veh))
                if(veh.takedamage != DAMAGE_NO)
-               if((veh.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(veh.owner, self))
-                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);
+               if((veh.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(veh.owner, this))
+                       Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);
                else if(!veh.owner)
-               if(!veh.team || SAME_TEAM(self, veh))
-                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_VEHICLE_ENTER);
+               if(!veh.team || SAME_TEAM(this, veh))
+                       Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER);
                else if(autocvar_g_vehicles_steal)
-                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_VEHICLE_ENTER_STEAL);
+                       Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_STEAL);
 
-               self.last_vehiclecheck = time + 1;
+               this.last_vehiclecheck = time + 1;
        }
 
-       if(!self.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
+       if(!this.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
        {
-               if(PHYS_INPUT_BUTTON_USE(self) && !self.usekeypressed)
+               if(PHYS_INPUT_BUTTON_USE(this) && !this.usekeypressed)
                        PlayerUseKey();
-               self.usekeypressed = PHYS_INPUT_BUTTON_USE(self);
+               this.usekeypressed = PHYS_INPUT_BUTTON_USE(this);
        }
 
-       if(IS_REAL_CLIENT(self))
-               PrintWelcomeMessage();
-
-       if(IS_PLAYER(self))
-       {
+       if (IS_REAL_CLIENT(this))
+               PrintWelcomeMessage(this);
 
+       if (IS_PLAYER(this)) {
                CheckRules_Player();
 
-               if (intermission_running)
-               {
-                       IntermissionThink ();   // otherwise a button could be missed between
-                       return;                                 // the think tics
+               if (intermission_running) {
+                       IntermissionThink();
+                       return;
                }
 
-               //don't allow the player to turn around while game is paused!
-               if(timeout_status == TIMEOUT_ACTIVE) {
+               if (timeout_status == TIMEOUT_ACTIVE) {
+            // don't allow the player to turn around while game is paused
                        // FIXME turn this into CSQC stuff
-                       self.v_angle = self.lastV_angle;
-                       self.angles = self.lastV_angle;
-                       self.fixangle = true;
+                       this.v_angle = this.lastV_angle;
+                       this.angles = this.lastV_angle;
+                       this.fixangle = true;
                }
 
-               if(frametime)
-               {
-                       player_powerups();
-               }
+               if (frametime) player_powerups();
 
-               if (IS_DEAD(self))
-               {
-                       if(self.personal && g_race_qualifying)
-                       {
-                               if(time > self.respawn_time)
-                               {
-                                       self.respawn_time = time + 1; // only retry once a second
-                                       self.stat_respawn_time = self.respawn_time;
+               if (IS_DEAD(this)) {
+                       if (this.personal && g_race_qualifying) {
+                               if (time > this.respawn_time) {
+                                       STAT(RESPAWN_TIME, this) = this.respawn_time = time + 1; // only retry once a second
                                        respawn();
-                                       self.impulse = 141;
-                               }
-                       }
-                       else
-                       {
-                               float button_pressed;
-                               if(frametime)
-                                       player_anim();
-                               button_pressed = (PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self) || PHYS_INPUT_BUTTON_ATCK2(self) || PHYS_INPUT_BUTTON_HOOK(self) || PHYS_INPUT_BUTTON_USE(self));
-
-                               if (self.deadflag == DEAD_DYING)
-                               {
-                                       if((self.respawn_flags & RESPAWN_FORCE) && !autocvar_g_respawn_delay_max)
-                                               self.deadflag = DEAD_RESPAWNING;
-                                       else if(!button_pressed)
-                                               self.deadflag = DEAD_DEAD;
-                               }
-                               else if (self.deadflag == DEAD_DEAD)
-                               {
-                                       if(button_pressed)
-                                               self.deadflag = DEAD_RESPAWNABLE;
-                                       else if(time >= self.respawn_time_max && (self.respawn_flags & RESPAWN_FORCE))
-                                               self.deadflag = DEAD_RESPAWNING;
-                               }
-                               else if (self.deadflag == DEAD_RESPAWNABLE)
-                               {
-                                       if(!button_pressed)
-                                               self.deadflag = DEAD_RESPAWNING;
+                                       this.impulse = CHIMPULSE_SPEEDRUN.impulse;
                                }
-                               else if (self.deadflag == DEAD_RESPAWNING)
-                               {
-                                       if(time > self.respawn_time)
-                                       {
-                                               self.respawn_time = time + 1; // only retry once a second
-                                               self.respawn_time_max = self.respawn_time;
+                       } else {
+                               if (frametime) player_anim();
+                               bool button_pressed = (PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this));
+
+                               if (this.deadflag == DEAD_DYING) {
+                                       if ((this.respawn_flags & RESPAWN_FORCE) && !autocvar_g_respawn_delay_max) {
+                                               this.deadflag = DEAD_RESPAWNING;
+                                       } else if (!button_pressed) {
+                                               this.deadflag = DEAD_DEAD;
+                    }
+                               } else if (this.deadflag == DEAD_DEAD) {
+                                       if (button_pressed) {
+                                               this.deadflag = DEAD_RESPAWNABLE;
+                                       } else if (time >= this.respawn_time_max && (this.respawn_flags & RESPAWN_FORCE)) {
+                                               this.deadflag = DEAD_RESPAWNING;
+                    }
+                               } else if (this.deadflag == DEAD_RESPAWNABLE) {
+                                       if (!button_pressed) {
+                                               this.deadflag = DEAD_RESPAWNING;
+                    }
+                               } else if (this.deadflag == DEAD_RESPAWNING) {
+                                       if (time > this.respawn_time) {
+                                               this.respawn_time = time + 1; // only retry once a second
+                                               this.respawn_time_max = this.respawn_time;
                                                respawn();
                                        }
                                }
 
                                ShowRespawnCountdown();
 
-                               if(self.respawn_flags & RESPAWN_SILENT)
-                                       self.stat_respawn_time = 0;
-                               else if((self.respawn_flags & RESPAWN_FORCE) && autocvar_g_respawn_delay_max)
-                                       self.stat_respawn_time = self.respawn_time_max;
+                               if (this.respawn_flags & RESPAWN_SILENT)
+                                       STAT(RESPAWN_TIME, this) = 0;
+                               else if ((this.respawn_flags & RESPAWN_FORCE) && autocvar_g_respawn_delay_max)
+                                       STAT(RESPAWN_TIME, this) = this.respawn_time_max;
                                else
-                                       self.stat_respawn_time = self.respawn_time;
+                                       STAT(RESPAWN_TIME, this) = this.respawn_time;
                        }
 
                        // if respawning, invert stat_respawn_time to indicate this, the client translates it
-                       if(self.deadflag == DEAD_RESPAWNING && self.stat_respawn_time > 0)
-                               self.stat_respawn_time *= -1;
+                       if (this.deadflag == DEAD_RESPAWNING && STAT(RESPAWN_TIME, this) > 0)
+                               STAT(RESPAWN_TIME, this) *= -1;
 
                        return;
                }
 
-               self.prevorigin = self.origin;
-
-               float do_crouch = PHYS_INPUT_BUTTON_CROUCH(self);
-               if(self.hook.state)
-                       do_crouch = 0;
-               if(self.vehicle)
-                       do_crouch = 0;
-               if(STAT(FROZEN, self))
-                       do_crouch = 0;
+               this.prevorigin = this.origin;
 
-               // WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
-               // It cannot be predicted by the engine!
-               .entity weaponentity = weaponentities[0]; // TODO: unhardcode
-               if((PS(self).m_weapon == WEP_SHOCKWAVE || PS(self).m_weapon == WEP_SHOTGUN) && self.(weaponentity).wframe == WFRAME_FIRE2 && time < self.(weaponentity).weapon_nextthink)
-                       do_crouch = 0;
+               bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
+        .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+               if (this.hook.state) {
+                       do_crouch = false;
+               } else if (this.vehicle) {
+                       do_crouch = false;
+               } else if (STAT(FROZEN, this)) {
+                       do_crouch = false;
+        } else if ((PS(this).m_weapon == WEP_SHOTGUN || PS(this).m_weapon == WEP_SHOCKWAVE) && this.(weaponentity).wframe == WFRAME_FIRE2 && time < this.(weaponentity).weapon_nextthink) {
+                   // WEAPONTODO: predict
+                       do_crouch = false;
+        }
 
-               if (do_crouch)
-               {
-                       if (!self.crouch)
-                       {
-                               self.crouch = true;
-                               self.view_ofs = STAT(PL_CROUCH_VIEW_OFS, self);
-                               setsize (self, STAT(PL_CROUCH_MIN, self), STAT(PL_CROUCH_MAX, self));
-                               // setanim(self, self.anim_duck, false, true, true); // this anim is BROKEN anyway
-                       }
-               }
-               else
-               {
-                       if (self.crouch)
-                       {
-                               tracebox(self.origin, STAT(PL_MIN, self), STAT(PL_MAX, self), self.origin, false, self);
-                               if (!trace_startsolid)
-                               {
-                                       self.crouch = false;
-                                       self.view_ofs = STAT(PL_VIEW_OFS, self);
-                                       setsize (self, STAT(PL_MIN, self), STAT(PL_MAX, self));
-                               }
+               if (do_crouch) {
+                       if (!this.crouch) {
+                               this.crouch = true;
+                               this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this);
+                               setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
+                               // setanim(this, this.anim_duck, false, true, true); // this anim is BROKEN anyway
                        }
+               } else if (this.crouch) {
+            tracebox(this.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), this.origin, false, this);
+            if (!trace_startsolid) {
+                this.crouch = false;
+                this.view_ofs = STAT(PL_VIEW_OFS, this);
+                setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
+            }
                }
 
-               FixPlayermodel(self);
+               FixPlayermodel(this);
 
                // LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
                //if(frametime)
                {
-                       self.items &= ~self.items_added;
+                       this.items &= ~this.items_added;
 
-                       W_WeaponFrame(self);
+                       W_WeaponFrame(this);
 
-                       self.items_added = 0;
-                       if(self.items & ITEM_Jetpack.m_itemid)
-                               if(self.items & ITEM_JetpackRegen.m_itemid || self.ammo_fuel >= 0.01)
-                                       self.items_added |= IT_FUEL;
+                       this.items_added = 0;
+                       if (this.items & ITEM_Jetpack.m_itemid && (this.items & ITEM_JetpackRegen.m_itemid || this.ammo_fuel >= 0.01))
+                this.items_added |= IT_FUEL;
 
-                       self.items |= self.items_added;
+                       this.items |= this.items_added;
                }
 
                player_regen();
 
                // WEAPONTODO: Add a weapon request for this
                // rot vortex charge to the charge limit
-               if(WEP_CVAR(vortex, charge_rot_rate) && self.vortex_charge > WEP_CVAR(vortex, charge_limit) && self.vortex_charge_rottime < time)
-                       self.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), self.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
+               if (WEP_CVAR(vortex, charge_rot_rate) && this.vortex_charge > WEP_CVAR(vortex, charge_limit) && this.vortex_charge_rottime < time)
+                       this.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), this.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
 
-               if(frametime)
-                       player_anim();
+               if (frametime) player_anim();
 
                // secret status
                secrets_setstatus();
 
                // monsters status
-               monsters_setstatus(self);
-
-               self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
+               monsters_setstatus(this);
 
-               //self.angles_y=self.v_angle_y + 90;   // temp
-       } else if(gameover) {
-               if (intermission_running)
-                       IntermissionThink ();   // otherwise a button could be missed between
+               this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
+       }
+       else if (gameover) {
+               if (intermission_running) IntermissionThink();
                return;
-       } else if(IS_OBSERVER(self)) {
+       }
+       else if (IS_OBSERVER(this)) {
                ObserverThink();
-       } else if(IS_SPEC(self)) {
+       }
+       else if (IS_SPEC(this)) {
                SpectatorThink();
        }
 
        // WEAPONTODO: Add weapon request for this
-       if(!zoomstate_set)
+       if (!zoomstate_set) {
                SetZoomState(
-                       PHYS_INPUT_BUTTON_ZOOM(self)
-                       || PHYS_INPUT_BUTTON_ZOOMSCRIPT(self)
-                       || (PHYS_INPUT_BUTTON_ATCK2(self) && PS(self).m_weapon == WEP_VORTEX)
-                       || (PHYS_INPUT_BUTTON_ATCK2(self) && PS(self).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
-               ); // WEAPONTODO
-
-       float oldspectatee_status;
-       oldspectatee_status = self.spectatee_status;
-       if(IS_SPEC(self))
-               self.spectatee_status = etof(self.enemy);
-       else if(IS_OBSERVER(self))
-               self.spectatee_status = etof(self);
-       else
-               self.spectatee_status = 0;
-       if(self.spectatee_status != oldspectatee_status)
-       {
-               ClientData_Touch(self);
-               if(g_race || g_cts)
-                       race_InitSpectator();
+                       PHYS_INPUT_BUTTON_ZOOM(this) || PHYS_INPUT_BUTTON_ZOOMSCRIPT(this)
+                       || (PHYS_INPUT_BUTTON_ATCK2(this) && PS(this).m_weapon == WEP_VORTEX)
+                       || (PHYS_INPUT_BUTTON_ATCK2(this) && PS(this).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
+               );
+    }
+
+       int oldspectatee_status = this.spectatee_status;
+       if (IS_SPEC(this)) {
+               this.spectatee_status = etof(this.enemy);
+       } else if (IS_OBSERVER(this)) {
+               this.spectatee_status = etof(this);
+       } else {
+               this.spectatee_status = 0;
+    }
+       if (this.spectatee_status != oldspectatee_status) {
+               ClientData_Touch(this);
+               if (g_race || g_cts) race_InitSpectator();
        }
 
-       if(self.teamkill_soundtime)
-       if(time > self.teamkill_soundtime)
+       if (this.teamkill_soundtime && time > this.teamkill_soundtime)
        {
-               self.teamkill_soundtime = 0;
+               this.teamkill_soundtime = 0;
 
-               entity e = self.teamkill_soundsource;
+               entity e = this.teamkill_soundsource;
                entity oldpusher = e.pusher;
                e.pusher = this;
                PlayerSound(e, playersound_teamshoot, CH_VOICE, VOICETYPE_LASTATTACKER_ONLY);
                e.pusher = oldpusher;
        }
 
-       if(self.taunt_soundtime)
-       if(time > self.taunt_soundtime)
-       {
-               self.taunt_soundtime = 0;
-               PlayerSound(self, playersound_taunt, CH_VOICE, VOICETYPE_AUTOTAUNT);
+       if (this.taunt_soundtime && time > this.taunt_soundtime) {
+               this.taunt_soundtime = 0;
+               PlayerSound(this, playersound_taunt, CH_VOICE, VOICETYPE_AUTOTAUNT);
        }
 
-       target_voicescript_next(self);
+       target_voicescript_next(this);
 
        // WEAPONTODO: Move into weaponsystem somehow
        // if a player goes unarmed after holding a loaded weapon, empty his clip size and remove the crosshair ammo ring
-       if (PS(self).m_weapon == WEP_Null)
-               self.clip_load = self.clip_size = 0;
+       if (PS(this).m_weapon == WEP_Null)
+               this.clip_load = this.clip_size = 0;
 }
 
 void DrownPlayer(entity this)
@@ -2448,39 +2394,38 @@ Called every frame for each client after the physics are run
 */
 .float idlekick_lasttimeleft;
 void PlayerPostThink ()
-{SELFPARAM();
-       if(sv_maxidle > 0 && frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
-       if(IS_REAL_CLIENT(self))
-       if(IS_PLAYER(self) || sv_maxidle_spectatorsareidle)
+{
+    SELFPARAM();
+       if (sv_maxidle > 0)
+       if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
+       if (IS_REAL_CLIENT(this))
+       if (IS_PLAYER(this) || sv_maxidle_spectatorsareidle)
        {
-               if (time - self.parm_idlesince < 1) // instead of (time == self.parm_idlesince) to support sv_maxidle <= 10
+               if (time - this.parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
                {
-                       if(self.idlekick_lasttimeleft)
+                       if (this.idlekick_lasttimeleft)
                        {
-                               self.idlekick_lasttimeleft = 0;
-                               Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_IDLING);
+                               this.idlekick_lasttimeleft = 0;
+                               Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_IDLING);
                        }
                }
                else
                {
-                       float timeleft;
-                       timeleft = ceil(sv_maxidle - (time - self.parm_idlesince));
-                       if(timeleft == min(10, sv_maxidle - 1)) // - 1 to support sv_maxidle <= 10
-                       {
-                               if(!self.idlekick_lasttimeleft)
-                                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
+                       float timeleft = ceil(sv_maxidle - (time - this.parm_idlesince));
+                       if (timeleft == min(10, sv_maxidle - 1)) { // - 1 to support sv_maxidle <= 10
+                               if (!this.idlekick_lasttimeleft)
+                                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
                        }
-                       if(timeleft <= 0)
-                       {
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_KICK_IDLING, self.netname);
-                               dropclient(self);
+                       if (timeleft <= 0) {
+                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname);
+                               dropclient(this);
                                return;
                        }
-                       else if(timeleft <= 10)
-                       {
-                               if(timeleft != self.idlekick_lasttimeleft)
-                                       { Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft)); }
-                               self.idlekick_lasttimeleft = timeleft;
+                       else if (timeleft <= 10) {
+                               if (timeleft != this.idlekick_lasttimeleft) {
+                                   Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
+                }
+                               this.idlekick_lasttimeleft = timeleft;
                        }
                }
        }
@@ -2489,37 +2434,21 @@ void PlayerPostThink ()
 
        //CheckPlayerJump();
 
-       if(IS_PLAYER(self)) {
-               DrownPlayer(self);
+       if (IS_PLAYER(this)) {
+               DrownPlayer(this);
                CheckRules_Player();
                UpdateChatBubble();
-               if (self.impulse)
-                       ImpulseCommands(self);
-               if (intermission_running)
-                       return;         // intermission or finale
+               if (this.impulse) ImpulseCommands(this);
+               if (intermission_running) return; // intermission or finale
                GetPressedKeys();
        }
 
-       /*
-       float i;
-       for(i = 0; i < 1000; ++i)
-       {
-               vector end;
-               end = self.origin + '0 0 1024' + 512 * randomvec();
-               tracebox(self.origin, self.mins, self.maxs, end, MOVE_NORMAL, self);
-               if(trace_fraction < 1)
-               if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
-               {
-                       print("I HIT SOLID: ", vtos(self.origin), " -> ", vtos(end), "\n");
-                       break;
-               }
-       }
-       */
-
-       if(self.waypointsprite_attachedforcarrier)
-               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
+       if (this.waypointsprite_attachedforcarrier) {
+           vector v = healtharmor_maxdamage(this.health, this.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id);
+               WaypointSprite_UpdateHealth(this.waypointsprite_attachedforcarrier, '1 0 0' * v);
+    }
 
        playerdemo_write();
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
index 979e6d860bf3cf1455c12179b2c47e6973b582b9..42904695c693b35e39835bed217e3c78ef2635c8 100644 (file)
@@ -39,17 +39,17 @@ void Drop_Special_Items(entity player)
 
 void CopyBody_Think()
 {SELFPARAM();
-       if(self.CopyBody_nextthink && time > self.CopyBody_nextthink)
+       if(this.CopyBody_nextthink && time > this.CopyBody_nextthink)
        {
-               self.CopyBody_think();
-               if(wasfreed(self))
+               this.CopyBody_think();
+               if(wasfreed(this))
                        return;
-               self.CopyBody_nextthink = self.nextthink;
-               self.CopyBody_think = self.think;
-               self.think = CopyBody_Think;
+               this.CopyBody_nextthink = this.nextthink;
+               this.CopyBody_think = this.think;
+               this.think = CopyBody_Think;
        }
-       CSQCMODEL_AUTOUPDATE(self);
-       self.nextthink = time;
+       CSQCMODEL_AUTOUPDATE(this);
+       this.nextthink = time;
 }
 void CopyBody(entity this, float keepvelocity)
 {
@@ -135,8 +135,8 @@ void player_setupanimsformodel()
 
 void player_anim ()
 {SELFPARAM();
-       int deadbits = (self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
-       if(IS_DEAD(self)) {
+       int deadbits = (this.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
+       if(IS_DEAD(this)) {
                if (!deadbits) {
                        // Decide on which death animation to use.
                        if(random() < 0.5)
@@ -149,14 +149,14 @@ void player_anim ()
                deadbits = 0;
        }
        int animbits = deadbits;
-       if(STAT(FROZEN, self))
+       if(STAT(FROZEN, this))
                animbits |= ANIMSTATE_FROZEN;
-       if(self.movetype == MOVETYPE_FOLLOW)
+       if(this.movetype == MOVETYPE_FOLLOW)
                animbits |= ANIMSTATE_FOLLOW;
-       if(self.crouch)
+       if(this.crouch)
                animbits |= ANIMSTATE_DUCK;
-       animdecide_setstate(self, animbits, false);
-       animdecide_setimplicitstate(self, IS_ONGROUND(self));
+       animdecide_setstate(this, animbits, false);
+       animdecide_setimplicitstate(this, IS_ONGROUND(this));
 }
 
 void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -556,7 +556,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                excess = frag_damage;
 
                Weapon wep = PS(this).m_weapon;
-               WITH(entity, self, this, wep.wr_playerdeath(wep));
+               WITHSELF(this, wep.wr_playerdeath(wep));
 
                RemoveGrapplingHook(this);
 
@@ -637,7 +637,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
 
                // reset fields the weapons may use just in case
                FOREACH(Weapons, it != WEP_Null, LAMBDA(
-                       WITH(entity, self, this, it.wr_resetplayer(it));
+                       WITHSELF(this, it.wr_resetplayer(it));
                        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                        {
                                ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0;
diff --git a/qcsrc/server/command/_mod.inc b/qcsrc/server/command/_mod.inc
new file mode 100644 (file)
index 0000000..1f2b37a
--- /dev/null
@@ -0,0 +1,9 @@
+// generated file; do not modify
+#include "all.qc"
+#include "banning.qc"
+#include "cmd.qc"
+#include "common.qc"
+#include "getreplies.qc"
+#include "radarmap.qc"
+#include "sv_cmd.qc"
+#include "vote.qc"
index c6d30cb7fde24c4b59ca640edd3ca39feb8c8f7e..bc15eeb689560fbaa07b91647cbd6cbe15ff1bdd 100644 (file)
@@ -1,11 +1,2 @@
 #include "all.qh"
 #include <common/command/all.qc>
-
-#include "sv_cmd.qc"
-
-#include "banning.qc"
-#include "cmd.qc"
-#include "common.qc"
-#include "getreplies.qc"
-#include "radarmap.qc"
-#include "vote.qc"
index 4533e4f5b21cdb14cfe97aa0d39eeb7d014dc981..e7cc3d4578c8a811d7509db00a23954ef785f50a 100644 (file)
@@ -733,7 +733,7 @@ void SV_ParseClientCommand(string command)
        if (command != command2) return;
 
        // if we're banned, don't even parse the command
-       if (Ban_MaybeEnforceBanOnce(self)) return;
+       if (Ban_MaybeEnforceBanOnce(this)) return;
 
        float argc = tokenize_console(command);
 
@@ -765,17 +765,17 @@ void SV_ParseClientCommand(string command)
        {
                if (argc == 1)
                {
-                       sprint(self, "\nClient networked commands:\n");
+                       sprint(this, "\nClient networked commands:\n");
                        ClientCommand_macro_help();
 
-                       sprint(self, "\nCommon networked commands:\n");
-                       CommonCommand_macro_help(self);
+                       sprint(this, "\nCommon networked commands:\n");
+                       CommonCommand_macro_help(this);
 
-                       sprint(self, "\nUsage:^3 cmd COMMAND...^7, where possible commands are listed above.\n");
-                       sprint(self, "For help about a specific command, type cmd help COMMAND\n");
+                       sprint(this, "\nUsage:^3 cmd COMMAND...^7, where possible commands are listed above.\n");
+                       sprint(this, "For help about a specific command, type cmd help COMMAND\n");
                        return;
                }
-               else if (CommonCommand_macro_usage(argc, self))  // Instead of trying to call a command, we're going to see detailed information about it
+               else if (CommonCommand_macro_usage(argc, this))  // Instead of trying to call a command, we're going to see detailed information about it
                {
                        return;
                }
@@ -792,7 +792,7 @@ void SV_ParseClientCommand(string command)
        {
                return;  // handled by server/cheats.qc
        }
-       else if (CommonCommand_macro_command(argc, self, command))
+       else if (CommonCommand_macro_command(argc, this, command))
        {
                return;                                          // handled by server/command/common.qc
        }
@@ -802,6 +802,6 @@ void SV_ParseClientCommand(string command)
        }
        else
        {
-               clientcommand(self, command);
+               clientcommand(this, command);
        }
 }
index e713caf7946714b8bc7c4d631638e09b8104b382..02e984e3c587e5eec84957cf6c628014c64e110c 100644 (file)
@@ -199,7 +199,7 @@ void GameCommand_allspec(float request, float argc)
                        int n = 0;
                        FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
                                if (it.caplayer) it.caplayer = 0;
-                               WITH(entity, self, it, PutObserverInServer());
+                               WITHSELF(it, PutObserverInServer());
                                ++n;
                        ));
                        if (n)   bprint(strcat("Successfully forced all (", ftos(n), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n"));
@@ -1028,7 +1028,7 @@ void GameCommand_moveplayer(float request, float argc)
                                                if (!IS_SPEC(client) && !IS_OBSERVER(client))
                                                {
                                                        if (client.caplayer) client.caplayer = 0;
-                                                       WITH(entity, self, client, PutObserverInServer());
+                                                       WITHSELF(client, PutObserverInServer());
 
                                                        successful = strcat(successful, (successful ? ", " : ""), client.netname);
                                                }
@@ -1178,7 +1178,7 @@ void GameCommand_playerdemo(float request, float argc)
                                                        return;
                                                }
 
-                                               WITH(entity, self, client, playerdemo_open_read(argv(next_token)));
+                                               WITHSELF(client, playerdemo_open_read(argv(next_token)));
                                                return;
                                        }
 
@@ -1193,7 +1193,7 @@ void GameCommand_playerdemo(float request, float argc)
                                                        return;
                                                }
 
-                                               WITH(entity, self, client, playerdemo_open_write(argv(next_token)));
+                                               WITHSELF(client, playerdemo_open_write(argv(next_token)));
                                                return;
                                        }
 
index 4cf5b7dc5145199bb8512a00d511d7b02d989f77..4bd8dee6e5d15d30c953db2971caf57f1b8868b2 100644 (file)
@@ -341,22 +341,22 @@ void reset_map(bool dorespawn)
 
        MUTATOR_CALLHOOK(reset_map_global);
 
-       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), LAMBDA(
+       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), {
                if (it.reset)
                {
-                       WITH(entity, self, it, it.reset(it));
+                       WITHSELF(it, it.reset(it));
                        continue;
                }
                if (it.team_saved) it.team = it.team_saved;
                if (it.flags & FL_PROJECTILE) remove(it);  // remove any projectiles left
-       ));
+       });
 
        // Waypoints and assault start come LAST
-       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), LAMBDA(
-               if (it.reset2) WITH(entity, self, it, it.reset2());
-       ));
+       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), {
+               if (it.reset2) WITHSELF(it, it.reset2());
+       });
 
-       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), LAMBDA(WITH(entity, self, it, Unfreeze(it))));
+       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), LAMBDA(WITHSELF(it, Unfreeze(it))));
 
        // Moving the player reset code here since the player-reset depends
        // on spawnpoint entities which have to be reset first --blub
index 65447c7d635bfd0e3472199faed7df509bb2897f..7124e4468f3f6cf82878c23ec71b251cad460760 100644 (file)
@@ -213,7 +213,6 @@ void FixClientCvars(entity e);
 WepSet weaponsInMap;
 
 #define weapons _STAT(WEAPONS)
-#define weaponsinmap _STAT(WEAPONSINMAP)
 
 .float respawn_countdown; // next number to count
 
@@ -285,8 +284,6 @@ float cvar_purechanges_count;
 
 float game_starttime; //point in time when the countdown to game start is over
 float round_starttime; //point in time when the countdown to round start is over
-.float stat_game_starttime = _STAT(GAMESTARTTIME);
-.float stat_round_starttime = _STAT(ROUNDSTARTTIME);
 
 void W_Porto_Remove (entity p);
 
@@ -294,8 +291,6 @@ void W_Porto_Remove (entity p);
 
 .string message2;
 
-.bool stat_allow_oldvortexbeam = _STAT(ALLOW_OLDVORTEXBEAM);
-
 // reset to 0 on weapon switch
 // may be useful to all weapons
 .float bulletcounter;
@@ -342,8 +337,6 @@ string matchid;
 
 .float damage_dealt_total = _STAT(DAMAGE_DEALT_TOTAL);
 
-.float stat_leadlimit = _STAT(LEADLIMIT);
-
 bool radar_showennemies;
 
 #ifdef PROFILING
index 2958835830fffab161818758cb3339f4bd3774ab..208ae62e59365a347c18e3477c863bca8f506d06 100644 (file)
@@ -540,7 +540,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        targ.iceblock = ice;
        targ.revival_time = 0;
 
-       WITH(entity, self, ice, Ice_Think());
+       WITHSELF(ice, Ice_Think());
 
        RemoveGrapplingHook(targ);
 
index 38094ef95d85c63e21fbb44c07c79abb9f4b74af..ca5c45b9efd3c01282d965cd812abd15b64c8cb2 100644 (file)
@@ -55,7 +55,7 @@ float IsFlying(entity a);
 void UpdateFrags(entity player, float f);
 
 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
-void W_SwitchWeapon_Force(entity e, Weapon w);
+void W_SwitchWeapon_Force(Player this, Weapon w);
 entity GiveFrags_randomweapons;
 void GiveFrags (entity attacker, entity targ, float f, int deathtype);
 
index 37177326f077e888cb864140679891086f3a6ff9..74e03b7a0d6c3f4a133f8dd6b6593e47819eed47 100644 (file)
@@ -36,6 +36,7 @@ flags:
 */
 void dynlight_think()
 {
+    SELFPARAM();
        if(!self.owner)
                remove(self);
 
@@ -43,6 +44,7 @@ void dynlight_think()
 }
 void dynlight_find_aiment()
 {
+    SELFPARAM();
        entity targ;
        if (!self.target)
                objerror ("dynlight: no target to follow");
@@ -59,6 +61,7 @@ void dynlight_find_aiment()
 }
 void dynlight_find_path()
 {
+    SELFPARAM();
        entity targ;
        if (!self.target)
                objerror ("dynlight: no target to follow");
@@ -71,6 +74,7 @@ void dynlight_find_path()
 }
 void dynlight_find_target()
 {
+    SELFPARAM();
        entity targ;
        if (!self.target)
                objerror ("dynlight: no target to follow");
@@ -83,6 +87,7 @@ void dynlight_find_target()
 }
 void dynlight_use()
 {
+    SELFPARAM();
        if (self.light_lev == 0)
                self.light_lev = self.lefty;
        else
index 97450cd4ca107333c5255e9e024d26f4bc6f5a13..c6a9d787fe2c6b602c7f7d788ec211ca67fe6804 100644 (file)
@@ -240,89 +240,89 @@ float LOD_customize()
        {
                int d = autocvar_loddebug;
                if(d == 1)
-                       self.modelindex = self.lodmodelindex0;
-               else if(d == 2 || !self.lodmodelindex2)
-                       self.modelindex = self.lodmodelindex1;
+                       this.modelindex = this.lodmodelindex0;
+               else if(d == 2 || !this.lodmodelindex2)
+                       this.modelindex = this.lodmodelindex1;
                else // if(d == 3)
-                       self.modelindex = self.lodmodelindex2;
+                       this.modelindex = this.lodmodelindex2;
                return true;
        }
 
        // TODO csqc network this so it only gets sent once
-       vector near_point = NearestPointOnBox(self, other.origin);
-       if(vdist(near_point - other.origin, <, self.loddistance1))
-               self.modelindex = self.lodmodelindex0;
-       else if(!self.lodmodelindex2 || vdist(near_point - other.origin, <, self.loddistance2))
-               self.modelindex = self.lodmodelindex1;
+       vector near_point = NearestPointOnBox(this, other.origin);
+       if(vdist(near_point - other.origin, <, this.loddistance1))
+               this.modelindex = this.lodmodelindex0;
+       else if(!this.lodmodelindex2 || vdist(near_point - other.origin, <, this.loddistance2))
+               this.modelindex = this.lodmodelindex1;
        else
-               self.modelindex = self.lodmodelindex2;
+               this.modelindex = this.lodmodelindex2;
 
        return true;
 }
 
 void LOD_uncustomize()
 {SELFPARAM();
-       self.modelindex = self.lodmodelindex0;
+       this.modelindex = this.lodmodelindex0;
 }
 
 void LODmodel_attach()
 {SELFPARAM();
        entity e;
 
-       if(!self.loddistance1)
-               self.loddistance1 = 1000;
-       if(!self.loddistance2)
-               self.loddistance2 = 2000;
-       self.lodmodelindex0 = self.modelindex;
+       if(!this.loddistance1)
+               this.loddistance1 = 1000;
+       if(!this.loddistance2)
+               this.loddistance2 = 2000;
+       this.lodmodelindex0 = this.modelindex;
 
-       if(self.lodtarget1 != "")
+       if(this.lodtarget1 != "")
        {
-               e = find(world, targetname, self.lodtarget1);
+               e = find(world, targetname, this.lodtarget1);
                if(e)
                {
-                       self.lodmodel1 = e.model;
+                       this.lodmodel1 = e.model;
                        remove(e);
                }
        }
-       if(self.lodtarget2 != "")
+       if(this.lodtarget2 != "")
        {
-               e = find(world, targetname, self.lodtarget2);
+               e = find(world, targetname, this.lodtarget2);
                if(e)
                {
-                       self.lodmodel2 = e.model;
+                       this.lodmodel2 = e.model;
                        remove(e);
                }
        }
 
        if(autocvar_loddebug < 0)
        {
-               self.lodmodel1 = self.lodmodel2 = ""; // don't even initialize
+               this.lodmodel1 = this.lodmodel2 = ""; // don't even initialize
        }
 
-       if(self.lodmodel1 != "")
+       if(this.lodmodel1 != "")
        {
                vector mi, ma;
-               mi = self.mins;
-               ma = self.maxs;
+               mi = this.mins;
+               ma = this.maxs;
 
-               precache_model(self.lodmodel1);
-               _setmodel(self, self.lodmodel1);
-               self.lodmodelindex1 = self.modelindex;
+               precache_model(this.lodmodel1);
+               _setmodel(this, this.lodmodel1);
+               this.lodmodelindex1 = this.modelindex;
 
-               if(self.lodmodel2 != "")
+               if(this.lodmodel2 != "")
                {
-                       precache_model(self.lodmodel2);
-                       _setmodel(self, self.lodmodel2);
-                       self.lodmodelindex2 = self.modelindex;
+                       precache_model(this.lodmodel2);
+                       _setmodel(this, this.lodmodel2);
+                       this.lodmodelindex2 = this.modelindex;
                }
 
-               self.modelindex = self.lodmodelindex0;
-               setsize(self, mi, ma);
+               this.modelindex = this.lodmodelindex0;
+               setsize(this, mi, ma);
        }
 
-       if(self.lodmodelindex1)
-               if (!self.SendEntity)
-                       SetCustomizer(self, LOD_customize, LOD_uncustomize);
+       if(this.lodmodelindex1)
+               if (!this.SendEntity)
+                       SetCustomizer(this, LOD_customize, LOD_uncustomize);
 }
 
 void ApplyMinMaxScaleAngles(entity e)
index f1154e1b59539c66039e39b3b4373aafd25a2f3f..d4bc83b681d2c63193ce9a71f4b5374fb1380901 100644 (file)
@@ -49,13 +49,13 @@ void PingPLReport_Think()
        delta = 3 / maxclients;
        if(delta < sys_frametime)
                delta = 0;
-       self.nextthink = time + delta;
+       this.nextthink = time + delta;
 
-       e = edict_num(self.cnt + 1);
+       e = edict_num(this.cnt + 1);
        if(IS_REAL_CLIENT(e))
        {
                WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
-               WriteByte(MSG_BROADCAST, self.cnt);
+               WriteByte(MSG_BROADCAST, this.cnt);
                WriteShort(MSG_BROADCAST, max(1, e.ping));
                WriteByte(MSG_BROADCAST, ceil(e.ping_packetloss * 255));
                WriteByte(MSG_BROADCAST, ceil(e.ping_movementloss * 255));
@@ -72,12 +72,12 @@ void PingPLReport_Think()
        else
        {
                WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
-               WriteByte(MSG_BROADCAST, self.cnt);
+               WriteByte(MSG_BROADCAST, this.cnt);
                WriteShort(MSG_BROADCAST, 0);
                WriteByte(MSG_BROADCAST, 0);
                WriteByte(MSG_BROADCAST, 0);
        }
-       self.cnt = (self.cnt + 1) % maxclients;
+       this.cnt = (this.cnt + 1) % maxclients;
 }
 void PingPLReport_Spawn()
 {
@@ -511,15 +511,15 @@ entity randomseed;
 bool RandomSeed_Send(entity this, entity to, int sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
-       WriteShort(MSG_ENTITY, self.cnt);
+       WriteShort(MSG_ENTITY, this.cnt);
        return true;
 }
 void RandomSeed_Think()
 {SELFPARAM();
-       self.cnt = bound(0, floor(random() * 65536), 65535);
-       self.nextthink = time + 5;
+       this.cnt = bound(0, floor(random() * 65536), 65535);
+       this.nextthink = time + 5;
 
-       self.SendFlags |= 1;
+       this.SendFlags |= 1;
 }
 void RandomSeed_Spawn()
 {SELFPARAM();
@@ -527,7 +527,7 @@ void RandomSeed_Spawn()
        randomseed.think = RandomSeed_Think;
        Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
 
-       WITH(entity, self, randomseed, randomseed.think()); // sets random seed and nextthink
+       WITHSELF(randomseed, randomseed.think()); // sets random seed and nextthink
 }
 
 spawnfunc(__init_dedicated_server)
@@ -1545,9 +1545,7 @@ void NextLevel()
                        bprint(it.netname, " ^7wins.\n");
        ));
 
-       entity oldself = self;
-       target_music_kill();
-       self = oldself;
+       WITHSELF(NULL, target_music_kill());
 
        if(autocvar_g_campaign)
                CampaignPreIntermission();
@@ -1569,8 +1567,8 @@ void CheckRules_Player()
        if (gameover)   // someone else quit the game already
                return;
 
-       if(!IS_DEAD(self))
-               self.play_time += frametime;
+       if(!IS_DEAD(this))
+               this.play_time += frametime;
 
        // fixme: don't check players; instead check spawnfunc_dom_team and spawnfunc_ctf_team entities
        //   (div0: and that in CheckRules_World please)
index 65d38c8aa90ec3bb672e3edab877bf61d5422a4e..bb5f176b6090f48bf7e9d48cde65f446f5f0a730 100644 (file)
@@ -910,7 +910,7 @@ void InitializeEntitiesRun()
         //dprint("Delayed initialization: ", e.classname, "\n");
         if (func)
         {
-               WITH(entity, self, e, func());
+               WITHSELF(e, func());
         }
         else
         {
diff --git a/qcsrc/server/mutators/_mod.inc b/qcsrc/server/mutators/_mod.inc
new file mode 100644 (file)
index 0000000..254d13d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qc"
index afd006ad94c78e7f3c587fef22bca29baaf05ee8..8039d8348f0108d497e21560491d95760560de86 100644 (file)
@@ -502,7 +502,10 @@ MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing);
  * called when a vehicle initializes
  * return true to remove the vehicle
  */
-MUTATOR_HOOKABLE(VehicleSpawn, EV_NO_ARGS);
+#define EV_VehicleSpawn(i, o) \
+    /**/ i(entity, __self) \
+    /**/
+MUTATOR_HOOKABLE(VehicleSpawn, EV_VehicleSpawn);
 
 /**
  * called when a player enters a vehicle
diff --git a/qcsrc/server/mutators/mutator/_mod.inc b/qcsrc/server/mutators/mutator/_mod.inc
new file mode 100644 (file)
index 0000000..c56c2db
--- /dev/null
@@ -0,0 +1,14 @@
+// generated file; do not modify
+#include "gamemode_assault.qc"
+#include "gamemode_ca.qc"
+#include "gamemode_ctf.qc"
+#include "gamemode_cts.qc"
+#include "gamemode_deathmatch.qc"
+#include "gamemode_domination.qc"
+#include "gamemode_freezetag.qc"
+#include "gamemode_invasion.qc"
+#include "gamemode_keepaway.qc"
+#include "gamemode_keyhunt.qc"
+#include "gamemode_lms.qc"
+#include "gamemode_race.qc"
+#include "gamemode_tdm.qc"
index ae5166c7c47df6d43a775504f7464faf017c8cd0..e017f8a17f5ca05f11a3d00d8e59b5fd685e32fe 100644 (file)
@@ -80,7 +80,7 @@ void assault_objective_use()
        {
                if (e.classname == "target_objective_decrease")
                {
-                       WITH(entity, self, e, target_objective_decrease_activate());
+                       WITHSELF(e, target_objective_decrease_activate());
                }
        }
 
@@ -239,7 +239,7 @@ void assault_roundstart_use()
                        it.team = NUM_TEAM_1;
 
                // Dubbles as teamchange
-               WITH(entity, self, it, turret_respawn());
+               WITHSELF(it, turret_respawn());
        ));
 }
 
@@ -268,7 +268,7 @@ void assault_new_round()
        //bprint("ASSAULT: new round\n");
 
        // Eject players from vehicles
-    FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, LAMBDA(WITH(entity, self, it, vehicles_exit(VHEF_RELEASE))));
+    FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, WITHSELF(it, vehicles_exit(VHEF_RELEASE)));
 
     FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE, LAMBDA(
        setself(it);
@@ -332,7 +332,7 @@ int WinningCondition_Assault()
                        }
                        else
                        {
-                               WITH(entity, self, ent, assault_new_round());
+                               WITHSELF(ent, assault_new_round());
                        }
                }
        }
index c5dedbae705081f573db6757c13c1ed5cc60c61a..7f0eafe868d3a7d517a67966bd0c4d52ccdff2ca 100644 (file)
@@ -254,7 +254,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players)
                {
                        TRANSMUTE(Player, it);
                        it.caplayer = 1;
-                       WITH(entity, self, it, PutClientInServer());
+                       WITHSELF(it, PutClientInServer());
                }
        });
        return true;
index ba1e7a84fbc4a985befefcffb088af17cc91e46e..9cd6e37726230d6ddfe5ff4d49469c888bce3793 100644 (file)
@@ -2551,7 +2551,7 @@ void ctf_SpawnTeam (string teamname, int teamcolor)
        this.netname = teamname;
        this.cnt = teamcolor;
        this.spawnfunc_checked = true;
-       WITH(entity, self, this, spawnfunc_ctf_team(this));
+       WITHSELF(this, spawnfunc_ctf_team(this));
 }
 
 void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to be set up.
index bee23d10148ca298da4e52bdab45b95bc0b213c3..8482e258e9d0f8fdf2e64579e53246a766e21bdc 100644 (file)
@@ -380,7 +380,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies)
        if(round_handler_CountdownRunning())
        {
                if(STAT(FROZEN, frag_target))
-                       WITH(entity, self, frag_target, freezetag_Unfreeze(world));
+                       WITHSELF(frag_target, freezetag_Unfreeze(world));
                freezetag_count_alive_players();
                return 1; // let the player die so that he can respawn whenever he wants
        }
@@ -398,7 +398,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies)
                        freezetag_LastPlayerForTeam_Notify();
                }
                else
-                       WITH(entity, self, frag_target, freezetag_Unfreeze(world)); // remove ice
+                       WITHSELF(frag_target, freezetag_Unfreeze(world)); // remove ice
                frag_target.health = 0; // Unfreeze resets health
                frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
                return 1;
@@ -407,7 +407,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies)
        if(STAT(FROZEN, frag_target))
                return 1;
 
-       WITH(entity, self, frag_target, freezetag_Freeze(frag_attacker));
+       WITHSELF(frag_target, freezetag_Freeze(frag_attacker));
        freezetag_LastPlayerForTeam_Notify();
 
        if(frag_attacker == frag_target || frag_attacker == world)
index 4f84c5abbcb6c71994884d3a68e13f2ef703c5c8..a2f1f2507ed2bdf4d9da74d58dddc89b5bf2730f 100644 (file)
@@ -228,8 +228,8 @@ MUTATOR_HOOKFUNCTION(lms, ClientConnect)
 
 MUTATOR_HOOKFUNCTION(lms, PlayerPreThink)
 {SELFPARAM();
-       if(self.deadflag == DEAD_DYING)
-               self.deadflag = DEAD_RESPAWNING;
+       if(this.deadflag == DEAD_DYING)
+               this.deadflag = DEAD_RESPAWNING;
 
        return false;
 }
index 3167d603bf9798a57e0bc59f31b540da65b97646..2ba975c0da4f25141d569a8eaf1f182d665773db 100644 (file)
@@ -64,7 +64,7 @@ void tdm_SpawnTeam (string teamname, float teamcolor)
        this.netname = teamname;
        this.cnt = teamcolor;
        this.spawnfunc_checked = true;
-       WITH(entity, self, this, spawnfunc_tdm_team(this));
+       WITHSELF(this, spawnfunc_tdm_team(this));
 }
 
 void tdm_DelayedInit()
diff --git a/qcsrc/server/pathlib/_mod.inc b/qcsrc/server/pathlib/_mod.inc
new file mode 100644 (file)
index 0000000..c737f24
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "costs.qc"
+#include "debug.qc"
+#include "expandnode.qc"
+#include "main.qc"
+#include "movenode.qc"
+#include "path_waypoint.qc"
+#include "utility.qc"
index 9e335a331f8166fc37b48d2ef10e0160d35c9b05..9f3fd6d28f952db4ffa59fb5983e605825cfb5a7 100644 (file)
@@ -94,9 +94,9 @@ void playerdemo_write_float(.float f, string name)
 }
 void playerdemo_write()
 {SELFPARAM();
-       if(self.playerdemo_mode != PLAYERDEMO_MODE_WRITING)
+       if(this.playerdemo_mode != PLAYERDEMO_MODE_WRITING)
                return;
-       fputs(self.playerdemo_fh, strcat(ftos(time - self.playerdemo_starttime), "\n"));
+       fputs(this.playerdemo_fh, strcat(ftos(time - this.playerdemo_starttime), "\n"));
        PLAYERDEMO_FIELDS(playerdemo_write_)
 }
 void playerdemo_read_originvector(.vector f, string name)
@@ -147,9 +147,9 @@ float playerdemo_read(entity this)
                PLAYERDEMO_FIELDS(playerdemo_read_)
                {
                        time = this.playerdemo_time;
-                       WITH(entity, self, this, PlayerPreThink());
+                       WITHSELF(this, PlayerPreThink());
                        // not running physics though... this is just so we can run weapon stuff
-                       WITH(entity, self, this, PlayerPostThink());
+                       WITHSELF(this, PlayerPostThink());
                }
                this.playerdemo_time = stof(fgets(this.playerdemo_fh));
                if(this.playerdemo_time == 0)
index a26f56f8e4e42605f0a599d40635e788f7542ec1..2c7eb92536fe73e2255453d417caecc539642982 100644 (file)
@@ -1,67 +1,27 @@
-#include "../lib/_all.inc"
-#include "_all.qh"
-
-#include "../common/effects/qc/all.qc"
-
-#include "anticheat.qc"
-#include "antilag.qc"
-#include "campaign.qc"
-#include "cheats.qc"
-#include "cl_client.qc"
-#include "cl_impulse.qc"
-#include "cl_player.qc"
-#include "g_damage.qc"
-#include "g_hook.qc"
-// #include "g_lights.qc" // TODO: was never used
-#include "g_models.qc"
-#include "g_subs.qc"
-#include "g_world.qc"
-#include "ipban.qc"
-#include "item_key.qc"
-#include "mapvoting.qc"
-#include "miscfunctions.qc"
-#include "playerdemo.qc"
-#include "portals.qc"
-#include "race.qc"
-#include "round_handler.qc"
-#include "scores.qc"
-#include "scores_rules.qc"
-#include "spawnpoints.qc"
-#include "steerlib.qc"
-#include "sv_main.qc"
-#include "teamplay.qc"
-#include "t_halflife.qc"
-#include "t_quake3.qc"
-#include "t_quake.qc"
-
-#include "tests.qc"
-
-#include "bot/_all.inc"
+#ifndef DEBUGPATHING
+       #define DEBUGPATHING 0
+#endif
 
-#include "command/all.qc"
+#include <lib/_all.inc>
+#include "_all.qh"
 
+#include "_mod.inc"
+#include "bot/_mod.inc"
+#include "bot/havocbot/_mod.inc"
+#include "command/_mod.inc"
+#include "mutators/_mod.inc"
 #include "pathlib/_all.inc"
+#include "weapons/_mod.inc"
 
-#include "weapons/accuracy.qc"
-#include "weapons/common.qc"
-#include "weapons/csqcprojectile.qc" // TODO
-#include "weapons/hitplot.qc"
-#include "weapons/selection.qc"
-#include "weapons/spawning.qc"
-#include "weapons/throwing.qc"
-#include "weapons/tracing.qc"
-#include "weapons/weaponstats.qc"
-#include "weapons/weaponsystem.qc"
-
-#include "../common/_all.inc"
-#include "mutators/all.qc"
+#include <common/_all.inc>
+#include <common/effects/qc/all.qc>
 
-#include "../lib/csqcmodel/sv_model.qc"
+#include <lib/csqcmodel/sv_model.qc>
 
-#include "../lib/warpzone/anglestransform.qc"
-#include "../lib/warpzone/common.qc"
-#include "../lib/warpzone/server.qc"
-#include "../lib/warpzone/util_server.qc"
+#include <lib/warpzone/anglestransform.qc>
+#include <lib/warpzone/common.qc>
+#include <lib/warpzone/server.qc>
+#include <lib/warpzone/util_server.qc>
 
 #if BUILD_MOD
 #include "../../mod/server/progs.inc"
index 273be69d7444c45b37183b01501a93aaa602b722..8b46c210b8450cd1150d30345336007411198131 100644 (file)
@@ -1075,7 +1075,7 @@ void race_ClearRecords()
 
        FOREACH_CLIENT(true, LAMBDA(
                float p = it.race_place;
-               WITH(entity, self, it, race_PreparePlayer());
+               WITHSELF(it, race_PreparePlayer());
                it.race_place = p;
        ));
 }
index 344f05846f742cdb4d59b2c98ac053be715d1b8d..51af4d16e311e4857e84e1572f2acd6acc2e8c39 100644 (file)
@@ -50,11 +50,11 @@ bool SpawnEvent_Send(entity this, entity to, int sf)
 void spawnpoint_think()
 {
     SELFPARAM();
-       self.nextthink = time + 0.1;
-       if(self.origin != self.spawnpoint_prevorigin)
+       this.nextthink = time + 0.1;
+       if(this.origin != this.spawnpoint_prevorigin)
        {
-               self.spawnpoint_prevorigin = self.origin;
-               self.SendFlags |= 1;
+               this.spawnpoint_prevorigin = this.origin;
+               this.SendFlags |= 1;
        }
 }
 
@@ -261,9 +261,7 @@ vector Spawn_Score(entity spot, float mindist, float teamcheck)
                        ++found;
                        if(ent.spawn_evalfunc)
                        {
-                               WITH(entity, self, ent, {
-                                       spawn_score = ent.spawn_evalfunc(this, spot, spawn_score);
-                               });
+                               WITHSELF(ent, spawn_score = ent.spawn_evalfunc(this, spot, spawn_score));
                                if(spawn_score.x < 0)
                                        return spawn_score;
                        }
index 792885070ebe329e9ec2a59d7ac2505fb1558285..e7d6dbfb5b2b9f34cc5eb967930ce4d3d34e5ca7 100644 (file)
@@ -117,12 +117,12 @@ void CreatureFrame_FallDamage(entity this)
 
 void CreatureFrame_All()
 {
-       FOREACH_ENTITY_FLOAT(damagedbycontents, true, LAMBDA(
-               if(it.movetype == MOVETYPE_NOCLIP) continue;
+       FOREACH_ENTITY_FLOAT(damagedbycontents, true, {
+               if (it.movetype == MOVETYPE_NOCLIP) continue;
                CreatureFrame_Liquids(it);
                CreatureFrame_FallDamage(it);
                it.oldvelocity = it.velocity;
-       ));
+       });
 }
 
 void Pause_TryPause(bool ispaused)
@@ -158,8 +158,8 @@ void PM_Main(Client this);
 void StartFrame()
 {
     // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction)
-    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_NOT_A_CLIENT(it), PM_Main(it));
-    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_NOT_A_CLIENT(it), WITH(entity, self, it, PlayerPreThink()));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PM_Main(it));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), WITHSELF(it, PlayerPreThink()));
 
        execute_next_frame();
        if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause(true);
@@ -190,10 +190,9 @@ void StartFrame()
        }
 #endif
 
-       FOREACH_ENTITY_FLOAT(csqcprojectile_clientanimate, true, LAMBDA(CSQCProjectile_Check(it)));
+       FOREACH_ENTITY_FLOAT(csqcprojectile_clientanimate, true, CSQCProjectile_Check(it));
 
-       if(RedirectionThink())
-               return;
+       if (RedirectionThink()) return;
 
        UncustomizeEntitiesRun();
        InitializeEntitiesRun();
@@ -201,8 +200,7 @@ void StartFrame()
        WarpZone_StartFrame();
 
        sys_frametime = autocvar_sys_ticrate * autocvar_slowmo;
-       if(sys_frametime <= 0)
-               sys_frametime = 1.0 / 60.0; // somewhat safe fallback
+       if (sys_frametime <= 0) sys_frametime = 1.0 / 60.0; // somewhat safe fallback
 
        if (timeout_status == TIMEOUT_LEADTIME) // just before the timeout (when timeout_status will be TIMEOUT_ACTIVE)
                orig_slowmo = autocvar_slowmo; // slowmo will be restored after the timeout
@@ -212,7 +210,7 @@ void StartFrame()
        // detect when the pre-game countdown (if any) has ended and the game has started
        game_delay = (time < game_starttime);
 
-       if(autocvar_sv_eventlog && game_delay_last && !game_delay)
+       if (autocvar_sv_eventlog && game_delay_last && !game_delay)
                GameLogEcho(":startdelay_ended");
 
        game_delay_last = game_delay;
@@ -220,8 +218,7 @@ void StartFrame()
        CreatureFrame_All();
        CheckRules_World();
 
-       if(warmup_stage && !gameover && warmup_limit > 0 && time >= warmup_limit)
-       {
+       if (warmup_stage && !gameover && warmup_limit > 0 && time >= warmup_limit) {
                ReadyRestart();
                return;
        }
@@ -230,8 +227,8 @@ void StartFrame()
        anticheat_startframe();
        MUTATOR_CALLHOOK(SV_StartFrame);
 
-    FOREACH_CLIENT(true, LAMBDA(GlobalStats_update(it)));
-    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_NOT_A_CLIENT(it), WITH(entity, self, it, PlayerPostThink()));
+    FOREACH_CLIENT(true, GlobalStats_update(it));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), WITHSELF(it, PlayerPostThink()));
 }
 
 .vector originjitter;
index 0b153fff1e4cc3f472089f90fcbf15b0529e0921..b0e21e746f0cf39433ddeb1cd486f13146eaa8c8 100644 (file)
@@ -11,12 +11,12 @@ TEST(Weapons, Hurt)
 {
     entity it;
 
-    Client a = it = NEW(Client, "A");
+    noref Client a = it = NEW(Client, "A");
     WITH(float, autocvar_g_spawnshieldtime, 0, Client_Add(it, NUM_TEAM_1));
     it.origin = '-100 0 0';
     it.angles = '0 0 0';
 
-    Client b = it = NEW(Client, "B");
+    noref Client b = it = NEW(Client, "B");
     WITH(float, autocvar_g_spawnshieldtime, 0, Client_Add(it, NUM_TEAM_2));
     it.origin = '100 0 0';
     it.angles = '0 180 0';
@@ -36,3 +36,20 @@ TEST(Weapons, Hurt)
 
     SUCCEED();
 }
+
+TEST(Vehicles, Spawn)
+{
+    entity it;
+
+    noref Client bot = it = NEW(Client, "Rider");
+    Client_Add(it, NUM_TEAM_1);
+    it.origin = '0 0 100';
+
+    noref entity v = it = new(vehicle);
+    Vehicle veh = VEH_BUMBLEBEE;
+    it.active = ACTIVE_NOT;
+    vehicle_initialize(it, veh, false);
+    it.nextthink = time;
+
+    SUCCEED();
+}
index 05c8d371fb41342a10269f844158c2f222dee6fe..be6445b48e4c696ca82ffef01dd7207807229754 100644 (file)
@@ -8,3 +8,4 @@
 #include <common/items/item.qh>
 #include <common/physics/player.qh>
 #include <common/weapons/all.qh>
+#include <common/vehicles/all.qh>
diff --git a/qcsrc/server/weapons/_mod.inc b/qcsrc/server/weapons/_mod.inc
new file mode 100644 (file)
index 0000000..cb24b27
--- /dev/null
@@ -0,0 +1,11 @@
+// generated file; do not modify
+#include "accuracy.qc"
+#include "common.qc"
+#include "csqcprojectile.qc"
+#include "hitplot.qc"
+#include "selection.qc"
+#include "spawning.qc"
+#include "throwing.qc"
+#include "tracing.qc"
+#include "weaponstats.qc"
+#include "weaponsystem.qc"
index 0d729fd6b331461f0e1ab888736e80326a5f8def..27d35643de1415f389a6ed61819ce3f22983e69c 100644 (file)
@@ -72,7 +72,7 @@ bool client_hasweapon(entity cl, Weapon wpn, float andammo, bool complain)
                        }
                        else
                        {
-                               WITH(entity, self, cl, f = wpn.wr_checkammo1(wpn) + wpn.wr_checkammo2(wpn));
+                               WITHSELF(cl, f = wpn.wr_checkammo1(wpn) + wpn.wr_checkammo2(wpn));
 
                                // always allow selecting the Mine Layer if we placed mines, so that we can detonate them
                                if(wpn == WEP_MINE_LAYER)
@@ -226,11 +226,12 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
        return 0;
 }
 
-void W_SwitchWeapon_Force(entity e, Weapon wep)
+void W_SwitchWeapon_Force(Player this, Weapon wep)
 {
-       e.cnt = PS(e).m_switchweapon.m_id;
-       PS(e).m_switchweapon = wep;
-       e.selectweapon = wep.m_id;
+    TC(Player, this); TC(Weapon, wep);
+       this.cnt = PS(this).m_switchweapon.m_id;
+       PS(this).m_switchweapon = wep;
+       this.selectweapon = wep.m_id;
 }
 
 // perform weapon to attack (weaponstate and attack_finished check is here)
index 5800f9415ed20d514d9b6609f62fed106756158d..07f27f5b5d2f17e4c99f298caf3552090130beaa 100644 (file)
@@ -11,7 +11,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
 
 #define w_getbestweapon(ent) Weapons_from(W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true))
 
-void W_SwitchWeapon_Force(entity e, Weapon w);
+void W_SwitchWeapon_Force(Player this, Weapon w);
 
 // perform weapon to attack (weaponstate and attack_finished check is here)
 void W_SwitchToOtherWeapon(entity pl);
index 9c8bd6cb588fe9234c083b053c49f921620e9a48..311edd0883586944d3bd5b28e6e61c2afe5d7d8a 100644 (file)
@@ -349,8 +349,8 @@ void fireBullet_trace_callback(vector start, vector hit, vector end)
        fireBullet_last_hit = world;
 }
 
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
-{SELFPARAM();
+void fireBullet(entity this, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
+{
        vector  end;
 
        dir = normalize(dir + randomvec() * spread);
@@ -367,28 +367,28 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat
        else
                fireBullet_trace_callback_eff = EFFECT_BULLET;
 
-       float lag = ANTILAG_LATENCY(self);
+       float lag = ANTILAG_LATENCY(this);
        if(lag < 0.001)
                lag = 0;
-       if (!IS_REAL_CLIENT(self))
+       if (!IS_REAL_CLIENT(this))
                lag = 0;
-       if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
+       if(autocvar_g_antilag == 0 || this.cvar_cl_noantilag)
                lag = 0; // only do hitscan, but no antilag
        if(lag)
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && it != self, antilag_takeback(it, CS(it), time - lag));
+               FOREACH_CLIENT(IS_PLAYER(it) && it != this, antilag_takeback(it, CS(it), time - lag));
                FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
-                       if (it != self)
+                       if (it != this)
                                antilag_takeback(it, it, time - lag);
                });
        }
 
        // change shooter to SOLID_BBOX so the shot can hit corpses
-       int oldsolid = self.dphitcontentsmask;
-       if(self)
-               self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+       int oldsolid = this.dphitcontentsmask;
+       if(this)
+               this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 
-       WarpZone_trace_forent = self;
+       WarpZone_trace_forent = this;
 
        for (;;)
        {
@@ -426,23 +426,23 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat
                        is_weapclip = true;
 
                if(!hit || hit.solid == SOLID_BSP || hit.solid == SOLID_SLIDEBOX)
-                       Damage_DamageInfo(start, damage * solid_penetration_left, 0, 0, max(1, force) * dir * solid_penetration_left, dtype, hit.species, self);
+                       Damage_DamageInfo(start, damage * solid_penetration_left, 0, 0, max(1, force) * dir * solid_penetration_left, dtype, hit.species, this);
 
                if (hit && hit != WarpZone_trace_forent && hit != fireBullet_last_hit)  // Avoid self-damage (except after going through a warp); avoid hitting the same entity twice (engine bug).
                {
                        fireBullet_last_hit = hit;
                        yoda = 0;
-                       MUTATOR_CALLHOOK(FireBullet_Hit, self, hit, start, end, damage);
+                       MUTATOR_CALLHOOK(FireBullet_Hit, this, hit, start, end, damage);
                        damage = frag_damage;
-                       float g = accuracy_isgooddamage(self, hit);
-                       Damage(hit, self, self, damage * solid_penetration_left, dtype, start, force * dir * solid_penetration_left);
+                       float g = accuracy_isgooddamage(this, hit);
+                       Damage(hit, this, this, damage * solid_penetration_left, dtype, start, force * dir * solid_penetration_left);
                        // calculate hits for ballistic weapons
                        if(g)
                        {
                                // do not exceed 100%
                                float added_damage = min(damage - total_damage, damage * solid_penetration_left);
                                total_damage += damage * solid_penetration_left;
-                               accuracy_add(self, PS(self).m_weapon.m_id, 0, added_damage);
+                               accuracy_add(this, PS(this).m_weapon.m_id, 0, added_damage);
                        }
                }
 
@@ -481,24 +481,24 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat
                // Only show effect when going through a player (invisible otherwise)
                if (hit && (hit.solid != SOLID_BSP))
                        if(vdist(trace_endpos - start, >, 4))
-                               trailparticles(self, fireBullet_trace_callback_eff, start, trace_endpos);
+                               trailparticles(this, fireBullet_trace_callback_eff, start, trace_endpos);
 
                start = trace_endpos;
 
                if(hit.solid == SOLID_BSP)
-                       Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -solid_penetration_left, dtype, 0, self);
+                       Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -solid_penetration_left, dtype, 0, this);
        }
 
        if(lag)
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && it != self, antilag_restore(it, CS(it)));
+               FOREACH_CLIENT(IS_PLAYER(it) && it != this, antilag_restore(it, CS(it)));
                FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
-                       if (it != self)
+                       if (it != this)
                                antilag_restore(it, it);
                });
        }
 
        // restore shooter solid type
-       if(self)
-               self.dphitcontentsmask = oldsolid;
+       if(this)
+               this.dphitcontentsmask = oldsolid;
 }
index 08b7094c2650eaca235dbb042928cd3c524b0511..fed7364b2556f2435a0a7a8635d5b6977c61e9e5 100644 (file)
@@ -54,4 +54,4 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
 entity fireBullet_trace_callback_eff;
 entity fireBullet_last_hit;
 void fireBullet_trace_callback(vector start, vector hit, vector end);
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);
+void fireBullet(entity this, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);
index 999688b46897cbdd79e51b27e45a1ce7b7e70f1f..f44b3929013c2a5929abed8cb8add8679145017e 100644 (file)
@@ -75,7 +75,7 @@ void CL_Weaponentity_Think()
                remove(this);
                return;
        }
-       if (IS_DEAD(self.owner))
+       if (IS_DEAD(this.owner))
        {
                // owner died; disappear
                this.model = "";
@@ -116,7 +116,7 @@ void CL_ExteriorWeaponentity_Think()
                remove(this);
                return;
        }
-       if (IS_DEAD(self.owner))
+       if (IS_DEAD(this.owner))
        {
                this.model = "";
                return;
@@ -213,8 +213,8 @@ bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary
     SELFPARAM();
        if ((actor.items & IT_UNLIMITED_WEAPON_AMMO)) return true;
        bool ammo = false;
-       if (secondary) WITH(entity, self, actor, ammo = thiswep.wr_checkammo2(thiswep));
-       else WITH(entity, self, actor, ammo = thiswep.wr_checkammo1(thiswep));
+       if (secondary) WITHSELF(actor, ammo = thiswep.wr_checkammo2(thiswep));
+       else WITHSELF(actor, ammo = thiswep.wr_checkammo1(thiswep));
        if (ammo) return true;
        // always keep the Mine Layer if we placed mines, so that we can detonate them
        if (thiswep == WEP_MINE_LAYER)
@@ -232,8 +232,8 @@ bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary
 
        // check if the other firing mode has enough ammo
        bool ammo_other = false;
-       if (secondary) WITH(entity, self, actor, ammo_other = thiswep.wr_checkammo1(thiswep));
-       else WITH(entity, self, actor, ammo_other = thiswep.wr_checkammo2(thiswep));
+       if (secondary) WITHSELF(actor, ammo_other = thiswep.wr_checkammo1(thiswep));
+       else WITHSELF(actor, ammo_other = thiswep.wr_checkammo2(thiswep));
        if (ammo_other)
        {
                if (time - actor.prevwarntime > 1)
@@ -414,8 +414,10 @@ bool forbidWeaponUse(entity player)
 
 .bool hook_switchweapon;
 
-void W_WeaponFrame(entity actor)
+void W_WeaponFrame(Player actor)
 {
+    TC(Player, actor);
+    TC(PlayerState, PS(actor));
        .entity weaponentity = weaponentities[0];  // TODO: unhardcode
        entity this = actor.(weaponentity);
        if (frametime) actor.weapon_frametime = frametime;
@@ -558,11 +560,12 @@ void W_WeaponFrame(entity actor)
                if (!block_weapon)
                {
             Weapon e = PS(actor).m_weapon;
+            TC(Weapon, e);
                        if (w != WEP_Null)
                        {
                                e.wr_think(e, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
                        }
-                       else
+                       else if (e)
                        {
                                e.wr_gonethink(e);
                        }
@@ -769,5 +772,5 @@ void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity w
     SELFPARAM();
        Weapon w = Weapons_from(weapon_type);
        weapon_dropevent_item = weapon_item;
-       WITH(entity, self, player, w.event(w));
+       WITHSELF(player, w.event(w));
 }
index e65ffd67b4a56c9fdb2222991c6a29193addfd05..74d120150fc788e917a591beeb98e2c1f7655818 100644 (file)
@@ -18,7 +18,7 @@ void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity w
 
 void W_Reload(entity actor, float sent_ammo_min, Sound sent_sound);
 
-void W_WeaponFrame(entity actor);
+void W_WeaponFrame(Player actor);
 
 float W_WeaponRateFactor();
 
index 676c3f315a79d440c9f0e9e0aca14d73ead96df7..3c794e93fbba747b9eb43b6954a86a3c4a0856cf 100755 (executable)
@@ -9,7 +9,7 @@ CPP="cc -xc -E"
 
 declare -a QCCDEFS=(
     -DNDEBUG=1
-    -DWATERMARK="\"$(git describe --tags --dirty='*')\""
+    -DWATERMARK="\"$(git describe --tags --dirty='~')\""
     -DDEBUGPATHING=0
 )
 QCCDEFS="${QCCDEFS[@]}"
diff --git a/qcsrc/tools/genmod.sh b/qcsrc/tools/genmod.sh
new file mode 100755 (executable)
index 0000000..269c631
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -eu
+cd "$(dirname "$0")"
+cd ..
+
+MOD=_mod.inc
+
+function genmod() {
+    echo '// generated file; do not modify' > ${MOD}
+    for f in $(ls | sort -k 1,1 -t .); do
+        if [[ "$f" == *.qc ]]; then echo "#include \"$f\"" >> ${MOD}; fi
+    done
+    # echo >> ${MOD}
+    for f in *; do if [ -d "$f" ]; then
+        (cd -- "$f" && genmod)
+        # echo "#include \"$f/MOD\"" >> ${MOD}
+    fi; done
+}
+
+(cd lib; genmod)
+(cd common; genmod)
+(cd client; genmod)
+(cd server; genmod)
+(cd menu; genmod)
index 0c7b3be58a5ba96db025c59ff4e615ef95517efc..b16c16ac4ca23c5f2c531563e123bb7be888f9fc 100644 (file)
@@ -51,6 +51,8 @@ set g_turrets_unit_ewheel_aim_maxpitch 45
 set g_turrets_unit_ewheel_track_type 1
 set g_turrets_unit_ewheel_track_accel_pitch 0
 set g_turrets_unit_ewheel_track_accel_rot 0
+
+set g_turrets_unit_ewheel_track_blendrate 0
 // }}}
 // {{{ #2: FLAC Cannon
 set g_turrets_unit_flac_health 700
@@ -420,6 +422,22 @@ set g_turrets_unit_tesla_target_select_missilebias 1
 set g_turrets_unit_tesla_ammo_max 1000
 set g_turrets_unit_tesla_ammo 200
 set g_turrets_unit_tesla_ammo_recharge 15
+
+set g_turrets_unit_tesla_shot_radius 0
+set g_turrets_unit_tesla_shot_speed 0
+set g_turrets_unit_tesla_shot_spread 0
+set g_turrets_unit_tesla_target_range_optimal 0
+set g_turrets_unit_tesla_target_select_rangebias 0
+set g_turrets_unit_tesla_target_select_samebias 0
+set g_turrets_unit_tesla_target_select_anglebias 0
+set g_turrets_unit_tesla_aim_firetolerance_dist 0
+set g_turrets_unit_tesla_aim_speed 0
+set g_turrets_unit_tesla_aim_maxrot 0
+set g_turrets_unit_tesla_aim_maxpitch 0
+set g_turrets_unit_tesla_track_type 0
+set g_turrets_unit_tesla_track_accel_pitch 0
+set g_turrets_unit_tesla_track_accel_rot 0
+set g_turrets_unit_tesla_track_blendrate 0
 // }}}
 // {{{ #12: Walker Turret
 set g_turrets_unit_walker_health 500