]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/hagar_notfixed 297/head
authorMario <mario@smbclan.net>
Tue, 5 Apr 2016 22:55:40 +0000 (08:55 +1000)
committerMario <mario@smbclan.net>
Tue, 5 Apr 2016 22:55:40 +0000 (08:55 +1000)
186 files changed:
.gitlab-ci.yml
_hud_common.cfg
_hud_descriptions.cfg
defaultXonotic.cfg
gamemodes.cfg
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/panel/healtharmor.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/view.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/items/inventory.qh
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/common/mutators/mutator/multijump/multijump.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/hmg.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/mutators/mutator/physical_items/physical_items.qc
qcsrc/common/net_notice.qc
qcsrc/common/physics/movelib.qc
qcsrc/common/physics/movelib.qh
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/push.qc
qcsrc/common/physics/player.qc
qcsrc/common/playerstats.qc
qcsrc/common/state.qc
qcsrc/common/t_items.qc
qcsrc/common/t_items.qh
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_rotating.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/func/vectormamamam.qc
qcsrc/common/triggers/misc/follow.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/teleporters.qh
qcsrc/common/triggers/trigger/gamestart.qc
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/jumppads.qh
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/secret.qc
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/triggers/triggers.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh
qcsrc/common/weapons/all.qh
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
qcsrc/lib/defer.qh
qcsrc/lib/iter.qh
qcsrc/lib/json.qc [new file with mode: 0644]
qcsrc/lib/log.qh
qcsrc/lib/matrix/_mod.inc [new file with mode: 0644]
qcsrc/lib/matrix/command.qc [new file with mode: 0644]
qcsrc/lib/matrix/command.qh [new file with mode: 0644]
qcsrc/lib/matrix/matrix.qc [new file with mode: 0644]
qcsrc/lib/matrix/matrix.qh [new file with mode: 0644]
qcsrc/lib/net.qh
qcsrc/lib/oo.qh
qcsrc/lib/self.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/string.qh
qcsrc/lib/test.qh
qcsrc/lib/urllib.qc
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
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/matrix.qc [new file with mode: 0644]
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/checkbox.qc
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qh
qcsrc/menu/xonotic/dialog_settings_effects.qc
qcsrc/menu/xonotic/dialog_settings_video.qc
qcsrc/menu/xonotic/slider.qc
qcsrc/server/_all.qh
qcsrc/server/_mod.inc
qcsrc/server/antilag.qc
qcsrc/server/autocvars.qh
qcsrc/server/bot/bot.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.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_lights.qc
qcsrc/server/g_models.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_subs.qh
qcsrc/server/g_world.qc
qcsrc/server/g_world.qh
qcsrc/server/matrix.qc [new file with mode: 0644]
qcsrc/server/matrix.qh [new file with mode: 0644]
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/events.qh
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_cts.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/playerdemo.qc
qcsrc/server/race.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_quake3.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh
qcsrc/server/tests.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh
qcsrc/server/weapons/weaponsystem.qc
serverbench.cfg

index e345c88d9f086b41b825523f6468e07919cf3cd4..2e13641a06b69d0bd6e52a5c70d5510def66516c 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:
@@ -12,9 +17,14 @@ test_sv_game:
     - cd darkplaces && make sv-debug -j $(nproc) && export ENGINE="$PWD/darkplaces-dedicated -xonotic"
     - cd ..
 
+    - mkdir -p data/maps
     - wget -O data/g-23.pk3 http://beta.xonotic.org/autobuild-bsp/latest/g-23.pk3
+    - wget -O data/maps/g-23.mapinfo https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.mapinfo
+    - wget -O data/maps/g-23.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints
+    - wget -O data/maps/g-23.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.cache
+    - wget -O data/maps/g-23.waypoints.hardwired https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.hardwired
     - make
-    - EXPECT=8573348372f9b9f82183b01598950eb5
+    - EXPECT=814b0e609bcf01dc2a44f2b17fa366b4
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
@@ -41,11 +51,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 70900762f7a3cb1b5da162db9fcc2e34cf986461..0fbf103d5542771a10077518df1bf40f4c55d08f 100644 (file)
@@ -20,6 +20,31 @@ seta hud_colorset_kill_3 "4" "'good' or 'beneficial' text (you fragging someone,
 seta hud_colorset_background "7" "neutral/unimportant text"
 
 // general hud panel cvars (i.e. shouldn't be adjusted by a skin config)
+seta hud_panel_weapons          1 "enable this panel"
+seta hud_panel_ammo             1 "enable this panel"
+seta hud_panel_powerups         1 "enable this panel"
+seta hud_panel_healtharmor      1 "enable this panel"
+seta hud_panel_notify           1 "enable this panel"
+seta hud_panel_timer            1 "enable this panel"
+seta hud_panel_radar            1 "enable this panel, 2 = also enable in non-teambased gamemodes"
+seta hud_panel_score            1 "enable this panel"
+seta hud_panel_racetimer        1 "enable this panel"
+seta hud_panel_vote             1 "enable this panel"
+seta hud_panel_modicons         1 "enable this panel"
+seta hud_panel_pressedkeys      1 "enable this panel, 1 = show only when spectating other players, 2 = show always"
+seta hud_panel_chat             1 "enable this panel"
+seta hud_panel_engineinfo       0 "enable this panel"
+seta hud_panel_infomessages     1 "enable this panel"
+seta hud_panel_physics          3 "enable this panel, 1 = show if not observing, 2 = show always, 3 = show only in race/cts if not observing"
+seta hud_panel_centerprint      1 "enable this panel"
+seta hud_panel_minigameboard    1 "enable this panel"
+seta hud_panel_minigamestatus   1 "enable this panel"
+seta hud_panel_minigamehelp     1 "enable this panel"
+seta hud_panel_minigamemenu     0 "enable this panel"
+seta hud_panel_mapvote          1 "enable this panel"
+seta hud_panel_itemstime        2 "enable this panel, 1 = show when spectating, 2 = even playing in warmup stage"
+seta hud_panel_quickmenu        1 "enable this panel"
+
 seta hud_panel_weapons_ammo_full_shells 60 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_nails 320 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_cells 180 "show 100% of the status bar at this ammo count"
index 970d6ff7f3ed1c24407957f2b5ee8dac491b6e94..de46317116aec1944872f71ccf56d7626aeeed61 100644 (file)
@@ -34,7 +34,6 @@ seta hud_configure_grid "" "snap to grid when moving/resizing panels"
 seta hud_configure_grid_xsize "" "snap to X * vid_conwidth"
 seta hud_configure_grid_ysize "" "snap to Y * vid_conheight"
 
-seta hud_panel_weapons "" "enable/disable this panel"
 seta hud_panel_weapons_pos "" "position of this panel"
 seta hud_panel_weapons_size "" "size of this panel"
 seta hud_panel_weapons_bg "" "if set to something else than \"\" = override default background"
@@ -67,7 +66,6 @@ seta hud_panel_weapons_onlyowned "" "show only owned weapons"
 seta hud_panel_weapons_noncurrent_alpha "" "alpha of noncurrent weapons"
 seta hud_panel_weapons_noncurrent_scale "" "scale of noncurrent weapons, relative to the current weapon"
 
-seta hud_panel_ammo "" "enable/disable this panel"
 seta hud_panel_ammo_pos "" "position of this panel"
 seta hud_panel_ammo_size "" "size of this panel"
 seta hud_panel_ammo_onlycurrent "" "1 = show only current ammo type"
@@ -85,7 +83,6 @@ seta hud_panel_ammo_progressbar_xoffset "" "percentage of mySize_x to offset pro
 seta hud_panel_ammo_progressbar_name "" "name of progressbar to use behind ammo icons"
 seta hud_panel_ammo_text "" "show text/icons in the ammo panel"
 
-seta hud_panel_powerups "" "enable/disable this panel"
 seta hud_panel_powerups_pos "" "position of this panel"
 seta hud_panel_powerups_size "" "size of this panel"
 seta hud_panel_powerups_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right"
@@ -99,9 +96,9 @@ seta hud_panel_powerups_bg_padding "" "if set to something else than \"\" = over
 seta hud_panel_powerups_progressbar "" "enable progressbar in panel"
 seta hud_panel_powerups_text "" "show text and icons in the powerups panel"
 
-seta hud_panel_healtharmor "" "enable/disable this panel, 2 = combined health/armor display"
 seta hud_panel_healtharmor_pos "" "position of this panel"
 seta hud_panel_healtharmor_size "" "size of this panel"
+seta hud_panel_healtharmor_combined "" "combined health/armor display"
 seta hud_panel_healtharmor_flip "" "flip health/armor positions"
 seta hud_panel_healtharmor_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right"
 seta hud_panel_healtharmor_iconalign "" "0 = align icons to the left, 1 = align icons to the right, 2 = align only left icon to the right, 3 = align only right icon to the right"
@@ -118,7 +115,6 @@ seta hud_panel_healtharmor_progressbar_armor "" "progressbar image for armor"
 seta hud_panel_healtharmor_progressbar_gfx "" "enable graphic effects on the progressbars"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "" "smooth changes of the progressbar when health/armor change at least by this amount; 0 disables the effect"
 
-seta hud_panel_notify "" "enable/disable this panel"
 seta hud_panel_notify_pos "" "position of this base of the panel"
 seta hud_panel_notify_size "" "size of this panel with all notifications on"
 seta hud_panel_notify_bg "" "if set to something else than \"\" = override default background"
@@ -133,7 +129,6 @@ seta hud_panel_notify_fadetime "" "fade out time"
 seta hud_panel_notify_time "" "time that a new entry stays until it fades out"
 seta hud_panel_notify_icon_aspect "" "aspect ratio of total drawing area per icon"
 
-seta hud_panel_timer "" "enable/disable this panel"
 seta hud_panel_timer_pos "" "position of this base of the panel"
 seta hud_panel_timer_size "" "size of this panel"
 seta hud_panel_timer_bg "" "if set to something else than \"\" = override default background"
@@ -143,7 +138,6 @@ seta hud_panel_timer_bg_alpha "" "if set to something else than \"\" = override
 seta hud_panel_timer_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_timer_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_radar "" "enable/disable this panel, 2 = also enable in non-teambased gamemodes"
 seta hud_panel_radar_pos "" "position of this base of the panel"
 seta hud_panel_radar_size "" "size of this panel"
 seta hud_panel_radar_bg "" "if set to something else than \"\" = override default background"
@@ -161,7 +155,6 @@ seta hud_panel_radar_maximized_size "" "size of the radar when maximized"
 seta hud_panel_radar_maximized_rotation "" "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
 seta hud_panel_radar_maximized_zoommode "" "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
 
-seta hud_panel_score "" "enable/disable this panel"
 seta hud_panel_score_pos "" "position of this base of the panel"
 seta hud_panel_score_size "" "size of this panel"
 seta hud_panel_score_bg "" "if set to something else than \"\" = override default background"
@@ -172,7 +165,6 @@ seta hud_panel_score_bg_border "" "if set to something else than \"\" = override
 seta hud_panel_score_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_score_rankings "" "show rankings: 1 always show my own score; 2 pure rankings"
 
-seta hud_panel_racetimer "" "enable/disable this panel"
 seta hud_panel_racetimer_pos "" "position of this base of the panel"
 seta hud_panel_racetimer_size "" "size of this panel"
 seta hud_panel_racetimer_bg "" "if set to something else than \"\" = override default background"
@@ -182,7 +174,6 @@ seta hud_panel_racetimer_bg_alpha "" "if set to something else than \"\" = overr
 seta hud_panel_racetimer_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_racetimer_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_vote "" "enable/disable this panel"
 seta hud_panel_vote_pos "" "position of this base of the panel"
 seta hud_panel_vote_size "" "size of this panel"
 seta hud_panel_vote_alreadyvoted_alpha "" "alpha of the vote dialog after you have voted"
@@ -193,7 +184,6 @@ seta hud_panel_vote_bg_alpha "" "if set to something else than \"\" = override d
 seta hud_panel_vote_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_vote_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_modicons "" "enable/disable this panel"
 seta hud_panel_modicons_pos "" "position of this base of the panel"
 seta hud_panel_modicons_size "" "size of this panel"
 seta hud_panel_modicons_bg "" "if set to something else than \"\" = override default background"
@@ -206,7 +196,6 @@ seta hud_panel_modicons_ca_layout "" "2 possible layouts: 0) number of alive pla
 seta hud_panel_modicons_dom_layout "" "3 possible layouts: 0) only icons; 1) icons and percentage of average pps (points per second); 2) icons and average pps"
 seta hud_panel_modicons_freezetag_layout "" "2 possible layouts: 0) number of alive players; 1) icons and number of alive players"
 
-seta hud_panel_pressedkeys "" "enable/disable this panel, 1 = show only when spectating other players, 2 = show always"
 seta hud_panel_pressedkeys_pos "" "position of this base of the panel"
 seta hud_panel_pressedkeys_size "" "size of this panel"
 seta hud_panel_pressedkeys_bg "" "if set to something else than \"\" = override default background"
@@ -218,7 +207,6 @@ seta hud_panel_pressedkeys_bg_padding "" "if set to something else than \"\" = o
 seta hud_panel_pressedkeys_aspect "" "forced aspect on panel"
 seta hud_panel_pressedkeys_attack "" "show attack buttons too"
 
-seta hud_panel_chat "" "enable/disable this panel"
 seta hud_panel_chat_pos "" "position of this base of the panel"
 seta hud_panel_chat_size "" "size of this panel"
 seta hud_panel_chat_bg "" "if set to something else than \"\" = override default background"
@@ -228,7 +216,6 @@ seta hud_panel_chat_bg_alpha "" "if set to something else than \"\" = override d
 seta hud_panel_chat_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_chat_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_engineinfo "" "enable/disable this panel"
 seta hud_panel_engineinfo_pos "" "position of this base of the panel"
 seta hud_panel_engineinfo_size "" "size of this panel"
 seta hud_panel_engineinfo_bg "" "if set to something else than \"\" = override default background"
@@ -240,7 +227,6 @@ seta hud_panel_engineinfo_bg_padding "" "if set to something else than \"\" = ov
 seta hud_panel_engineinfo_framecounter_decimals "" "amount of decimals to show"
 seta hud_panel_engineinfo_framecounter_time "" "time between framerate display updates"
 
-seta hud_panel_infomessages "" "enable/disable this panel"
 seta hud_panel_infomessages_pos "" "position of this base of the panel"
 seta hud_panel_infomessages_size "" "size of this panel"
 seta hud_panel_infomessages_bg "" "if set to something else than \"\" = override default background"
@@ -251,7 +237,6 @@ seta hud_panel_infomessages_bg_border "" "if set to something else than \"\" = o
 seta hud_panel_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_infomessages_flip "" "1 = align the items to the right"
 
-seta hud_panel_physics "" "enable/disable this panel, 1 = show if not observing, 2 = show always, 3 = show only in race/cts if not observing"
 seta hud_panel_physics_pos "" "position of this base of the panel"
 seta hud_panel_physics_size "" "size of this panel"
 seta hud_panel_physics_bg "" "if set to something else than \"\" = override default background"
@@ -276,7 +261,6 @@ seta hud_panel_physics_speed_vertical "" "include the speed on the Z-axis"
 seta hud_panel_physics_topspeed "" "also show top speed"
 seta hud_panel_physics_topspeed_time "" "how many seconds the top speed takes to fade out"
 
-seta hud_panel_centerprint "" "enable/disable this panel"
 seta hud_panel_centerprint_pos "" "position of this base of the panel"
 seta hud_panel_centerprint_size "" "size of this panel"
 seta hud_panel_centerprint_bg "" "if set to something else than \"\" = override default background"
@@ -299,7 +283,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "" "minimum factor t
 seta hud_panel_centerprint_fade_subsequent_minfontsize "" "minimum factor for the font size from the subsequent fading effects"
 seta hud_panel_centerprint_fade_minfontsize "" "minimum factor for the font size from the fading in/out effects"
 
-seta hud_panel_minigameboard "" "enable/disable this panel"
 seta hud_panel_minigameboard_pos "" "position of this panel"
 seta hud_panel_minigameboard_size "" "size of this panel"
 seta hud_panel_minigameboard_bg "" "if set to something else than \"\" = override default background"
@@ -309,7 +292,6 @@ seta hud_panel_minigameboard_bg_alpha "" "if set to something else than \"\" = o
 seta hud_panel_minigameboard_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_minigameboard_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_minigamestatus "" "enable/disable this panel"
 seta hud_panel_minigamestatus_pos "" "position of this panel"
 seta hud_panel_minigamestatus_size "" "size of this panel"
 seta hud_panel_minigamestatus_bg "" "if set to something else than \"\" = override default background"
@@ -319,7 +301,6 @@ seta hud_panel_minigamestatus_bg_alpha "" "if set to something else than \"\" =
 seta hud_panel_minigamestatus_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_minigamestatus_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_minigamehelp "" "enable/disable this panel"
 seta hud_panel_minigamehelp_pos "" "position of this panel"
 seta hud_panel_minigamehelp_size "" "size of this panel"
 seta hud_panel_minigamehelp_bg "" "if set to something else than \"\" = override default background"
@@ -329,7 +310,6 @@ seta hud_panel_minigamehelp_bg_alpha "" "if set to something else than \"\" = ov
 seta hud_panel_minigamehelp_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_minigamehelp_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_minigamemenu "" "enable/disable this panel"
 seta hud_panel_minigamemenu_pos "" "position of this panel"
 seta hud_panel_minigamemenu_size "" "size of this panel"
 seta hud_panel_minigamemenu_bg "" "if set to something else than \"\" = override default background"
@@ -339,7 +319,6 @@ seta hud_panel_minigamemenu_bg_alpha "" "if set to something else than \"\" = ov
 seta hud_panel_minigamemenu_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_minigamemenu_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_mapvote "" "enable/disable this panel"
 seta hud_panel_mapvote_pos "" "position of this panel"
 seta hud_panel_mapvote_size "" "size of this panel"
 seta hud_panel_mapvote_bg "" "if set to something else than \"\" = override default background"
@@ -349,7 +328,6 @@ seta hud_panel_mapvote_bg_alpha "" "if set to something else than \"\" = overrid
 seta hud_panel_mapvote_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_mapvote_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_itemstime "" "enable/disable this panel, it shows left time until important items (mega health, large armor, powerups, superweapons, etc...) respawn in the map: 1 when spectating, 2 even playing in warmup stage"
 seta hud_panel_itemstime_pos "" "position of this base of the panel"
 seta hud_panel_itemstime_size "" "size of this panel"
 seta hud_panel_itemstime_bg "" "if set to something else than \"\" = override default background"
@@ -366,7 +344,6 @@ seta hud_panel_itemstime_text "" "show text"
 seta hud_panel_itemstime_ratio "" "ratio between space reserved for text and icon width of each item entry (min value is 2)"
 seta hud_panel_itemstime_dynamicsize "" "allow panel size reduction by removing spacing among items"
 
-seta hud_panel_quickmenu "" "enable/disable this panel"
 seta hud_panel_quickmenu_pos "" "position of this base of the panel"
 seta hud_panel_quickmenu_size "" "size of this panel"
 seta hud_panel_quickmenu_bg "" "if set to something else than \"\" = override default background"
index 7ed41440f88ebbc56a349ee841a6194804cda7fe..e1531205ec0ced6ebe6f48f9b599e680eaaf7fb1 100644 (file)
@@ -306,6 +306,7 @@ seta sv_precacheitems 0
 set sv_spectator_speed_multiplier 1.5
 seta sv_spectate 1 "if set to 1, new clients are allowed to spectate or observe the game, if set to 0 joining clients spawn as players immediately (no spectating)"
 seta sv_defaultcharacter 0 "master switch, if set to 1 the further configuration for replacing all player models, skins and colors is taken from the sv_defaultplayermodel, sv_defaultplayerskin and sv_defaultplayercolors variables"
+seta sv_defaultcharacterskin 0 "if set to 1 the further configuration for replacing all skins is taken from the sv_defaultplayerskin variables"
 seta sv_defaultplayermodel "models/player/erebus.iqm" "default model selection, only works if sv_defaultcharacter is set to 1; you may append a :<skinnumber> suffix to model names; you can specify multiple, separated by space, and a random one will be chosen"
 seta sv_defaultplayerskin 0 "each model has 1 or more skins (combination of model and skin = character), set which skin of the model you wish the default character to have, only works if sv_defaultcharacter is set to 1; can be overriden by :<skinnumber> suffix in sv_defaultplayermodel"
 seta sv_defaultplayermodel_red ""      "\"\" means see sv_defaultplayermodel"
@@ -772,6 +773,17 @@ seta g_waypointsprite_turrets 1 "disable turret waypoints"
 seta g_waypointsprite_turrets_maxdist 5000 "max distace for turret sprites"
 seta g_waypointsprite_tactical 1 "tactical overlay on turrets when in a vehicle"
 
+seta cl_damagetext "0" "Draw damage dealt where you hit the enemy"
+seta cl_damagetext_format "-{total}" "How to format the damage text. {health}, {armor}, {total}"
+seta cl_damagetext_color "1 1 0" "Damage text color"
+seta cl_damagetext_color_per_weapon "0" "Damage text uses weapon color"
+seta cl_damagetext_size "8" "Damage text font size"
+seta cl_damagetext_alpha_start "1" "Damage text initial alpha"
+seta cl_damagetext_alpha_lifetime "3" "Damage text lifetime in seconds"
+seta cl_damagetext_velocity "0 0 20" "Damage text move direction"
+seta cl_damagetext_offset "0 -40 0" "Damage text offset"
+seta cl_damagetext_accumulate_range "30" "Damage text spawned within this range is accumulated"
+
 set sv_itemstime 1 "enable networking of left time until respawn for items such as mega health and large armor"
 
 // so it can be stuffcmd-ed still
index a4b33b7e21fbbfbb647c9d343cac067a324cc5dd..3f89d676e1f8ef5da239837a056259c60ec52915 100644 (file)
@@ -530,7 +530,7 @@ set g_onslaught_spawn_at_generator_random 0
 // ======
 set g_race 0 "Race: be faster than your opponents"
 set g_race_qualifying_timelimit 0
-set g_race_qualifying_timelimit_override -1
+set g_race_qualifying_timelimit_override -1 "qualifying session time limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
 set g_race_teams 0     "when 2, 3, or 4, the race is played as a team game (the team members can add up their laps)"
 
 // ==========
index 226af4c1bf237ff596b4128c9621d410d1e8df5f..2ec91efca551f9dfacc1b056768948b7f1dd02b0 100644 (file)
@@ -15,7 +15,7 @@ seta hud_dock_color "0 0 0"
 seta hud_dock_color_team "1"
 seta hud_dock_alpha "1"
 
-seta hud_progressbar_alpha "0.600000"
+seta hud_progressbar_alpha "0.6"
 seta hud_progressbar_strength_color "1 0.39 0"
 seta hud_progressbar_superweapons_color "0.77 0.67 0"
 seta hud_progressbar_shield_color "0.36 1 0.07"
@@ -35,7 +35,6 @@ seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.005000"
 seta hud_configure_grid_ysize "0.005000"
 
-seta hud_panel_weapons "1"
 seta hud_panel_weapons_pos "0.965000 0.125000"
 seta hud_panel_weapons_size "0.035000 0.770000"
 seta hud_panel_weapons_bg "border_default_east"
@@ -46,7 +45,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding "0"
 seta hud_panel_weapons_accuracy "0"
 seta hud_panel_weapons_label "1"
-seta hud_panel_weapons_label_scale "0.300000"
+seta hud_panel_weapons_label_scale "0.3"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "0"
 seta hud_panel_weapons_complainbubble_time "0"
@@ -65,10 +64,9 @@ seta hud_panel_weapons_timeout_fadefgmin "0.4"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
-seta hud_panel_weapons_noncurrent_alpha "0.800000"
-seta hud_panel_weapons_noncurrent_scale "0.900000"
+seta hud_panel_weapons_noncurrent_alpha "0.8"
+seta hud_panel_weapons_noncurrent_scale "0.9"
 
-seta hud_panel_ammo "1"
 seta hud_panel_ammo_pos "0.315000 0.865000"
 seta hud_panel_ammo_size "0.370000 0.060000"
 seta hud_panel_ammo_bg "border_tab_south"
@@ -78,15 +76,14 @@ seta hud_panel_ammo_bg_alpha ""
 seta hud_panel_ammo_bg_border ""
 seta hud_panel_ammo_bg_padding "4"
 seta hud_panel_ammo_onlycurrent "0"
-seta hud_panel_ammo_noncurrent_alpha "0.600000"
-seta hud_panel_ammo_noncurrent_scale "0.400000"
+seta hud_panel_ammo_noncurrent_alpha "0.6"
+seta hud_panel_ammo_noncurrent_scale "0.4"
 seta hud_panel_ammo_iconalign "0"
 seta hud_panel_ammo_progressbar "0"
 seta hud_panel_ammo_progressbar_name "progressbar"
 seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
-seta hud_panel_powerups "1"
 seta hud_panel_powerups_pos "0.325000 0.815000"
 seta hud_panel_powerups_size "0.350000 0.055000"
 seta hud_panel_powerups_bg "border_shadow_south"
@@ -100,7 +97,6 @@ seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_text "1"
 
-seta hud_panel_healtharmor "1"
 seta hud_panel_healtharmor_pos "0.300000 0.925000"
 seta hud_panel_healtharmor_size "0.400000 0.070000"
 seta hud_panel_healtharmor_bg "border_default_south"
@@ -109,6 +105,7 @@ seta hud_panel_healtharmor_bg_color_team ""
 seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border "4"
 seta hud_panel_healtharmor_bg_padding ""
+seta hud_panel_healtharmor_combined "0"
 seta hud_panel_healtharmor_flip "0"
 seta hud_panel_healtharmor_iconalign "3"
 seta hud_panel_healtharmor_baralign "3"
@@ -119,7 +116,6 @@ seta hud_panel_healtharmor_progressbar_gfx "1"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
-seta hud_panel_notify "1"
 seta hud_panel_notify_pos "0.730000 0.800000"
 seta hud_panel_notify_size "0.265000 0.200000"
 seta hud_panel_notify_bg "0"
@@ -134,7 +130,6 @@ seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
 seta hud_panel_notify_icon_aspect "1"
 
-seta hud_panel_timer "1"
 seta hud_panel_timer_pos "0.456000 0"
 seta hud_panel_timer_size "0.088000 0.030000"
 seta hud_panel_timer_bg "border_plain_north"
@@ -144,7 +139,6 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar "1"
 seta hud_panel_radar_pos "0 0"
 seta hud_panel_radar_size "0.200000 0.250000"
 seta hud_panel_radar_bg "border_corner_northwest"
@@ -162,7 +156,6 @@ seta hud_panel_radar_maximized_size "0.5 0.5"
 seta hud_panel_radar_maximized_rotation "1"
 seta hud_panel_radar_maximized_zoommode "3"
 
-seta hud_panel_score "1"
 seta hud_panel_score_pos "0.880000 0"
 seta hud_panel_score_size "0.120000 0.080000"
 seta hud_panel_score_bg "border_corner_northeast"
@@ -173,7 +166,6 @@ seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding "1"
 seta hud_panel_score_rankings "1"
 
-seta hud_panel_racetimer "1"
 seta hud_panel_racetimer_pos "0.360000 0.110000"
 seta hud_panel_racetimer_size "0.280000 0.090000"
 seta hud_panel_racetimer_bg "0"
@@ -183,7 +175,6 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
-seta hud_panel_vote "1"
 seta hud_panel_vote_pos "0.740000 0.690000"
 seta hud_panel_vote_size "0.190000 0.090000"
 seta hud_panel_vote_bg " "
@@ -192,9 +183,8 @@ seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
 seta hud_panel_vote_bg_border ""
 seta hud_panel_vote_bg_padding ""
-seta hud_panel_vote_alreadyvoted_alpha "0.700000"
+seta hud_panel_vote_alreadyvoted_alpha "0.7"
 
-seta hud_panel_modicons "1"
 seta hud_panel_modicons_pos "0.370000 0.030000"
 seta hud_panel_modicons_size "0.260000 0.07000"
 seta hud_panel_modicons_bg "border_fading_north"
@@ -207,7 +197,6 @@ seta hud_panel_modicons_ca_layout "1"
 seta hud_panel_modicons_dom_layout "1"
 seta hud_panel_modicons_freezetag_layout "1"
 
-seta hud_panel_pressedkeys "1"
 seta hud_panel_pressedkeys_pos "0.445000 0.710000"
 seta hud_panel_pressedkeys_size "0.110000 0.090000"
 seta hud_panel_pressedkeys_bg " "
@@ -216,10 +205,9 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding "1"
-seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_aspect "1.6"
 seta hud_panel_pressedkeys_attack "0"
 
-seta hud_panel_chat "1"
 seta hud_panel_chat_pos "0.010000 0.700000"
 seta hud_panel_chat_size "0.460000 0.190000"
 seta hud_panel_chat_bg "0"
@@ -229,7 +217,6 @@ seta hud_panel_chat_bg_alpha ""
 seta hud_panel_chat_bg_border ""
 seta hud_panel_chat_bg_padding ""
 
-seta hud_panel_engineinfo "0"
 seta hud_panel_engineinfo_pos "0.930000 0.970000"
 seta hud_panel_engineinfo_size "0.070000 0.030000"
 seta hud_panel_engineinfo_bg "0"
@@ -241,7 +228,6 @@ seta hud_panel_engineinfo_bg_padding ""
 seta hud_panel_engineinfo_framecounter_time "0.1"
 seta hud_panel_engineinfo_framecounter_decimals "0"
 
-seta hud_panel_infomessages "1"
 seta hud_panel_infomessages_pos "0.720000 0.100000"
 seta hud_panel_infomessages_size "0.280000 0.080000"
 seta hud_panel_infomessages_bg "0"
@@ -252,13 +238,12 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics "3"
 seta hud_panel_physics_pos "0.410000 0.625000"
 seta hud_panel_physics_size "0.180000 0.080000"
 seta hud_panel_physics_bg "0"
 seta hud_panel_physics_bg_color ""
 seta hud_panel_physics_bg_color_team ""
-seta hud_panel_physics_bg_alpha "0.700000"
+seta hud_panel_physics_bg_alpha "0.7"
 seta hud_panel_physics_bg_border ""
 seta hud_panel_physics_bg_padding ""
 seta hud_panel_physics_speed_unit_show "1"
@@ -277,7 +262,6 @@ seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
 seta hud_panel_physics_text_scale "0.7"
 
-seta hud_panel_centerprint "1"
 seta hud_panel_centerprint_pos "0.175000 0.220000"
 seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
@@ -300,7 +284,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
 seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
-seta hud_panel_minigameboard "1"
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
 seta hud_panel_minigameboard_bg "border_small"
@@ -310,7 +293,6 @@ seta hud_panel_minigameboard_bg_alpha ""
 seta hud_panel_minigameboard_bg_border ""
 seta hud_panel_minigameboard_bg_padding ""
 
-seta hud_panel_minigamestatus "1"
 seta hud_panel_minigamestatus_pos "0.74 0.15"
 seta hud_panel_minigamestatus_size "0.2 0.60"
 seta hud_panel_minigamestatus_bg "border_small"
@@ -320,7 +302,6 @@ seta hud_panel_minigamestatus_bg_alpha ""
 seta hud_panel_minigamestatus_bg_border ""
 seta hud_panel_minigamestatus_bg_padding ""
 
-seta hud_panel_minigamehelp "1"
 seta hud_panel_minigamehelp_pos "0.22 0.78"
 seta hud_panel_minigamehelp_size "0.50 0.20"
 seta hud_panel_minigamehelp_bg ""
@@ -330,7 +311,6 @@ seta hud_panel_minigamehelp_bg_alpha ""
 seta hud_panel_minigamehelp_bg_border ""
 seta hud_panel_minigamehelp_bg_padding ""
 
-seta hud_panel_minigamemenu "0"
 seta hud_panel_minigamemenu_pos "0 0.26"
 seta hud_panel_minigamemenu_size "0.2 0.49"
 seta hud_panel_minigamemenu_bg "border_small"
@@ -340,7 +320,6 @@ seta hud_panel_minigamemenu_bg_alpha ""
 seta hud_panel_minigamemenu_bg_border ""
 seta hud_panel_minigamemenu_bg_padding ""
 
-seta hud_panel_mapvote "1"
 seta hud_panel_mapvote_pos "0 0"
 seta hud_panel_mapvote_size "1 1"
 seta hud_panel_mapvote_bg "border_default"
@@ -350,10 +329,9 @@ seta hud_panel_mapvote_bg_alpha ""
 seta hud_panel_mapvote_bg_border ""
 seta hud_panel_mapvote_bg_padding ""
 
-seta hud_panel_itemstime "2"
 seta hud_panel_itemstime_pos "0.030000 0.260000"
 seta hud_panel_itemstime_size "0.070000 0.230000"
-seta hud_panel_itemstime_bg "border_itemstime"
+seta hud_panel_itemstime_bg "border_default"
 seta hud_panel_itemstime_bg_color ""
 seta hud_panel_itemstime_bg_color_team ""
 seta hud_panel_itemstime_bg_alpha ""
@@ -367,7 +345,6 @@ seta hud_panel_itemstime_text "1"
 seta hud_panel_itemstime_ratio "2"
 seta hud_panel_itemstime_dynamicsize "1"
 
-seta hud_panel_quickmenu "1"
 seta hud_panel_quickmenu_pos "0.600000 0.445000"
 seta hud_panel_quickmenu_size "0.220000 0.240000"
 seta hud_panel_quickmenu_bg ""
index 04902e07f8a64fee26a1dc990515730535a635e8..7badb25057d5d01e36f26e47bef8b1fb3556e403 100644 (file)
@@ -15,7 +15,7 @@ seta hud_dock_color "0 0.449576 0.860796"
 seta hud_dock_color_team "1"
 seta hud_dock_alpha "1"
 
-seta hud_progressbar_alpha "0.500000"
+seta hud_progressbar_alpha "0.5"
 seta hud_progressbar_strength_color "0 0 0.6"
 seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
@@ -35,7 +35,6 @@ seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
-seta hud_panel_weapons "1"
 seta hud_panel_weapons_pos "0.930000 0.170000"
 seta hud_panel_weapons_size "0.070000 0.650000"
 seta hud_panel_weapons_bg "border_small_weapons"
@@ -46,7 +45,7 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding "4"
 seta hud_panel_weapons_accuracy "1"
 seta hud_panel_weapons_label "1"
-seta hud_panel_weapons_label_scale "0.500000"
+seta hud_panel_weapons_label_scale "0.5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-1"
 seta hud_panel_weapons_complainbubble_time "0"
@@ -68,7 +67,6 @@ seta hud_panel_weapons_onlyowned "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 
-seta hud_panel_ammo "1"
 seta hud_panel_ammo_pos "0.330000 0.960000"
 seta hud_panel_ammo_size "0.350000 0.040000"
 seta hud_panel_ammo_bg ""
@@ -78,7 +76,7 @@ seta hud_panel_ammo_bg_alpha ""
 seta hud_panel_ammo_bg_border ""
 seta hud_panel_ammo_bg_padding ""
 seta hud_panel_ammo_onlycurrent "0"
-seta hud_panel_ammo_noncurrent_alpha "0.700000"
+seta hud_panel_ammo_noncurrent_alpha "0.7"
 seta hud_panel_ammo_noncurrent_scale "1"
 seta hud_panel_ammo_iconalign "0"
 seta hud_panel_ammo_progressbar "0"
@@ -86,7 +84,6 @@ seta hud_panel_ammo_progressbar_name "progressbar"
 seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
-seta hud_panel_powerups "1"
 seta hud_panel_powerups_pos "0.360000 0.850000"
 seta hud_panel_powerups_size "0.290000 0.030000"
 seta hud_panel_powerups_bg "border_small_powerups"
@@ -100,7 +97,6 @@ seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_text "1"
 
-seta hud_panel_healtharmor "1"
 seta hud_panel_healtharmor_pos "0.320000 0.910000"
 seta hud_panel_healtharmor_size "0.370000 0.060000"
 seta hud_panel_healtharmor_bg "border_small_healtharmor"
@@ -109,6 +105,7 @@ seta hud_panel_healtharmor_bg_color_team ""
 seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding ""
+seta hud_panel_healtharmor_combined "0"
 seta hud_panel_healtharmor_flip "0"
 seta hud_panel_healtharmor_iconalign "3"
 seta hud_panel_healtharmor_baralign "3"
@@ -119,7 +116,6 @@ seta hud_panel_healtharmor_progressbar_gfx "1"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
-seta hud_panel_notify "1"
 seta hud_panel_notify_pos "0.710000 0.800000"
 seta hud_panel_notify_size "0.290000 0.190000"
 seta hud_panel_notify_bg "0"
@@ -134,7 +130,6 @@ seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
 seta hud_panel_notify_icon_aspect "2"
 
-seta hud_panel_timer "1"
 seta hud_panel_timer_pos "0.800000 0.040000"
 seta hud_panel_timer_size "0.070000 0.040000"
 seta hud_panel_timer_bg "border_small_timer"
@@ -144,16 +139,15 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar "2"
 seta hud_panel_radar_pos "0 0"
 seta hud_panel_radar_size "0.200000 0.240000"
 seta hud_panel_radar_bg "border_small_radar"
 seta hud_panel_radar_bg_color ""
 seta hud_panel_radar_bg_color_team ""
-seta hud_panel_radar_bg_alpha "0.800000"
+seta hud_panel_radar_bg_alpha "0.8"
 seta hud_panel_radar_bg_border ""
 seta hud_panel_radar_bg_padding "-1"
-seta hud_panel_radar_foreground_alpha "0.800000"
+seta hud_panel_radar_foreground_alpha "0.8"
 seta hud_panel_radar_rotation "0"
 seta hud_panel_radar_zoommode "0"
 seta hud_panel_radar_scale "4096"
@@ -162,7 +156,6 @@ seta hud_panel_radar_maximized_size "0.5 0.5"
 seta hud_panel_radar_maximized_rotation "1"
 seta hud_panel_radar_maximized_zoommode "3"
 
-seta hud_panel_score "1"
 seta hud_panel_score_pos "0.890000 0.030000"
 seta hud_panel_score_size "0.100000 0.050000"
 seta hud_panel_score_bg "border_small_score"
@@ -173,7 +166,6 @@ seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding "0"
 seta hud_panel_score_rankings "1"
 
-seta hud_panel_racetimer "1"
 seta hud_panel_racetimer_pos "0.360000 0.110000"
 seta hud_panel_racetimer_size "0.280000 0.090000"
 seta hud_panel_racetimer_bg "0"
@@ -183,18 +175,16 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
-seta hud_panel_vote "1"
 seta hud_panel_vote_pos "0.720000 0.670000"
 seta hud_panel_vote_size "0.190000 0.090000"
-seta hud_panel_vote_bg "border_vote"
+seta hud_panel_vote_bg "border_default"
 seta hud_panel_vote_bg_color ""
 seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
 seta hud_panel_vote_bg_border ""
 seta hud_panel_vote_bg_padding ""
-seta hud_panel_vote_alreadyvoted_alpha "0.500000"
+seta hud_panel_vote_alreadyvoted_alpha "0.5"
 
-seta hud_panel_modicons "1"
 seta hud_panel_modicons_pos "0.410000 0"
 seta hud_panel_modicons_size "0.180000 0.080000"
 seta hud_panel_modicons_bg "border_small_modicons"
@@ -207,7 +197,6 @@ seta hud_panel_modicons_ca_layout "1"
 seta hud_panel_modicons_dom_layout "1"
 seta hud_panel_modicons_freezetag_layout "1"
 
-seta hud_panel_pressedkeys "1"
 seta hud_panel_pressedkeys_pos "0.450000 0.720000"
 seta hud_panel_pressedkeys_size "0.110000 0.090000"
 seta hud_panel_pressedkeys_bg "0"
@@ -216,10 +205,9 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_aspect "1.6"
 seta hud_panel_pressedkeys_attack "0"
 
-seta hud_panel_chat "1"
 seta hud_panel_chat_pos "0.010000 0.700000"
 seta hud_panel_chat_size "0.460000 0.190000"
 seta hud_panel_chat_bg "0"
@@ -229,7 +217,6 @@ seta hud_panel_chat_bg_alpha ""
 seta hud_panel_chat_bg_border ""
 seta hud_panel_chat_bg_padding ""
 
-seta hud_panel_engineinfo "0"
 seta hud_panel_engineinfo_pos "0.930000 0.970000"
 seta hud_panel_engineinfo_size "0.070000 0.030000"
 seta hud_panel_engineinfo_bg "0"
@@ -241,7 +228,6 @@ seta hud_panel_engineinfo_bg_padding ""
 seta hud_panel_engineinfo_framecounter_time "0.1"
 seta hud_panel_engineinfo_framecounter_decimals "0"
 
-seta hud_panel_infomessages "1"
 seta hud_panel_infomessages_pos "0.720000 0.100000"
 seta hud_panel_infomessages_size "0.280000 0.080000"
 seta hud_panel_infomessages_bg "0"
@@ -252,7 +238,6 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics "3"
 seta hud_panel_physics_pos "0.420000 0.620000"
 seta hud_panel_physics_size "0.170000 0.080000"
 seta hud_panel_physics_bg ""
@@ -277,7 +262,6 @@ seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
 seta hud_panel_physics_text_scale "0.7"
 
-seta hud_panel_centerprint "1"
 seta hud_panel_centerprint_pos "0.175000 0.220000"
 seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
@@ -300,7 +284,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
 seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
-seta hud_panel_minigameboard "1"
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
 seta hud_panel_minigameboard_bg "border_small"
@@ -310,7 +293,6 @@ seta hud_panel_minigameboard_bg_alpha ""
 seta hud_panel_minigameboard_bg_border ""
 seta hud_panel_minigameboard_bg_padding ""
 
-seta hud_panel_minigamestatus "1"
 seta hud_panel_minigamestatus_pos "0.74 0.15"
 seta hud_panel_minigamestatus_size "0.2 0.60"
 seta hud_panel_minigamestatus_bg "border_small"
@@ -320,7 +302,6 @@ seta hud_panel_minigamestatus_bg_alpha ""
 seta hud_panel_minigamestatus_bg_border ""
 seta hud_panel_minigamestatus_bg_padding ""
 
-seta hud_panel_minigamehelp "1"
 seta hud_panel_minigamehelp_pos "0.22 0.78"
 seta hud_panel_minigamehelp_size "0.50 0.20"
 seta hud_panel_minigamehelp_bg ""
@@ -330,7 +311,6 @@ seta hud_panel_minigamehelp_bg_alpha ""
 seta hud_panel_minigamehelp_bg_border ""
 seta hud_panel_minigamehelp_bg_padding ""
 
-seta hud_panel_minigamemenu "0"
 seta hud_panel_minigamemenu_pos "0 0.26"
 seta hud_panel_minigamemenu_size "0.2 0.49"
 seta hud_panel_minigamemenu_bg "border_small"
@@ -340,7 +320,6 @@ seta hud_panel_minigamemenu_bg_alpha ""
 seta hud_panel_minigamemenu_bg_border ""
 seta hud_panel_minigamemenu_bg_padding ""
 
-seta hud_panel_mapvote "1"
 seta hud_panel_mapvote_pos "0 0"
 seta hud_panel_mapvote_size "1 1"
 seta hud_panel_mapvote_bg "0"
@@ -350,10 +329,9 @@ seta hud_panel_mapvote_bg_alpha ""
 seta hud_panel_mapvote_bg_border ""
 seta hud_panel_mapvote_bg_padding ""
 
-seta hud_panel_itemstime "2"
 seta hud_panel_itemstime_pos "0.030000 0.260000"
 seta hud_panel_itemstime_size "0.070000 0.230000"
-seta hud_panel_itemstime_bg "border_itemstime"
+seta hud_panel_itemstime_bg "border_default"
 seta hud_panel_itemstime_bg_color ""
 seta hud_panel_itemstime_bg_color_team ""
 seta hud_panel_itemstime_bg_alpha ""
@@ -367,7 +345,6 @@ seta hud_panel_itemstime_text "1"
 seta hud_panel_itemstime_ratio "2"
 seta hud_panel_itemstime_dynamicsize "1"
 
-seta hud_panel_quickmenu "1"
 seta hud_panel_quickmenu_pos "0.610000 0.450000"
 seta hud_panel_quickmenu_size "0.200000 0.210000"
 seta hud_panel_quickmenu_bg ""
index 76214f49035e9abdeae7d30ca50966f2c213f5af..76edc7bc09fc766003bbb7ebf0afb90b653981b2 100644 (file)
@@ -12,10 +12,10 @@ seta hud_panel_fg_alpha "1"
 
 seta hud_dock "0"
 seta hud_dock_color "0 0.449576 0.860796"
-seta hud_dock_color_team "0.700000"
+seta hud_dock_color_team "0.7"
 seta hud_dock_alpha "1"
 
-seta hud_progressbar_alpha "0.500000"
+seta hud_progressbar_alpha "0.5"
 seta hud_progressbar_strength_color "0 0 0.6"
 seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
@@ -35,7 +35,6 @@ seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
-seta hud_panel_weapons "1"
 seta hud_panel_weapons_pos "0.350000 0.940000"
 seta hud_panel_weapons_size "0.300000 0.060000"
 seta hud_panel_weapons_bg ""
@@ -68,7 +67,6 @@ seta hud_panel_weapons_onlyowned "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 
-seta hud_panel_ammo "1"
 seta hud_panel_ammo_pos "0.650000 0.890000"
 seta hud_panel_ammo_size "0.055000 0.110000"
 seta hud_panel_ammo_bg ""
@@ -86,7 +84,6 @@ seta hud_panel_ammo_progressbar_name "progressbar"
 seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
-seta hud_panel_powerups "1"
 seta hud_panel_powerups_pos "0.290000 0.890000"
 seta hud_panel_powerups_size "0.055000 0.110000"
 seta hud_panel_powerups_bg "0"
@@ -100,7 +97,6 @@ seta hud_panel_powerups_baralign "1"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_text "1"
 
-seta hud_panel_healtharmor "1"
 seta hud_panel_healtharmor_pos "0.350000 0.890000"
 seta hud_panel_healtharmor_size "0.300000 0.050000"
 seta hud_panel_healtharmor_bg ""
@@ -109,6 +105,7 @@ seta hud_panel_healtharmor_bg_color_team ""
 seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding "0"
+seta hud_panel_healtharmor_combined "0"
 seta hud_panel_healtharmor_flip "0"
 seta hud_panel_healtharmor_iconalign "3"
 seta hud_panel_healtharmor_baralign "3"
@@ -119,7 +116,6 @@ seta hud_panel_healtharmor_progressbar_gfx "1"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
-seta hud_panel_notify "1"
 seta hud_panel_notify_pos "0 0"
 seta hud_panel_notify_size "0.210000 0.260000"
 seta hud_panel_notify_bg "0"
@@ -134,7 +130,6 @@ seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
 seta hud_panel_notify_icon_aspect "2"
 
-seta hud_panel_timer "1"
 seta hud_panel_timer_pos "0.435000 0"
 seta hud_panel_timer_size "0.135000 0.060000"
 seta hud_panel_timer_bg "0"
@@ -144,16 +139,15 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar "2"
 seta hud_panel_radar_pos "0.810000 0"
 seta hud_panel_radar_size "0.190000 0.250000"
-seta hud_panel_radar_bg "border_radar"
+seta hud_panel_radar_bg "border_default"
 seta hud_panel_radar_bg_color ""
 seta hud_panel_radar_bg_color_team ""
-seta hud_panel_radar_bg_alpha "0.500000"
+seta hud_panel_radar_bg_alpha "0.5"
 seta hud_panel_radar_bg_border "0"
 seta hud_panel_radar_bg_padding "0"
-seta hud_panel_radar_foreground_alpha "0.500000"
+seta hud_panel_radar_foreground_alpha "0.5"
 seta hud_panel_radar_rotation "0"
 seta hud_panel_radar_zoommode "0"
 seta hud_panel_radar_scale "4096"
@@ -162,7 +156,6 @@ seta hud_panel_radar_maximized_size "0.5 0.5"
 seta hud_panel_radar_maximized_rotation "1"
 seta hud_panel_radar_maximized_zoommode "3"
 
-seta hud_panel_score "1"
 seta hud_panel_score_pos "0.465000 0.045000"
 seta hud_panel_score_size "0.090000 0.060000"
 seta hud_panel_score_bg ""
@@ -173,7 +166,6 @@ seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
 seta hud_panel_score_rankings "1"
 
-seta hud_panel_racetimer "1"
 seta hud_panel_racetimer_pos "0.360000 0.090000"
 seta hud_panel_racetimer_size "0.280000 0.090000"
 seta hud_panel_racetimer_bg "0"
@@ -183,7 +175,6 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
-seta hud_panel_vote "1"
 seta hud_panel_vote_pos "0 0.890000"
 seta hud_panel_vote_size "0.170000 0.110000"
 seta hud_panel_vote_bg ""
@@ -192,9 +183,8 @@ seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
 seta hud_panel_vote_bg_border ""
 seta hud_panel_vote_bg_padding ""
-seta hud_panel_vote_alreadyvoted_alpha "0.800000"
+seta hud_panel_vote_alreadyvoted_alpha "0.8"
 
-seta hud_panel_modicons "1"
 seta hud_panel_modicons_pos "0.560000 0"
 seta hud_panel_modicons_size "0.050000 0.100000"
 seta hud_panel_modicons_bg ""
@@ -207,7 +197,6 @@ seta hud_panel_modicons_ca_layout "1"
 seta hud_panel_modicons_dom_layout "1"
 seta hud_panel_modicons_freezetag_layout "1"
 
-seta hud_panel_pressedkeys "1"
 seta hud_panel_pressedkeys_pos "0.450000 0.650000"
 seta hud_panel_pressedkeys_size "0.100000 0.110000"
 seta hud_panel_pressedkeys_bg "0"
@@ -216,10 +205,9 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_aspect "1.6"
 seta hud_panel_pressedkeys_attack "0"
 
-seta hud_panel_chat "1"
 seta hud_panel_chat_pos "0 0.775000"
 seta hud_panel_chat_size "0.460000 0.110000"
 seta hud_panel_chat_bg "0"
@@ -229,7 +217,6 @@ seta hud_panel_chat_bg_alpha ""
 seta hud_panel_chat_bg_border ""
 seta hud_panel_chat_bg_padding ""
 
-seta hud_panel_engineinfo "0"
 seta hud_panel_engineinfo_pos "0.910000 0.970000"
 seta hud_panel_engineinfo_size "0.090000 0.030000"
 seta hud_panel_engineinfo_bg "0"
@@ -241,7 +228,6 @@ seta hud_panel_engineinfo_bg_padding ""
 seta hud_panel_engineinfo_framecounter_time "0.1"
 seta hud_panel_engineinfo_framecounter_decimals "0"
 
-seta hud_panel_infomessages "1"
 seta hud_panel_infomessages_pos "0.710000 0"
 seta hud_panel_infomessages_size "0.290000 0.100000"
 seta hud_panel_infomessages_bg "0"
@@ -252,7 +238,6 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics "3"
 seta hud_panel_physics_pos "0.440000 0.590000"
 seta hud_panel_physics_size "0.120000 0.050000"
 seta hud_panel_physics_bg ""
@@ -277,7 +262,6 @@ seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
 seta hud_panel_physics_text_scale "0.7"
 
-seta hud_panel_centerprint "1"
 seta hud_panel_centerprint_pos "0.175000 0.220000"
 seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
@@ -300,7 +284,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
 seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
-seta hud_panel_minigameboard "1"
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
 seta hud_panel_minigameboard_bg "border_small"
@@ -310,7 +293,6 @@ seta hud_panel_minigameboard_bg_alpha ""
 seta hud_panel_minigameboard_bg_border ""
 seta hud_panel_minigameboard_bg_padding ""
 
-seta hud_panel_minigamestatus "1"
 seta hud_panel_minigamestatus_pos "0.74 0.15"
 seta hud_panel_minigamestatus_size "0.2 0.60"
 seta hud_panel_minigamestatus_bg "border_small"
@@ -320,7 +302,6 @@ seta hud_panel_minigamestatus_bg_alpha ""
 seta hud_panel_minigamestatus_bg_border ""
 seta hud_panel_minigamestatus_bg_padding ""
 
-seta hud_panel_minigamehelp "1"
 seta hud_panel_minigamehelp_pos "0.22 0.78"
 seta hud_panel_minigamehelp_size "0.50 0.20"
 seta hud_panel_minigamehelp_bg ""
@@ -330,7 +311,6 @@ seta hud_panel_minigamehelp_bg_alpha ""
 seta hud_panel_minigamehelp_bg_border ""
 seta hud_panel_minigamehelp_bg_padding ""
 
-seta hud_panel_minigamemenu "0"
 seta hud_panel_minigamemenu_pos "0 0.26"
 seta hud_panel_minigamemenu_size "0.2 0.49"
 seta hud_panel_minigamemenu_bg "border_small"
@@ -340,7 +320,6 @@ seta hud_panel_minigamemenu_bg_alpha ""
 seta hud_panel_minigamemenu_bg_border ""
 seta hud_panel_minigamemenu_bg_padding ""
 
-seta hud_panel_mapvote "1"
 seta hud_panel_mapvote_pos "0 0"
 seta hud_panel_mapvote_size "1 1"
 seta hud_panel_mapvote_bg "0"
@@ -350,7 +329,6 @@ seta hud_panel_mapvote_bg_alpha ""
 seta hud_panel_mapvote_bg_border ""
 seta hud_panel_mapvote_bg_padding ""
 
-seta hud_panel_itemstime "2"
 seta hud_panel_itemstime_pos "0.000000 0.310000"
 seta hud_panel_itemstime_size "0.070000 0.180000"
 seta hud_panel_itemstime_bg ""
@@ -367,7 +345,6 @@ seta hud_panel_itemstime_text "1"
 seta hud_panel_itemstime_ratio "2"
 seta hud_panel_itemstime_dynamicsize "1"
 
-seta hud_panel_quickmenu "1"
 seta hud_panel_quickmenu_pos "0.600000 0.460000"
 seta hud_panel_quickmenu_size "0.190000 0.190000"
 seta hud_panel_quickmenu_bg ""
index 722a316fd0c031ff37f58f42fda32f6d9a0d8b21..f2670d8e2d7b0923e25112947641ba315ef3fd85 100644 (file)
@@ -12,7 +12,7 @@ seta hud_panel_fg_alpha "1"
 
 seta hud_dock "0"
 seta hud_dock_color "0 0.449576 0.860796"
-seta hud_dock_color_team "0.700000"
+seta hud_dock_color_team "0.7"
 seta hud_dock_alpha "1"
 
 seta hud_progressbar_alpha "0.3"
@@ -35,7 +35,6 @@ seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
-seta hud_panel_weapons "1"
 seta hud_panel_weapons_pos "0.350000 0.940000"
 seta hud_panel_weapons_size "0.300000 0.060000"
 seta hud_panel_weapons_bg ""
@@ -68,7 +67,6 @@ seta hud_panel_weapons_onlyowned "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 
-seta hud_panel_ammo "1"
 seta hud_panel_ammo_pos "0.450000 0.630000"
 seta hud_panel_ammo_size "0.080000 0.040000"
 seta hud_panel_ammo_bg ""
@@ -86,7 +84,6 @@ seta hud_panel_ammo_progressbar_name "progressbar_ammo"
 seta hud_panel_ammo_progressbar_xoffset "0.32"
 seta hud_panel_ammo_text "1"
 
-seta hud_panel_powerups "1"
 seta hud_panel_powerups_pos "0.270000 0.940000"
 seta hud_panel_powerups_size "0.080000 0.060000"
 seta hud_panel_powerups_bg "0"
@@ -100,15 +97,15 @@ seta hud_panel_powerups_baralign "1"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_text "1"
 
-seta hud_panel_healtharmor "1"
 seta hud_panel_healtharmor_pos "0.350000 0.380000"
 seta hud_panel_healtharmor_size "0.070000 0.240000"
 seta hud_panel_healtharmor_bg "border_healtharmor"
 seta hud_panel_healtharmor_bg_color "0.464391 0.464391 0.464391"
 seta hud_panel_healtharmor_bg_color_team ""
-seta hud_panel_healtharmor_bg_alpha "0.600000"
+seta hud_panel_healtharmor_bg_alpha "0.6"
 seta hud_panel_healtharmor_bg_border "-1"
 seta hud_panel_healtharmor_bg_padding "0"
+seta hud_panel_healtharmor_combined "0"
 seta hud_panel_healtharmor_flip "0"
 seta hud_panel_healtharmor_iconalign "1"
 seta hud_panel_healtharmor_baralign "1"
@@ -119,7 +116,6 @@ seta hud_panel_healtharmor_progressbar_gfx "1"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "0"
 
-seta hud_panel_notify "1"
 seta hud_panel_notify_pos "0 0"
 seta hud_panel_notify_size "0.210000 0.260000"
 seta hud_panel_notify_bg "0"
@@ -134,7 +130,6 @@ seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
 seta hud_panel_notify_icon_aspect "2"
 
-seta hud_panel_timer "1"
 seta hud_panel_timer_pos "0.435000 0"
 seta hud_panel_timer_size "0.135000 0.060000"
 seta hud_panel_timer_bg "0"
@@ -144,16 +139,15 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar "2"
 seta hud_panel_radar_pos "0.810000 0"
 seta hud_panel_radar_size "0.190000 0.250000"
-seta hud_panel_radar_bg "border_radar"
+seta hud_panel_radar_bg "border_default"
 seta hud_panel_radar_bg_color ""
 seta hud_panel_radar_bg_color_team ""
-seta hud_panel_radar_bg_alpha "0.500000"
+seta hud_panel_radar_bg_alpha "0.5"
 seta hud_panel_radar_bg_border "0"
 seta hud_panel_radar_bg_padding "0"
-seta hud_panel_radar_foreground_alpha "0.500000"
+seta hud_panel_radar_foreground_alpha "0.5"
 seta hud_panel_radar_rotation "0"
 seta hud_panel_radar_zoommode "0"
 seta hud_panel_radar_scale "4096"
@@ -162,7 +156,6 @@ seta hud_panel_radar_maximized_size "0.5 0.5"
 seta hud_panel_radar_maximized_rotation "1"
 seta hud_panel_radar_maximized_zoommode "3"
 
-seta hud_panel_score "1"
 seta hud_panel_score_pos "0.465000 0.045000"
 seta hud_panel_score_size "0.090000 0.060000"
 seta hud_panel_score_bg ""
@@ -173,7 +166,6 @@ seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
 seta hud_panel_score_rankings "1"
 
-seta hud_panel_racetimer "1"
 seta hud_panel_racetimer_pos "0.360000 0.090000"
 seta hud_panel_racetimer_size "0.280000 0.090000"
 seta hud_panel_racetimer_bg "0"
@@ -183,7 +175,6 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
-seta hud_panel_vote "1"
 seta hud_panel_vote_pos "0 0.890000"
 seta hud_panel_vote_size "0.170000 0.110000"
 seta hud_panel_vote_bg ""
@@ -192,9 +183,8 @@ seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
 seta hud_panel_vote_bg_border ""
 seta hud_panel_vote_bg_padding ""
-seta hud_panel_vote_alreadyvoted_alpha "0.800000"
+seta hud_panel_vote_alreadyvoted_alpha "0.8"
 
-seta hud_panel_modicons "1"
 seta hud_panel_modicons_pos "0.560000 0"
 seta hud_panel_modicons_size "0.050000 0.100000"
 seta hud_panel_modicons_bg ""
@@ -207,7 +197,6 @@ seta hud_panel_modicons_ca_layout "1"
 seta hud_panel_modicons_dom_layout "1"
 seta hud_panel_modicons_freezetag_layout "1"
 
-seta hud_panel_pressedkeys "1"
 seta hud_panel_pressedkeys_pos "0.450000 0.690000"
 seta hud_panel_pressedkeys_size "0.100000 0.110000"
 seta hud_panel_pressedkeys_bg "0"
@@ -216,10 +205,9 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_aspect "1.6"
 seta hud_panel_pressedkeys_attack "0"
 
-seta hud_panel_chat "1"
 seta hud_panel_chat_pos "0 0.775000"
 seta hud_panel_chat_size "0.460000 0.110000"
 seta hud_panel_chat_bg "0"
@@ -229,7 +217,6 @@ seta hud_panel_chat_bg_alpha ""
 seta hud_panel_chat_bg_border ""
 seta hud_panel_chat_bg_padding ""
 
-seta hud_panel_engineinfo "0"
 seta hud_panel_engineinfo_pos "0.910000 0.970000"
 seta hud_panel_engineinfo_size "0.090000 0.030000"
 seta hud_panel_engineinfo_bg "0"
@@ -241,7 +228,6 @@ seta hud_panel_engineinfo_bg_padding ""
 seta hud_panel_engineinfo_framecounter_time "0.1"
 seta hud_panel_engineinfo_framecounter_decimals "0"
 
-seta hud_panel_infomessages "1"
 seta hud_panel_infomessages_pos "0.710000 0"
 seta hud_panel_infomessages_size "0.290000 0.100000"
 seta hud_panel_infomessages_bg "0"
@@ -252,7 +238,6 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics "3"
 seta hud_panel_physics_pos "0.270000 0.730000"
 seta hud_panel_physics_size "0.170000 0.030000"
 seta hud_panel_physics_bg ""
@@ -277,7 +262,6 @@ seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
 seta hud_panel_physics_text_scale "0.7"
 
-seta hud_panel_centerprint "1"
 seta hud_panel_centerprint_pos "0.175000 0.220000"
 seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
@@ -300,7 +284,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
 seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
-seta hud_panel_minigameboard "1"
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
 seta hud_panel_minigameboard_bg "border_small"
@@ -310,7 +293,6 @@ seta hud_panel_minigameboard_bg_alpha ""
 seta hud_panel_minigameboard_bg_border ""
 seta hud_panel_minigameboard_bg_padding ""
 
-seta hud_panel_minigamestatus "1"
 seta hud_panel_minigamestatus_pos "0.74 0.15"
 seta hud_panel_minigamestatus_size "0.2 0.60"
 seta hud_panel_minigamestatus_bg "border_small"
@@ -320,7 +302,6 @@ seta hud_panel_minigamestatus_bg_alpha ""
 seta hud_panel_minigamestatus_bg_border ""
 seta hud_panel_minigamestatus_bg_padding ""
 
-seta hud_panel_minigamehelp "1"
 seta hud_panel_minigamehelp_pos "0.22 0.78"
 seta hud_panel_minigamehelp_size "0.50 0.20"
 seta hud_panel_minigamehelp_bg ""
@@ -330,7 +311,6 @@ seta hud_panel_minigamehelp_bg_alpha ""
 seta hud_panel_minigamehelp_bg_border ""
 seta hud_panel_minigamehelp_bg_padding ""
 
-seta hud_panel_minigamemenu "0"
 seta hud_panel_minigamemenu_pos "0 0.26"
 seta hud_panel_minigamemenu_size "0.2 0.49"
 seta hud_panel_minigamemenu_bg "border_small"
@@ -340,7 +320,6 @@ seta hud_panel_minigamemenu_bg_alpha ""
 seta hud_panel_minigamemenu_bg_border ""
 seta hud_panel_minigamemenu_bg_padding ""
 
-seta hud_panel_mapvote "1"
 seta hud_panel_mapvote_pos "0 0"
 seta hud_panel_mapvote_size "1 1"
 seta hud_panel_mapvote_bg "0"
@@ -350,7 +329,6 @@ seta hud_panel_mapvote_bg_alpha ""
 seta hud_panel_mapvote_bg_border ""
 seta hud_panel_mapvote_bg_padding ""
 
-seta hud_panel_itemstime "2"
 seta hud_panel_itemstime_pos "0.000000 0.310000"
 seta hud_panel_itemstime_size "0.070000 0.180000"
 seta hud_panel_itemstime_bg ""
@@ -367,7 +345,6 @@ seta hud_panel_itemstime_text "1"
 seta hud_panel_itemstime_ratio "2"
 seta hud_panel_itemstime_dynamicsize "1"
 
-seta hud_panel_quickmenu "1"
 seta hud_panel_quickmenu_pos "0.600000 0.460000"
 seta hud_panel_quickmenu_size "0.190000 0.190000"
 seta hud_panel_quickmenu_bg ""
index 3138471bb798a603f2345e00d80046267efa3b00..fc8d05ffbe5421ba67d493f989baa20fc64bd3cd 100644 (file)
@@ -12,10 +12,10 @@ seta hud_panel_fg_alpha "1"
 
 seta hud_dock "dock"
 seta hud_dock_color "0 0.1875 0.40625"
-seta hud_dock_color_team "0.700000"
+seta hud_dock_color_team "0.7"
 seta hud_dock_alpha "1"
 
-seta hud_progressbar_alpha "0.500000"
+seta hud_progressbar_alpha "0.5"
 seta hud_progressbar_strength_color "0 0 0.6"
 seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
@@ -35,7 +35,6 @@ seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
-seta hud_panel_weapons "1"
 seta hud_panel_weapons_pos "0.920000 0.090000"
 seta hud_panel_weapons_size "0.060000 0.630000"
 seta hud_panel_weapons_bg ""
@@ -68,7 +67,6 @@ seta hud_panel_weapons_onlyowned "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 
-seta hud_panel_ammo "1"
 seta hud_panel_ammo_pos "0.190000 0.920000"
 seta hud_panel_ammo_size "0.120000 0.070000"
 seta hud_panel_ammo_bg ""
@@ -86,7 +84,6 @@ seta hud_panel_ammo_progressbar_name "progressbar"
 seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
-seta hud_panel_powerups "1"
 seta hud_panel_powerups_pos "0.660000 0.940000"
 seta hud_panel_powerups_size "0.330000 0.060000"
 seta hud_panel_powerups_bg "0"
@@ -100,7 +97,6 @@ seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_text "1"
 
-seta hud_panel_healtharmor "1"
 seta hud_panel_healtharmor_pos "0.330000 0.920000"
 seta hud_panel_healtharmor_size "0.310000 0.070000"
 seta hud_panel_healtharmor_bg ""
@@ -109,6 +105,7 @@ seta hud_panel_healtharmor_bg_color_team ""
 seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding ""
+seta hud_panel_healtharmor_combined "0"
 seta hud_panel_healtharmor_flip "0"
 seta hud_panel_healtharmor_iconalign "3"
 seta hud_panel_healtharmor_baralign "3"
@@ -119,7 +116,6 @@ seta hud_panel_healtharmor_progressbar_gfx "1"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
-seta hud_panel_notify "1"
 seta hud_panel_notify_pos "0.660000 0.730000"
 seta hud_panel_notify_size "0.320000 0.190000"
 seta hud_panel_notify_bg "0"
@@ -134,7 +130,6 @@ seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
 seta hud_panel_notify_icon_aspect "2"
 
-seta hud_panel_timer "1"
 seta hud_panel_timer_pos "0.870000 0"
 seta hud_panel_timer_size "0.130000 0.060000"
 seta hud_panel_timer_bg "0"
@@ -144,7 +139,6 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar "2"
 seta hud_panel_radar_pos "0.030000 0.020000"
 seta hud_panel_radar_size "0.170000 0.220000"
 seta hud_panel_radar_bg ""
@@ -153,7 +147,7 @@ seta hud_panel_radar_bg_color_team ""
 seta hud_panel_radar_bg_alpha ""
 seta hud_panel_radar_bg_border ""
 seta hud_panel_radar_bg_padding "-3"
-seta hud_panel_radar_foreground_alpha "0.800000"
+seta hud_panel_radar_foreground_alpha "0.8"
 seta hud_panel_radar_rotation "0"
 seta hud_panel_radar_zoommode "0"
 seta hud_panel_radar_scale "4096"
@@ -162,7 +156,6 @@ seta hud_panel_radar_maximized_size "0.5 0.5"
 seta hud_panel_radar_maximized_rotation "1"
 seta hud_panel_radar_maximized_zoommode "3"
 
-seta hud_panel_score "1"
 seta hud_panel_score_pos "0.020000 0.920000"
 seta hud_panel_score_size "0.150000 0.070000"
 seta hud_panel_score_bg ""
@@ -173,7 +166,6 @@ seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
 seta hud_panel_score_rankings "1"
 
-seta hud_panel_racetimer "1"
 seta hud_panel_racetimer_pos "0.360000 0.090000"
 seta hud_panel_racetimer_size "0.280000 0.090000"
 seta hud_panel_racetimer_bg "0"
@@ -183,7 +175,6 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
-seta hud_panel_vote "1"
 seta hud_panel_vote_pos "0.020000 0.650000"
 seta hud_panel_vote_size "0.230000 0.110000"
 seta hud_panel_vote_bg ""
@@ -192,9 +183,8 @@ seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
 seta hud_panel_vote_bg_border ""
 seta hud_panel_vote_bg_padding ""
-seta hud_panel_vote_alreadyvoted_alpha "0.800000"
+seta hud_panel_vote_alreadyvoted_alpha "0.8"
 
-seta hud_panel_modicons "1"
 seta hud_panel_modicons_pos "0.040000 0.270000"
 seta hud_panel_modicons_size "0.080000 0.200000"
 seta hud_panel_modicons_bg ""
@@ -207,7 +197,6 @@ seta hud_panel_modicons_ca_layout "1"
 seta hud_panel_modicons_dom_layout "1"
 seta hud_panel_modicons_freezetag_layout "1"
 
-seta hud_panel_pressedkeys "1"
 seta hud_panel_pressedkeys_pos "0.410000 0.710000"
 seta hud_panel_pressedkeys_size "0.180000 0.130000"
 seta hud_panel_pressedkeys_bg "0"
@@ -216,10 +205,9 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_aspect "1.6"
 seta hud_panel_pressedkeys_attack "0"
 
-seta hud_panel_chat "1"
 seta hud_panel_chat_pos "0.020000 0.780000"
 seta hud_panel_chat_size "0.630000 0.110000"
 seta hud_panel_chat_bg "0"
@@ -229,7 +217,6 @@ seta hud_panel_chat_bg_alpha ""
 seta hud_panel_chat_bg_border ""
 seta hud_panel_chat_bg_padding ""
 
-seta hud_panel_engineinfo "0"
 seta hud_panel_engineinfo_pos "0.910000 0.970000"
 seta hud_panel_engineinfo_size "0.090000 0.030000"
 seta hud_panel_engineinfo_bg "0"
@@ -241,7 +228,6 @@ seta hud_panel_engineinfo_bg_padding ""
 seta hud_panel_engineinfo_framecounter_time "0.1"
 seta hud_panel_engineinfo_framecounter_decimals "0"
 
-seta hud_panel_infomessages "1"
 seta hud_panel_infomessages_pos "0.510000 0"
 seta hud_panel_infomessages_size "0.340000 0.090000"
 seta hud_panel_infomessages_bg "0"
@@ -252,7 +238,6 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics "3"
 seta hud_panel_physics_pos "0.410000 0.590000"
 seta hud_panel_physics_size "0.180000 0.100000"
 seta hud_panel_physics_bg ""
@@ -277,7 +262,6 @@ seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "1"
 seta hud_panel_physics_text_scale "0.7"
 
-seta hud_panel_centerprint "1"
 seta hud_panel_centerprint_pos "0.175000 0.220000"
 seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
@@ -300,7 +284,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
 seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
-seta hud_panel_minigameboard "1"
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
 seta hud_panel_minigameboard_bg "border_small"
@@ -310,7 +293,6 @@ seta hud_panel_minigameboard_bg_alpha ""
 seta hud_panel_minigameboard_bg_border ""
 seta hud_panel_minigameboard_bg_padding ""
 
-seta hud_panel_minigamestatus "1"
 seta hud_panel_minigamestatus_pos "0.74 0.15"
 seta hud_panel_minigamestatus_size "0.2 0.60"
 seta hud_panel_minigamestatus_bg "border_small"
@@ -320,7 +302,6 @@ seta hud_panel_minigamestatus_bg_alpha ""
 seta hud_panel_minigamestatus_bg_border ""
 seta hud_panel_minigamestatus_bg_padding ""
 
-seta hud_panel_minigamehelp "1"
 seta hud_panel_minigamehelp_pos "0.22 0.78"
 seta hud_panel_minigamehelp_size "0.50 0.20"
 seta hud_panel_minigamehelp_bg ""
@@ -330,7 +311,6 @@ seta hud_panel_minigamehelp_bg_alpha ""
 seta hud_panel_minigamehelp_bg_border ""
 seta hud_panel_minigamehelp_bg_padding ""
 
-seta hud_panel_minigamemenu "0"
 seta hud_panel_minigamemenu_pos "0 0.26"
 seta hud_panel_minigamemenu_size "0.2 0.49"
 seta hud_panel_minigamemenu_bg "border_small"
@@ -340,7 +320,6 @@ seta hud_panel_minigamemenu_bg_alpha ""
 seta hud_panel_minigamemenu_bg_border ""
 seta hud_panel_minigamemenu_bg_padding ""
 
-seta hud_panel_mapvote "1"
 seta hud_panel_mapvote_pos "0 0"
 seta hud_panel_mapvote_size "1 1"
 seta hud_panel_mapvote_bg "0"
@@ -350,7 +329,6 @@ seta hud_panel_mapvote_bg_alpha ""
 seta hud_panel_mapvote_bg_border ""
 seta hud_panel_mapvote_bg_padding ""
 
-seta hud_panel_itemstime "2"
 seta hud_panel_itemstime_pos "0.020000 0.490000"
 seta hud_panel_itemstime_size "0.090000 0.140000"
 seta hud_panel_itemstime_bg "0"
@@ -364,10 +342,9 @@ seta hud_panel_itemstime_progressbar "1"
 seta hud_panel_itemstime_progressbar_name "progressbar"
 seta hud_panel_itemstime_progressbar_reduced "1"
 seta hud_panel_itemstime_text "1"
-seta hud_panel_itemstime_ratio "3.500000"
+seta hud_panel_itemstime_ratio "3.5"
 seta hud_panel_itemstime_dynamicsize "1"
 
-seta hud_panel_quickmenu "1"
 seta hud_panel_quickmenu_pos "0.700000 0.460000"
 seta hud_panel_quickmenu_size "0.210000 0.250000"
 seta hud_panel_quickmenu_bg ""
index 791653f270a920c139feeb8d5a8170269c449a76..bc1dc9bddae01228cce082efbe7a24c9b369740c 100644 (file)
@@ -5,15 +5,15 @@ seta hud_skin "old"
 seta hud_panel_bg "border_default"
 seta hud_panel_bg_color "0.299327 1 0.81275"
 seta hud_panel_bg_color_team "0"
-seta hud_panel_bg_alpha "0.700000"
+seta hud_panel_bg_alpha "0.7"
 seta hud_panel_bg_border "8"
 seta hud_panel_bg_padding "0"
 seta hud_panel_fg_alpha "1"
 
 seta hud_dock "dock"
 seta hud_dock_color "0 0.697965 0.418232"
-seta hud_dock_color_team "0.700000"
-seta hud_dock_alpha "0.700000"
+seta hud_dock_color_team "0.7"
+seta hud_dock_alpha "0.7"
 
 seta hud_progressbar_alpha "0.5"
 seta hud_progressbar_strength_color "0 0 0.6"
@@ -35,7 +35,6 @@ seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
-seta hud_panel_weapons "1"
 seta hud_panel_weapons_pos "0.375000 0.870000"
 seta hud_panel_weapons_size "0.300000 0.060000"
 seta hud_panel_weapons_bg "0"
@@ -68,7 +67,6 @@ seta hud_panel_weapons_onlyowned "0"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 
-seta hud_panel_ammo "1"
 seta hud_panel_ammo_pos "0.160000 0.910000"
 seta hud_panel_ammo_size "0.190000 0.090000"
 seta hud_panel_ammo_bg "0"
@@ -86,7 +84,6 @@ seta hud_panel_ammo_progressbar_name "progressbar"
 seta hud_panel_ammo_progressbar_xoffset "0"
 seta hud_panel_ammo_text "1"
 
-seta hud_panel_powerups "1"
 seta hud_panel_powerups_pos "0.660000 0.910000"
 seta hud_panel_powerups_size "0.130000 0.090000"
 seta hud_panel_powerups_bg "0"
@@ -100,7 +97,6 @@ seta hud_panel_powerups_baralign "0"
 seta hud_panel_powerups_progressbar "0"
 seta hud_panel_powerups_text "1"
 
-seta hud_panel_healtharmor "1"
 seta hud_panel_healtharmor_pos "0.370000 0.930000"
 seta hud_panel_healtharmor_size "0.300000 0.070000"
 seta hud_panel_healtharmor_bg "0"
@@ -109,6 +105,7 @@ seta hud_panel_healtharmor_bg_color_team ""
 seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding ""
+seta hud_panel_healtharmor_combined "0"
 seta hud_panel_healtharmor_flip "0"
 seta hud_panel_healtharmor_iconalign "0"
 seta hud_panel_healtharmor_baralign "0"
@@ -119,7 +116,6 @@ seta hud_panel_healtharmor_progressbar_gfx "1"
 seta hud_panel_healtharmor_progressbar_gfx_smooth "2"
 seta hud_panel_healtharmor_text "1"
 
-seta hud_panel_notify "0"
 seta hud_panel_notify_pos "0.010000 0.650000"
 seta hud_panel_notify_size "0.300000 0.070000"
 seta hud_panel_notify_bg "0"
@@ -134,7 +130,6 @@ seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
 seta hud_panel_notify_icon_aspect "2"
 
-seta hud_panel_timer "1"
 seta hud_panel_timer_pos "0.850000 0"
 seta hud_panel_timer_size "0.150000 0.060000"
 seta hud_panel_timer_bg ""
@@ -144,13 +139,12 @@ seta hud_panel_timer_bg_alpha ""
 seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
-seta hud_panel_radar "2"
 seta hud_panel_radar_pos "0 0"
 seta hud_panel_radar_size "0.200000 0.260000"
 seta hud_panel_radar_bg "border_radar"
 seta hud_panel_radar_bg_color ""
 seta hud_panel_radar_bg_color_team ""
-seta hud_panel_radar_bg_alpha "0.500000"
+seta hud_panel_radar_bg_alpha "0.5"
 seta hud_panel_radar_bg_border "0"
 seta hud_panel_radar_bg_padding "0"
 seta hud_panel_radar_foreground_alpha "1"
@@ -162,7 +156,6 @@ seta hud_panel_radar_maximized_size "0.5 0.5"
 seta hud_panel_radar_maximized_rotation "1"
 seta hud_panel_radar_maximized_zoommode "3"
 
-seta hud_panel_score "1"
 seta hud_panel_score_pos "0.760000 0.910000"
 seta hud_panel_score_size "0.200000 0.080000"
 seta hud_panel_score_bg "0"
@@ -173,7 +166,6 @@ seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
 seta hud_panel_score_rankings "0"
 
-seta hud_panel_racetimer "1"
 seta hud_panel_racetimer_pos "0.360000 0.140000"
 seta hud_panel_racetimer_size "0.280000 0.090000"
 seta hud_panel_racetimer_bg "0"
@@ -183,7 +175,6 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
-seta hud_panel_vote "1"
 seta hud_panel_vote_pos "0.690000 0.750000"
 seta hud_panel_vote_size "0.300000 0.100000"
 seta hud_panel_vote_bg ""
@@ -192,9 +183,8 @@ seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
 seta hud_panel_vote_bg_border ""
 seta hud_panel_vote_bg_padding "-3"
-seta hud_panel_vote_alreadyvoted_alpha "0.750000"
+seta hud_panel_vote_alreadyvoted_alpha "0.75"
 
-seta hud_panel_modicons "1"
 seta hud_panel_modicons_pos "0.010000 0.910000"
 seta hud_panel_modicons_size "0.135000 0.090000"
 seta hud_panel_modicons_bg "0"
@@ -207,7 +197,6 @@ seta hud_panel_modicons_ca_layout "1"
 seta hud_panel_modicons_dom_layout "1"
 seta hud_panel_modicons_freezetag_layout "1"
 
-seta hud_panel_pressedkeys "1"
 seta hud_panel_pressedkeys_pos "0.440000 0.760000"
 seta hud_panel_pressedkeys_size "0.120000 0.094368"
 seta hud_panel_pressedkeys_bg "0"
@@ -216,10 +205,9 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.600000"
+seta hud_panel_pressedkeys_aspect "1.6"
 seta hud_panel_pressedkeys_attack "0"
 
-seta hud_panel_chat "1"
 seta hud_panel_chat_pos "0 0.760000"
 seta hud_panel_chat_size "0.420000 0.130000"
 seta hud_panel_chat_bg "0"
@@ -229,7 +217,6 @@ seta hud_panel_chat_bg_alpha ""
 seta hud_panel_chat_bg_border ""
 seta hud_panel_chat_bg_padding ""
 
-seta hud_panel_engineinfo "0"
 seta hud_panel_engineinfo_pos "0.887500 0.870000"
 seta hud_panel_engineinfo_size "0.112500 0.030000"
 seta hud_panel_engineinfo_bg "0"
@@ -241,7 +228,6 @@ seta hud_panel_engineinfo_bg_padding ""
 seta hud_panel_engineinfo_framecounter_time "0.1"
 seta hud_panel_engineinfo_framecounter_decimals "0"
 
-seta hud_panel_infomessages "1"
 seta hud_panel_infomessages_pos "0.690000 0.620000"
 seta hud_panel_infomessages_size "0.300000 0.100000"
 seta hud_panel_infomessages_bg "0"
@@ -252,7 +238,6 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding ""
 seta hud_panel_infomessages_flip "1"
 
-seta hud_panel_physics "3"
 seta hud_panel_physics_pos "0.430000 0.640000"
 seta hud_panel_physics_size "0.140000 0.100000"
 seta hud_panel_physics_bg "0"
@@ -277,7 +262,6 @@ seta hud_panel_physics_acceleration_progressbar_nonlinear "0"
 seta hud_panel_physics_text "2"
 seta hud_panel_physics_text_scale "1"
 
-seta hud_panel_centerprint "1"
 seta hud_panel_centerprint_pos "0.175000 0.260000"
 seta hud_panel_centerprint_size "0.650000 0.200000"
 seta hud_panel_centerprint_bg "0"
@@ -300,7 +284,6 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
 seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
-seta hud_panel_minigameboard "1"
 seta hud_panel_minigameboard_pos "0.22 0.15"
 seta hud_panel_minigameboard_size "0.50 0.60"
 seta hud_panel_minigameboard_bg "border_small"
@@ -310,7 +293,6 @@ seta hud_panel_minigameboard_bg_alpha ""
 seta hud_panel_minigameboard_bg_border ""
 seta hud_panel_minigameboard_bg_padding ""
 
-seta hud_panel_minigamestatus "1"
 seta hud_panel_minigamestatus_pos "0.74 0.15"
 seta hud_panel_minigamestatus_size "0.2 0.60"
 seta hud_panel_minigamestatus_bg "border_small"
@@ -320,7 +302,6 @@ seta hud_panel_minigamestatus_bg_alpha ""
 seta hud_panel_minigamestatus_bg_border ""
 seta hud_panel_minigamestatus_bg_padding ""
 
-seta hud_panel_minigamehelp "1"
 seta hud_panel_minigamehelp_pos "0.22 0.78"
 seta hud_panel_minigamehelp_size "0.50 0.20"
 seta hud_panel_minigamehelp_bg ""
@@ -330,7 +311,6 @@ seta hud_panel_minigamehelp_bg_alpha ""
 seta hud_panel_minigamehelp_bg_border ""
 seta hud_panel_minigamehelp_bg_padding ""
 
-seta hud_panel_minigamemenu "0"
 seta hud_panel_minigamemenu_pos "0 0.26"
 seta hud_panel_minigamemenu_size "0.2 0.49"
 seta hud_panel_minigamemenu_bg "border_small"
@@ -340,7 +320,6 @@ seta hud_panel_minigamemenu_bg_alpha ""
 seta hud_panel_minigamemenu_bg_border ""
 seta hud_panel_minigamemenu_bg_padding ""
 
-seta hud_panel_mapvote "1"
 seta hud_panel_mapvote_pos "0 0"
 seta hud_panel_mapvote_size "1 1"
 seta hud_panel_mapvote_bg "0"
@@ -350,7 +329,6 @@ seta hud_panel_mapvote_bg_alpha ""
 seta hud_panel_mapvote_bg_border ""
 seta hud_panel_mapvote_bg_padding ""
 
-seta hud_panel_itemstime "2"
 seta hud_panel_itemstime_pos "0.000000 0.290000"
 seta hud_panel_itemstime_size "0.150000 0.060000"
 seta hud_panel_itemstime_bg "0"
@@ -367,7 +345,6 @@ seta hud_panel_itemstime_text "1"
 seta hud_panel_itemstime_ratio "2"
 seta hud_panel_itemstime_dynamicsize "1"
 
-seta hud_panel_quickmenu "1"
 seta hud_panel_quickmenu_pos "0.010000 0.380000"
 seta hud_panel_quickmenu_size "0.210000 0.250000"
 seta hud_panel_quickmenu_bg ""
index 3320b16620927c9840efeb86021f73ec1392484d..c36d451547ca21b5109590575793f149e11193b8 100644 (file)
@@ -230,6 +230,7 @@ float autocvar_hud_panel_engineinfo_framecounter_time;
 float autocvar_hud_panel_fg_alpha;
 bool autocvar_hud_panel_healtharmor;
 int autocvar_hud_panel_healtharmor_baralign;
+bool autocvar_hud_panel_healtharmor_combined;
 bool autocvar_hud_panel_healtharmor_flip;
 int autocvar_hud_panel_healtharmor_iconalign;
 int autocvar_hud_panel_healtharmor_maxarmor;
index fcfa24203cd15907925220e0d874802bd0b2266e..d89f3106454f1a29abbc5d015438b9cdbd94a679 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
@@ -323,9 +243,9 @@ void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theA
        drawsubpic(pos + eX * mySize.x - eX * min(mySize.x * 0.5, mySize.y), eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0.75 0 0', '0.25 1 0', color, theAlpha, drawflag);
 }
 
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha, float fadelerp)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp)
 {
-    TC(bool, vertical); TC(bool, icon_right_align);
+    TC(bool, vertical); TC(int, icon_right_align);
        vector newPos = '0 0 0', newSize = '0 0 0';
        vector picpos, numpos;
 
index 7664abc2f165359ad1b0a849f8feda2e3b322069..d46b11db571a7044d2acfec43562a8da05cbdb3f 100644 (file)
@@ -44,7 +44,7 @@ void HUD_Radar_Hide_Maximized();
 float HUD_GetRowCount(int item_count, vector size, float item_aspect);
 vector HUD_Get_Num_Color (float x, float maxvalue);
 void DrawNumIcon(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha);
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha, float fadelerp);
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp);
 void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag);
 vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect);
 
index 07166105e5f6f043d99d65ccb57e95da60275e35..e7d74cf3e585690912667cd49df5c825456dc497 100644 (file)
@@ -60,7 +60,6 @@ void HUD_Panel_ExportCfg(string cfgname)
                {
                        panel = hud_panels_from(i);
 
-                       HUD_Write_PanelCvar("");
                        HUD_Write_PanelCvar("_pos");
                        HUD_Write_PanelCvar("_size");
                        HUD_Write_PanelCvar("_bg");
@@ -120,6 +119,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar("_progressbar_armor");
                                        HUD_Write_PanelCvar("_progressbar_gfx");
                                        HUD_Write_PanelCvar("_progressbar_gfx_smooth");
+                                       HUD_Write_PanelCvar("_combined");
                                        HUD_Write_PanelCvar("_text");
                                        break;
                                case HUD_PANEL_NOTIFY:
index 3b03979177da96edf15e5c4a3ee0ed35f04b0ee1..8f279f2aadc2e1e1c46db7d7118af4da94a75c12 100644 (file)
@@ -74,7 +74,7 @@ void HUD_HealthArmor()
 
     int maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
     int maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
-       if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
+       if(autocvar_hud_panel_healtharmor_combined) // combined health and armor display
        {
                vector v;
                v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id);
index fbc98e0a5a03cd1e0f0eca7dd1b93d22ae60ddca..5b4665f563f8f10ceb22f94316cb8562da5219d3 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 7a9f90f9af51c24fbf6ff3de4f77d6a8184ff43d..365ba01dd74babd7540df066241633f9001255fe 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 7dcf9876983761fb500f562da5fd62c026c1218f..cf43e7c1d585cf565f7dad46e614216e3f9c3137 100644 (file)
@@ -303,16 +303,24 @@ void Cmd_HUD_Help()
                "other gamemodes except DM.\n"));
 }
 
-#define HUD_DefaultColumnLayout() \
-"ping pl name | " \
-"-teams,cts,lms/kills +ft,tdm/kills -teams,lms/deaths +ft,tdm/deaths -teams,lms,rc,ka/suicides +ft,tdm/suicides -cts,dm,tdm,ka,ft/frags " /* tdm already has this in "score" */ \
-"-rc,cts,nb/dmg -rc,cts,nb/dmgtaken " \
-"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes " \
-"+lms/lives +lms/rank " \
-"+kh/caps +kh/pushes +kh/destroyed " \
-"?+rc/laps ?+rc/time ?+rc/fastest " \
-"+as/objectives +nb/faults +nb/goals +ka/pickups +ka/bckills +ka/bctime +ft/revivals " \
-"-lms,rc,nb/score"
+// NOTE: adding a gametype with ? to not warn for an optional field
+// make sure it's excluded in a previous exclusive rule, if any
+// otherwise the previous exclusive rule warns anyway
+// e.g. -teams,rc,cts,lms/kills ?+rc/kills
+#define SCOREBOARD_DEFAULT_COLUMNS \
+"ping pl name |" \
+" -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \
+" -teams,lms/deaths +ft,tdm/deaths" \
+" -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
+" -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \
+" -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \
+" +ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes" \
+" +lms/lives +lms/rank" \
+" +kh/caps +kh/pushes +kh/destroyed" \
+" ?+rc/laps ?+rc/time +rc,cts/fastest" \
+" +as/objectives +nb/faults +nb/goals" \
+" +ka/pickups +ka/bckills +ka/bctime +ft/revivals" \
+" -lms,rc,cts,inv,nb/score"
 
 void Cmd_HUD_SetFields(int argc)
 {
@@ -337,12 +345,12 @@ void Cmd_HUD_SetFields(int argc)
                argc = tokenizebyseparator(strcat("0 1 ", autocvar_scoreboard_columns), " ");
 
        if(argc < 3)
-               argc = tokenizebyseparator(strcat("0 1 ", HUD_DefaultColumnLayout()), " ");
+               argc = tokenizebyseparator(strcat("0 1 ", SCOREBOARD_DEFAULT_COLUMNS), " ");
 
        if(argc == 3)
        {
                if(argv(2) == "default")
-                       argc = tokenizebyseparator(strcat("0 1 ", HUD_DefaultColumnLayout()), " ");
+                       argc = tokenizebyseparator(strcat("0 1 ", SCOREBOARD_DEFAULT_COLUMNS), " ");
                else if(argv(2) == "all")
                {
                        string s;
@@ -397,7 +405,6 @@ void Cmd_HUD_SetFields(int argc)
                {
                        case "ping": hud_field[hud_num_fields] = SP_PING; break;
                        case "pl": hud_field[hud_num_fields] = SP_PL; break;
-                       case "pl": hud_field[hud_num_fields] = SP_PL; break;
                        case "kd": case "kdr": case "kdratio": case "k/d": hud_field[hud_num_fields] = SP_KDRATIO; break;
                        case "sum": case "diff": case "k-d": hud_field[hud_num_fields] = SP_SUM; break;
                        case "name": case "nick": hud_field[hud_num_fields] = SP_NAME; have_name = true; break;
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 738aca2cfbccba1fdec36b2bc315a0783f2f6eb8..2e204974a00427cfd3d7512df27e8b7512c47a0e 100644 (file)
@@ -1468,13 +1468,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);
@@ -1493,7 +1493,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); }
                        }
@@ -1522,14 +1522,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 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;
        }
 
index 14ab8b470a4229d5b71deeae20e0a70e2791e4d9..390212d066b4e2cf4955ff5292175aa47bc2117c 100644 (file)
@@ -498,7 +498,7 @@ void nb_spawnteams()
        }
 }
 
-void nb_delayedinit()
+void nb_delayedinit(entity this)
 {
        if(find(world, classname, "nexball_team") == world)
                nb_spawnteams();
@@ -1095,7 +1095,7 @@ REGISTER_MUTATOR(nb, g_nexball)
                WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, -1, -1);
+               SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, autocvar_timelimit_override, -1);
                have_team_spawns = -1; // request team spawns
        }
 
index 93afb72077500dca1fc5c9903a263ee458a2f2a9..95c789841dfeb9828f280953d458c657fc066962 100644 (file)
@@ -13,7 +13,7 @@ REGISTER_MUTATOR(ons, false)
                ons_Initialize();
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_onslaught_point_limit, -1, -1, -1);
+               SetLimits(autocvar_g_onslaught_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
                have_team_spawns = -1; // request team spawns
        }
 
@@ -414,8 +414,8 @@ void ons_Link_CheckUpdate()
        self.nextthink = time;
 }
 
-void ons_DelayedLinkSetup()
-{SELFPARAM();
+void ons_DelayedLinkSetup(entity this)
+{
        self.goalentity = find(world, targetname, self.target);
        self.enemy = find(world, targetname, self.target2);
        if(!self.goalentity) { objerror("can not find target\n"); }
@@ -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;
@@ -855,8 +855,8 @@ void ons_ControlPoint_Reset(entity this)
        CSQCMODEL_AUTOUPDATE(this);
 }
 
-void ons_DelayedControlPoint_Setup()
-{SELFPARAM();
+void ons_DelayedControlPoint_Setup(entity this)
+{
        onslaught_updatelinks();
 
        // captureshield setup
@@ -1081,8 +1081,8 @@ void ons_GeneratorReset(entity this)
        onslaught_updatelinks();
 }
 
-void ons_DelayedGeneratorSetup()
-{SELFPARAM();
+void ons_DelayedGeneratorSetup(entity this)
+{
        // bot waypoints
        waypoint_spawnforitem_force(self, self.origin);
        self.nearestwaypointtimeout = 0; // activate waypointing again
@@ -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;
 }
@@ -1951,8 +1951,8 @@ MUTATOR_HOOKFUNCTION(ons, MonsterMove)
        return false;
 }
 
-void ons_MonsterSpawn_Delayed()
-{SELFPARAM();
+void ons_MonsterSpawn_Delayed(entity this)
+{
        entity e, own = self.owner;
 
        if(!own) { remove(self); return; }
@@ -1981,8 +1981,8 @@ MUTATOR_HOOKFUNCTION(ons, MonsterSpawn)
        return false;
 }
 
-void ons_TurretSpawn_Delayed()
-{SELFPARAM();
+void ons_TurretSpawn_Delayed(entity this)
+{
        entity e, own = self.owner;
 
        if(!own) { remove(self); return; }
@@ -2253,7 +2253,7 @@ void ons_ScoreRules()
        ScoreRules_basics_end();
 }
 
-void ons_DelayedInit() // Do this check with a delay so we can wait for teams to be set up
+void ons_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up
 {
        ons_ScoreRules();
 
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 dfe918feca56d97da3c6479b54227ac96eafb5c7..ca2a0ed17c9234e306d03b4cabce5910cf9d79f8 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());
        }
 }
 
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;
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));
index 61d4dc80aab7cff02b48ef15c4ed07e18d0ffc96..15b725ee4b18d2bcd934728a6e0b2c2c8b233496 100644 (file)
@@ -82,7 +82,7 @@ const vector BUFF_MAX = ('16 16 20');
 #include <common/gamemodes/all.qh>
 
 .float buff_time = _STAT(BUFF_TIME);
-void buffs_DelayedInit();
+void buffs_DelayedInit(entity this);
 
 REGISTER_MUTATOR(buffs, cvar("g_buffs"))
 {
@@ -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;
                                }
@@ -1045,7 +1045,7 @@ MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsPrettyString)
        return false;
 }
 
-void buffs_DelayedInit()
+void buffs_DelayedInit(entity this)
 {
        if(autocvar_g_buffs_spawn_count > 0)
        if(find(world, classname, "item_buff") == world)
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;
        }
 
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
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);
 }
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 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()
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;
index d67a1de3d8f7a230d8620f1ffd9b815d834a8ddf..1e1726ae452fe716041d291f30581eb3a1d3cab9 100644 (file)
@@ -3,9 +3,8 @@
 REGISTER_NET_TEMP(TE_CSQC_SVNOTICE)
 
 #ifdef SVQC
-void sv_notice_join_think()
+void sv_notice_join_think(entity this)
 {
-    SELFPARAM();
     int argc = tokenizebyseparator(autocvar_sv_join_notices, "|");
     if (argc <= 0) return;
     for (int i = 0; i < argc; ++i)
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
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 1ddb70799878118bd88052dbd39dcb14cd21ab1e..0ecfa180f45bc143e6d11c831bdbbc41bc0a7b60 100644 (file)
@@ -1326,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 233762202efda470e23ed15819f2fa2fadf34bd5..ec2f7cad3ddf3d4fc9ca8ae568824b37d216854c 100644 (file)
@@ -427,7 +427,7 @@ void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
                                PS_B_IN_DB = db_create();
 
                        // now request the information
-                       uri = strcat(uri, "/player/", uri_escape(uri_escape(joiningplayer.crypto_idfp)), "/elo.txt");
+                       uri = strcat(uri, "/player/", uri_escape(uri_escape(uri_escape(joiningplayer.crypto_idfp))), "/elo.txt");
                        LOG_TRACE("Retrieving playerstats from URL: ", uri, "\n");
                        url_single_fopen(
                                uri,
index 21e009022145aa9bbcef21d404190f8e5abed328..1d96923ed0fe314b643e8dd510421c5615b34476 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);
@@ -37,8 +39,7 @@ void ClientState_attach(entity this)
 
     GetCvars(this, 0);  // get other cvars from player
 
-       // TODO: xonstat elo.txt support, until then just 404s
-       if (false && IS_REAL_CLIENT(this)) { PlayerStats_PlayerBasic_CheckUpdate(this); }
+       if (IS_REAL_CLIENT(this)) { PlayerStats_PlayerBasic_CheckUpdate(this); }
 
        // TODO: fold all of these into ClientState
 
index a381324f8990ea7613132f3086f2c9fbaaf9794f..85ba9f51b3471bac94a42f0d967f1dd7f2e7961b 100644 (file)
@@ -816,7 +816,7 @@ LABEL(pickup)
        other.last_pickup = time;
 
        Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
-       _sound (other, CH_TRIGGER, (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM);
+       _sound (other, (this.itemdef.instanceOfPowerup ? CH_TRIGGER_SINGLE : CH_TRIGGER), (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM);
 
        if (this.classname == "droppedweapon")
                remove (this);
@@ -863,8 +863,8 @@ void Item_Reset(entity this)
 }
 void Item_Reset_self() { SELFPARAM(); Item_Reset(this); }
 
-void Item_FindTeam()
-{SELFPARAM();
+void Item_FindTeam(entity this)
+{
        entity e;
 
        if(self.effects & EF_NODRAW)
@@ -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);
                }
 
index d6c97445f6be572cbe87f2ebcf7d2cfbbf6cb4f1..1eb4b182dee07359b7fd7d0baf8b2948c877071a 100644 (file)
@@ -92,7 +92,7 @@ void Item_Touch();
 
 void Item_Reset(entity this);
 
-void Item_FindTeam();
+void Item_FindTeam(entity this);
 // Savage: used for item garbage-collection
 
 bool ItemSend(entity this, entity to, int sf);
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..1e19dfafc7205e3e74d9c1aad7daa23f34adf567 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());
        }
 }
 
@@ -506,8 +506,8 @@ bool LinkDoors_isconnected(entity e1, entity e2, entity pass)
 #ifdef SVQC
 void door_link();
 #endif
-void LinkDoors()
-{SELFPARAM();
+void LinkDoors(entity this)
+{
        entity  t;
        vector  cmins, cmaxs;
 
@@ -693,8 +693,8 @@ void door_link()
 }
 #endif
 
-void door_init_startopen()
-{SELFPARAM();
+void door_init_startopen(entity this)
+{
        SUB_SETORIGIN(self, self.pos2);
        self.pos2 = self.pos1;
        self.pos1 = self.origin;
@@ -850,10 +850,10 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                this.drawmask = MASK_NORMAL;
                this.use = door_use;
 
-               LinkDoors();
+               LinkDoors(this);
 
                if(this.spawnflags & DOOR_START_OPEN)
-                       door_init_startopen();
+                       door_init_startopen(this);
 
                this.move_time = time;
                this.move_origin = this.origin;
index 4f88e9e9b5ae02c595511f9a96625ee1406d72e2..4c97fe6a8aa7c1d7584c4fb63d7c024a247c968e 100644 (file)
@@ -36,8 +36,8 @@ void door_rotating_reset(entity this)
        this.nextthink = 0;
 }
 
-void door_rotating_init_startopen()
-{SELFPARAM();
+void door_rotating_init_startopen(entity this)
+{
        self.angles = self.movedir;
        self.pos2 = '0 0 0';
        self.pos1 = self.movedir;
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 ea546164ce71fb0589b03f12f8fea3962c82f214..14cfa564134b74e0c6633ac53d5862a05c4db6d7 100644 (file)
@@ -3,7 +3,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_PLAT)
 #ifdef SVQC
 void plat_link();
 
-void plat_delayedinit()
+void plat_delayedinit(entity this)
 {
        plat_link();
        plat_spawn_inside_trigger(); // the "start moving" trigger
index 77bb7b87090b4e093180c0b1ec0cf2cb2fa205c1..2b27c7355ce5b814bc1ceac5dff541aacee79a4e 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
@@ -184,8 +184,8 @@ void train_use()
        self.use = func_null; // not again
 }
 
-void func_train_find()
-{SELFPARAM();
+void func_train_find(entity this)
+{
        entity targ;
        targ = find(world, targetname, self.target);
        self.target = targ.target;
index 5c2086477475abe8e6541374f1d6b12843a996a9..2dfa1ac98f9817d4b4cc07b1d245416db3ca00ee 100644 (file)
@@ -71,8 +71,8 @@ void func_vectormamamam_controller_think()
                self.owner.velocity = (self.owner.destvec + func_vectormamamam_origin(self.owner, 0.1) - self.owner.origin) * 10;
 }
 
-void func_vectormamamam_findtarget()
-{SELFPARAM();
+void func_vectormamamam_findtarget(entity this)
+{
        if(self.target != "")
                self.wp00 = find(world, targetname, self.target);
 
index 842248a4b31f0acc93a7b91f32a784dea7c1978c..2ac304a212d08fbfaa28183353538040cee7716f 100644 (file)
@@ -1,8 +1,8 @@
 // the way this entity works makes it no use to CSQC, as it removes itself instantly
 
 #ifdef SVQC
-void follow_init()
-{SELFPARAM();
+void follow_init(entity this)
+{
        entity src, dst;
        src = world;
        dst = world;
index bcd6f2807675e89db6ea3ebd05e9ae95dd70e449..48e23a287d68de3c00eeeb1af9bf9a1531da0882 100644 (file)
@@ -49,8 +49,8 @@ void misc_laser_aim()
        }
 }
 
-void misc_laser_init()
-{SELFPARAM();
+void misc_laser_init(entity this)
+{
        if(self.target != "")
                self.enemy = find(world, targetname, self.target);
 }
@@ -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));
 }
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..82793c9367f969c04b4ecc6a7361e84cc89d9923 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.
@@ -297,8 +297,8 @@ void target_spawn_use()
        }
 }
 
-void target_spawn_spawnfirst()
-{SELFPARAM();
+void target_spawn_spawnfirst(entity this)
+{
        activator = self.target_spawn_activator;
        if(self.spawnflags & 2)
                target_spawn_use();
index afeabfcddc3cba2cf3da9d779b5007a79176505c..04667f4cc228391eefab47954ab56695e99d3f10 100644 (file)
@@ -247,9 +247,8 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
        return e;
 }
 
-void teleport_findtarget()
+void teleport_findtarget(entity this)
 {
-    SELFPARAM();
        int n = 0;
        entity e;
        for(e = world; (e = find(e, targetname, self.target)); )
index 0e9e23572f323df37678c4bb9eacd98a9b85c361..b0571dc310b4e2c333d8dab4142b62bf0a425f15 100644 (file)
@@ -19,7 +19,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player);
 
 void Teleport_Touch ();
 
-void teleport_findtarget();
+void teleport_findtarget(entity this);
 
 entity Teleport_Find(vector mi, vector ma);
 
index d90e3418caab154454fbafeb36a6c350827bd177..9c0c0791ab3443c3b25672c1dda77b42add84dba 100644 (file)
@@ -1,6 +1,6 @@
 #ifdef SVQC
-void gamestart_use()
-{SELFPARAM();
+void gamestart_use(entity this)
+{
        activator = self;
        SUB_UseTargets();
        remove(self);
@@ -9,7 +9,7 @@ void gamestart_use()
 void self_spawnfunc_trigger_gamestart();
 spawnfunc(trigger_gamestart)
 {
-       this.use = gamestart_use;
+       setuse(this, gamestart_use);
        this.reset2 = self_spawnfunc_trigger_gamestart;
 
        if(this.wait)
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..556fe66358ed00fae0eda7d5bd4786824b43f8d1 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)
@@ -274,31 +274,31 @@ void trigger_push_touch()
 
 #ifdef SVQC
 void trigger_push_link();
-void trigger_push_updatelink();
+void trigger_push_updatelink(entity this);
 #endif
-void trigger_push_findtarget()
-{SELFPARAM();
+void trigger_push_findtarget(entity this)
+{
        entity t;
        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;
+void trigger_push_updatelink(entity this)
+{
+       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 0c4180849667aeef916314c2c128486052954367..07973614b88a23ae9a24ed8a6a70030706ede592 100644 (file)
@@ -38,7 +38,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
 void trigger_push_touch();
 
 .vector dest;
-void trigger_push_findtarget();
+void trigger_push_findtarget(entity this);
 
 /*
  * ENTITY PARAMETERS:
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 f7e69495228b97987d3dbd636c93015c1ca2e4b8..db75434bfb6f98bd226f81bc72c07bbec718683b 100644 (file)
@@ -55,8 +55,8 @@ bool trigger_viewloc_send(entity this, entity to, int sf)
        return true;
 }
 
-void viewloc_init()
-{SELFPARAM();
+void viewloc_init(entity this)
+{
        entity e;
        for(e = world; (e = find(e, targetname, self.target)); )
                if(e.classname == "target_viewlocation_start")
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());
                }
        }
 }
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)
index d5814489fb6936a14d1c4b5a6ab90ff1a9504e8a..853750f6caf7fd839b3a7d4e50d4d38ec0b23440 100644 (file)
@@ -19,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");
     }
index ca665d08d91de207aa45dde4bdf8bcc94008c220..918ce4ca3a1bbc91c1c14de41af6595399379855 100644 (file)
@@ -73,8 +73,8 @@ float walker_firecheck()
     return turret_firecheck();
 }
 
-void walker_melee_do_dmg()
-{SELFPARAM();
+void walker_melee_do_dmg(entity this)
+{
     vector where;
     entity e;
 
@@ -92,8 +92,8 @@ void walker_melee_do_dmg()
     }
 }
 
-void walker_setnoanim()
-{SELFPARAM();
+void walker_setnoanim(entity this)
+{
     turrets_setframe(ANIM_NO, false);
     self.animflag = self.frame;
 }
@@ -109,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)
@@ -641,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 170b2dd30e9f9cde593d3c3a88752f6a2c2c7aaf..91e4345a95b3f6c6c0e58f79dfe8d7b5198c5867 100644 (file)
@@ -18,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);
     }
 }
index 0e6b6d6ba44e2e409f13c37e9789ebb0e2be9f7b..ec643fcb5885cac7d20ccd0cfe0cf16b93b6ea80 100644 (file)
@@ -1480,13 +1480,6 @@ vector animfixfps(entity e, vector a, vector b)
 }
 #endif
 
-#ifdef SVQC
-void dedicated_print(string input) // print(), but only print if the server is not local
-{
-       if(server_is_dedicated) { LOG_INFO(input); }
-}
-#endif
-
 #ifndef MENUQC
 Notification Announcer_PickNumber(int type, int num)
 {
index 7bc8675335958fef698d3c06692b63a0eb7edb86..de2c32513b064f3c9e73dc116a7b75eea3b4e865 100644 (file)
@@ -27,8 +27,8 @@ void depthfirst(entity start, .entity up, .entity downleft, .entity right, void(
 float median(float a, float b, float c);
 
 // converts a number to a string with the indicated number of decimals
-// works for up to 10 decimals!
 string ftos_decimals(float number, float decimals);
+string ftos_mindecimals(float number);
 
 bool fexists(string f);
 
@@ -273,10 +273,6 @@ string CCR(string input);
 vector animfixfps(entity e, vector a, vector b);
 #endif
 
-#ifdef SVQC
-void dedicated_print(string input);
-#endif
-
 #ifndef MENUQC
 const float CNT_NORMAL = 1;
 const float CNT_GAMESTART = 2;
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..165ae07e6d92a7bb4eb4e0a3ec8ca9494237dcfa 100644 (file)
@@ -3,6 +3,7 @@
 #ifdef SVQC
 
 #include <common/turrets/sv_turrets.qh>
+#include "vehicle.qh"
 
 // vehicle cvars
 bool autocvar_g_vehicles = true;
@@ -25,6 +26,8 @@ float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
 float autocvar_g_vehicles_tag_damagerate = 5;
 float autocvar_g_vehicles_weapon_damagerate = 1;
 
+.float vehicle_last_trace;
+
 // flags:
 .int vehicle_flags;
 
@@ -81,7 +84,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 +102,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);
 
index fd6b19bf30aed777f43aa1844d485e50e8a3e0cf..c3c0861e95ef257187904119fc0a3938a0e604ac 100644 (file)
@@ -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
@@ -285,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)
@@ -381,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;
        }
 
@@ -715,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))
 {
@@ -798,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;
@@ -878,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
@@ -916,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 7f47c6b0873e0aed0d2080f48650526b5cec164e..ded599b7d2a77cc5b481f65a36dd8ef858f646f3 100644 (file)
@@ -31,6 +31,8 @@ REGISTER_VEHICLE(RACER, NEW(Racer));
 
 bool autocvar_g_vehicle_racer = true;
 
+float autocvar_g_vehicle_racer_thinkrate = 0.05; // TODO: any higher causes it to sink in liquids
+
 float autocvar_g_vehicle_racer_speed_afterburn = 3000;
 // energy consumed per second
 float autocvar_g_vehicle_racer_afterburn_cost = 100;
@@ -182,7 +184,9 @@ bool racer_frame(entity this)
 
        vehicles_frame(vehic, this);
 
-       if(pointcontents(vehic.origin) != CONTENT_WATER)
+       traceline(vehic.origin, vehic.origin + '0 0 1', MOVE_NOMONSTERS, this);
+       int cont = trace_dpstartcontents;
+       if(cont & DPCONTENTS_WATER)
                vehic.air_finished = time + autocvar_g_vehicle_racer_water_time;
 
        if(IS_DEAD(vehic))
@@ -195,7 +199,11 @@ bool racer_frame(entity this)
 
        PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
 
-       crosshair_trace(this);
+       if(time >= vehic.vehicle_last_trace)
+       {
+               crosshair_trace(this);
+               vehic.vehicle_last_trace = time + autocvar_g_vehicle_racer_thinkrate;
+       }
 
        vehic.angles_x *= -1;
 
@@ -219,10 +227,9 @@ bool racer_frame(entity this)
        vector df = vehic.velocity * -autocvar_g_vehicle_racer_friction;
        //vehic.velocity_z = ftmp;
 
-       int cont = pointcontents(vehic.origin);
        if(this.movement)
        {
-               if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
+               if(cont & DPCONTENTS_LIQUIDSMASK)
                {
                        if(this.movement_x) { df += v_forward * ((this.movement_x > 0) ? autocvar_g_vehicle_racer_water_speed_forward : -autocvar_g_vehicle_racer_water_speed_forward); }
                        if(this.movement_y) { df += v_right * ((this.movement_y > 0) ? autocvar_g_vehicle_racer_water_speed_strafe : -autocvar_g_vehicle_racer_water_speed_strafe); }
@@ -264,7 +271,7 @@ bool racer_frame(entity this)
 
                vehic.wait = time;
 
-               if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
+               if(cont & DPCONTENTS_LIQUIDSMASK)
                {
                        vehic.vehicle_energy -= autocvar_g_vehicle_racer_waterburn_cost * PHYS_INPUT_TIMELENGTH;
                        df += (v_forward * autocvar_g_vehicle_racer_waterburn_speed);
@@ -298,7 +305,7 @@ bool racer_frame(entity this)
                sound (vehic.tur_head, CH_TRIGGER_SINGLE, SND_Null, VOL_VEHICLEENGINE, ATTEN_NORM);
        }
 
-       if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
+       if(cont & DPCONTENTS_LIQUIDSMASK)
                vehic.racer_watertime = time;
 
        float dforce = autocvar_g_vehicle_racer_downforce;
@@ -309,6 +316,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))
@@ -327,8 +336,11 @@ bool racer_frame(entity this)
                wep1.wr_think(wep1, vehic, weaponentity, 1);
        }
 
+       setself(this);
+
        if(autocvar_g_vehicle_racer_rocket_locktarget)
        {
+               if(vehic.vehicle_last_trace == time + autocvar_g_vehicle_racer_thinkrate)
                vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime,
                                                 (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * frametime,
                                                 autocvar_g_vehicle_racer_rocket_locked_time);
@@ -396,35 +408,32 @@ bool racer_frame(entity this)
 
 void racer_think()
 {SELFPARAM();
-       self.nextthink = time;
+       this.nextthink = time + autocvar_g_vehicle_racer_thinkrate;
 
-       float pushdeltatime = time - self.lastpushtime;
-       if (pushdeltatime > 0.15) pushdeltatime = 0;
-       self.lastpushtime = time;
-       if(!pushdeltatime) return;
-
-       tracebox(self.origin, self.mins, self.maxs, self.origin - ('0 0 1' * autocvar_g_vehicle_racer_springlength), MOVE_NOMONSTERS, self);
+       tracebox(this.origin, this.mins, this.maxs, this.origin - ('0 0 1' * autocvar_g_vehicle_racer_springlength), MOVE_NOMONSTERS, this);
 
-       vector df = self.velocity * -autocvar_g_vehicle_racer_friction;
+       vector df = this.velocity * -autocvar_g_vehicle_racer_friction;
        df_z += (1 - trace_fraction) * autocvar_g_vehicle_racer_hoverpower + sin(time * 2) * (autocvar_g_vehicle_racer_springlength * 2);
 
        float forced = autocvar_g_vehicle_racer_upforcedamper;
 
-       int cont = pointcontents(self.origin - '0 0 64');
-       if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
+       //int cont = pointcontents(self.origin - '0 0 64');
+       traceline(this.origin - '0 0 64', this.origin - '0 0 64', MOVE_NOMONSTERS, this);
+       //if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
+       if(trace_dpstartcontents & DPCONTENTS_LIQUIDSMASK)
        {
                forced = autocvar_g_vehicle_racer_water_upforcedamper;
-               self.velocity_z += 200;
+               this.velocity_z += 200;
        }
 
-       self.velocity += df * pushdeltatime;
-       if(self.velocity_z > 0)
-               self.velocity_z *= 1 - forced * pushdeltatime;
+       this.velocity += df * autocvar_g_vehicle_racer_thinkrate;
+       if(this.velocity_z > 0)
+               this.velocity_z *= 1 - forced * autocvar_g_vehicle_racer_thinkrate;
 
-       self.angles_x *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * pushdeltatime);
-       self.angles_z *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * pushdeltatime);
+       this.angles_x *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * autocvar_g_vehicle_racer_thinkrate);
+       this.angles_z *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * autocvar_g_vehicle_racer_thinkrate);
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void racer_exit(float eject)
@@ -515,8 +524,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
@@ -560,7 +569,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
 }
 
@@ -665,29 +674,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 c13ec3eafa818485cb3de68df5e5af306d578a35..8b2f9e01b89a7160ade80bf7d2a90f5ac992d5c4 100644 (file)
@@ -200,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);
 
@@ -385,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))
@@ -429,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;
        }
 
@@ -600,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))
 {
@@ -745,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 a74c32513f6ce9b442ff1df40e4d15ac72caf3db..57f1310c4b8cf618f21b8f12b2f2ba39aa13e7a4 100644 (file)
@@ -75,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;
        }
 
@@ -128,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
@@ -284,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);
@@ -309,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);
@@ -536,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))
 {
@@ -618,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 63f366e039d348bcc8e0a541050c1e9d1e5e4c03..afa57de2dad1f0fa328520996595a4892b716b0d 100644 (file)
@@ -46,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)
@@ -139,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;
@@ -214,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));
@@ -241,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
index f670b6f5a65dc028565f2026fe82a4e8ae87f9cc..61e2b02501fc74e14eb6f064304116dde8415936 100644 (file)
@@ -3,7 +3,7 @@
 #include <common/weapons/all.qh>
 
 #ifdef SVQC
-void spiderbot_rocket_do();
+void spiderbot_rocket_do(entity this);
 #endif
 
 // 400 (x2) DPS
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 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 2ed0ca7140ed6995069c37b793eee55eb099ebfe..d1ce0578bd91e2db18eaa520b8ce2065ad917987 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 13e8ac1129d80feeffec61d507bf799d495475bd..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());
     }
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..c5e020660d3980f5f029bf97af8112b17603f6f6 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"
 
@@ -63,6 +72,7 @@ bool is_bool  (float  this) { return this == true || this == false; }
 #include "functional.qh"
 #include "i18n.qh"
 #include "iter.qh"
+#include "json.qc"
 #include "lazy.qh"
 #include "linkedlist.qh"
 #include "log.qh"
@@ -93,3 +103,5 @@ bool is_bool  (float  this) { return this == true || this == false; }
 #include "urllib.qc"
 #include "vector.qh"
 #include "yenc.qh"
+
+#include "matrix/_mod.inc"
index fd811e7a9caaa642ab6e60f96217b50ba0532974..ecec32a053299816c41560b64faa6d92e013d4f0 100644 (file)
@@ -1,5 +1,6 @@
 // generated file; do not modify
 #include "angle.qc"
+#include "json.qc"
 #include "p2mathlib.qc"
 #include "random.qc"
 #include "sortlist.qc"
index b923062bc9a9a35115ea48cbec1aef192d27ccff..d4c1eadac75db7a4dbbd87a738892b7e0f039565 100644 (file)
                SELFPARAM();
                this.think     = SUB_Remove_self;
                this.nextthink = time;
-               WITH(entity, self, this.owner, this.use());
+               WITHSELF(this.owner, this.selfthink(this));
        }
 
-/*
-    Execute func() after time + fdelay.
-    self when func is executed = self when defer is called
-*/
-       void defer(entity this, float fdelay, void() func)
+    /**
+     * Execute func() after time + fdelay.
+     * self when func is executed = self when defer is called
+     */
+       void defer(entity this, float fdelay, void(entity this) func)
        {
                entity e    = new_pure(deferred);
                e.owner     = this;
-               e.use       = func;
+               setthink(e, func);
                e.think     = defer_think;
                e.nextthink = time + fdelay;
        }
index eaac63f5eff415c8d7a5aec8fa815b70a3cbe433..c21d02121347d34b79042a31809ccd421693ab3f 100644 (file)
        } MACRO_END
 
 #define STRING_ITERATOR_GET(this) str2chr(this##_s, this##_i++)
+#define STRING_ITERATOR_PEEK(this) str2chr(this##_s, this##_i)
+#define STRING_ITERATOR_NEXT(this) MACRO_BEGIN ++this##_i; MACRO_END
+#define STRING_ITERATOR_UNGET(this) MACRO_BEGIN --this##_i; MACRO_END
+#define STRING_ITERATOR_SAVE(this) this##_i
+#define STRING_ITERATOR_LOAD(this, n) MACRO_BEGIN this##_i = n; MACRO_END
 
 #define FOREACH_CHAR(s, cond, body) \
        MACRO_BEGIN \
        } 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)
diff --git a/qcsrc/lib/json.qc b/qcsrc/lib/json.qc
new file mode 100644 (file)
index 0000000..acdf198
--- /dev/null
@@ -0,0 +1,300 @@
+#include "test.qh"
+
+STRING_ITERATOR(_json, string_null, 0);
+// Store interleaved keys/values in a string buffer
+int _json_buffer;
+// Last read string
+string _json_temp;
+
+/** parse a json object */
+bool _json_parse_object();
+    bool _json_parse_members();
+        bool _json_parse_pair();
+bool _json_parse_array();
+bool _json_parse_value();
+    bool _json_parse_true();
+    bool _json_parse_false();
+    bool _json_parse_null();
+bool _json_parse_string(bool add);
+bool _json_parse_number();
+    bool _json_parse_float();
+    bool _json_parse_int();
+
+#define JSON_BEGIN() int __i = STRING_ITERATOR_SAVE(_json)
+#define JSON_FAIL(reason) goto fail
+#define JSON_END() \
+   return true; \
+:fail \
+   STRING_ITERATOR_LOAD(_json, __i); \
+   return false;
+// Current namespace
+string _json_ns;
+// Current keys
+int _json_keys;
+
+bool _json_parse_object() {
+    JSON_BEGIN();
+    if (STRING_ITERATOR_GET(_json) != '{') JSON_FAIL("expected '{'");
+    WITH(int, _json_keys, bufstr_add(_json_buffer, "", 0), _json_parse_members());
+    if (STRING_ITERATOR_GET(_json) != '}') JSON_FAIL("expected '}'");
+    JSON_END();
+}
+
+    bool _json_parse_members() {
+        JSON_BEGIN();
+        for (;;) {
+            if (!_json_parse_pair()) JSON_FAIL("expected pair");
+            if (STRING_ITERATOR_PEEK(_json) == ',') {
+                STRING_ITERATOR_NEXT(_json);
+                continue;
+            }
+            break;
+        }
+        JSON_END();
+    }
+
+        bool _json_parse_pair() {
+            JSON_BEGIN();
+            if (!_json_parse_string(false)) JSON_FAIL("expected string");
+            string key = _json_temp;
+            bufstr_set(_json_buffer, _json_keys, cons(bufstr_get(_json_buffer, _json_keys), key));
+            key = _json_ns ? strcat(_json_ns, ".", key) : key;
+            bufstr_add(_json_buffer, key, 0);
+            if (STRING_ITERATOR_GET(_json) != ':') JSON_FAIL("expected ':'");
+            bool ret = false; WITH(string, _json_ns, key, ret = _json_parse_value());
+            if (!ret) JSON_FAIL("expected value");
+            JSON_END();
+        }
+
+bool _json_parse_array() {
+    JSON_BEGIN();
+    if (STRING_ITERATOR_GET(_json) != '[') JSON_FAIL("expected '['");
+    int len = bufstr_add(_json_buffer, "0", 0);
+    if (len) bufstr_set(_json_buffer, len - 1, strcat(bufstr_get(_json_buffer, len - 1), ".length"));
+    bool required = false;
+    for (int n = 0; ; n++) {
+        string key = ftos(n);
+        key = _json_ns ? strcat(_json_ns, ".", key) : key;
+        int it = bufstr_add(_json_buffer, key, 0);
+        bool ret = false; WITH(string, _json_ns, key, ret = _json_parse_value());
+        if (!ret) {
+            bufstr_free(_json_buffer, it);
+            if (required) JSON_FAIL("expected value"); else break;
+        }
+        bufstr_set(_json_buffer, len, ftos(n + 1));
+        if (STRING_ITERATOR_PEEK(_json) == ',') {
+            STRING_ITERATOR_NEXT(_json);
+            required = true;
+            continue;
+        }
+        break;
+    }
+    if (STRING_ITERATOR_GET(_json) != ']') JSON_FAIL("expected ']'");
+    JSON_END();
+}
+
+bool _json_parse_value() {
+    JSON_BEGIN();
+    if (!(_json_parse_string(true)
+        || _json_parse_number()
+        || _json_parse_object()
+        || _json_parse_array()
+        || _json_parse_true()
+        || _json_parse_false()
+        || _json_parse_null())) JSON_FAIL("expected value");
+    JSON_END();
+}
+
+    bool _json_parse_true() {
+        JSON_BEGIN();
+        if (!(STRING_ITERATOR_GET(_json) == 't'
+            && STRING_ITERATOR_GET(_json) == 'r'
+            && STRING_ITERATOR_GET(_json) == 'u'
+            && STRING_ITERATOR_GET(_json) == 'e'))
+            JSON_FAIL("expected 'true'");
+        bufstr_add(_json_buffer, "1", 0);
+        JSON_END();
+    }
+
+    bool _json_parse_false() {
+        JSON_BEGIN();
+        if (!(STRING_ITERATOR_GET(_json) == 'f'
+            && STRING_ITERATOR_GET(_json) == 'a'
+            && STRING_ITERATOR_GET(_json) == 'l'
+            && STRING_ITERATOR_GET(_json) == 's'
+            && STRING_ITERATOR_GET(_json) == 'e'))
+            JSON_FAIL("expected 'false'");
+        bufstr_add(_json_buffer, "0", 0);
+        JSON_END();
+    }
+
+    bool _json_parse_null() {
+        JSON_BEGIN();
+        if (!(STRING_ITERATOR_GET(_json) == 'n'
+            && STRING_ITERATOR_GET(_json) == 'u'
+            && STRING_ITERATOR_GET(_json) == 'l'
+            && STRING_ITERATOR_GET(_json) == 'l'))
+            JSON_FAIL("expected 'null'");
+        bufstr_add(_json_buffer, "", 0);
+        JSON_END();
+    }
+
+bool _json_parse_string(bool add) {
+    JSON_BEGIN();
+    if (STRING_ITERATOR_GET(_json) != '"') JSON_FAIL("expected opening '\"'");
+    string s = "";
+    for (int c; (c = STRING_ITERATOR_GET(_json)); ) {
+        if (c == '"') {
+            STRING_ITERATOR_UNGET(_json);
+            break;
+        } else if (c == '\\') {
+            string esc;
+            switch (STRING_ITERATOR_GET(_json)) {
+                default:
+                    JSON_FAIL("expected ( '\"' | '\\' | 'n' | 't' )");
+                case '"': esc = "\""; break;
+                case '\\': esc = "\\"; break;
+                case 'n': esc = "\n"; break;
+                case 't': esc = "\t"; break;
+                case 'u': esc = "\\u"; break; // TODO
+                case '/': esc = "/"; break;
+            }
+            s = strcat(s, esc);
+        } else {
+            s = strcat(s, chr2str(c));
+        }
+    }
+    if (STRING_ITERATOR_GET(_json) != '"') JSON_FAIL("expected closing '\"'");
+    if (add) bufstr_add(_json_buffer, s, 0);
+    _json_temp = s;
+    JSON_END();
+}
+
+bool _json_parse_number() {
+    JSON_BEGIN();
+    if (!(_json_parse_float() || _json_parse_int())) JSON_FAIL("expected number");
+    JSON_END();
+}
+
+    bool _json_parse_float() {
+        JSON_BEGIN();
+        string s = "";
+        bool needdot = true;
+        for (int c; (c = STRING_ITERATOR_GET(_json)); ) {
+            if (!(c >= '0' && c <= '9')) {
+                if (c == '.' && needdot) {
+                    // fine
+                    needdot = false;
+                } else {
+                    STRING_ITERATOR_UNGET(_json);
+                    break;
+                }
+            }
+            s = strcat(s, chr2str(c));
+        }
+        if (s == "") JSON_FAIL("expected float");
+        bufstr_add(_json_buffer, s, 0);
+        JSON_END();
+    }
+
+    bool _json_parse_int() {
+        JSON_BEGIN();
+        string s = "";
+        for (int c; (c = STRING_ITERATOR_GET(_json)); ) {
+            if (!(c >= '0' && c <= '9')) {
+                STRING_ITERATOR_UNGET(_json);
+                break;
+            }
+            if (s == "" && c == '0') JSON_FAIL("expected [1-9]");
+            s = strcat(s, chr2str(c));
+        }
+        if (s == "") JSON_FAIL("expected int");
+        if (ftos(stof(s)) != s) JSON_FAIL("expected int");
+        bufstr_add(_json_buffer, s, 0);
+        JSON_END();
+    }
+
+int json_parse(string in, bool() func) {
+    string trimmed = "";
+    LABEL(trim) {
+        int o = strstrofs(in, "\"", 0);
+        if (o >= 0) {
+            string part = substring(in, 0, o + 1); in = substring(in, o + 1, -1);
+            part = strreplace(" ", "", part);
+            part = strreplace("\n", "", part);
+            trimmed = strcat(trimmed, part);
+            goto trim_str;
+        } else {
+            string part = in;
+            part = strreplace(" ", "", part);
+            part = strreplace("\n", "", part);
+            trimmed = strcat(trimmed, part);
+            goto done;
+        }
+    }
+    LABEL(trim_str) {
+        int o = strstrofs(in, "\"", 0);
+        int esc = strstrofs(in, "\\\"", 0);
+        if (o < esc || esc < 0) {
+            // simple string
+            string part = substring(in, 0, o + 1); in = substring(in, o + 1, -1);
+            trimmed = strcat(trimmed, part);
+            goto trim;
+        } else {
+            // has escape
+            string part = substring(in, 0, esc + 2); in = substring(in, esc + 2, -1);
+            trimmed = strcat(trimmed, part);
+            goto trim_str;
+        }
+    }
+    LABEL(done);
+
+    STRING_ITERATOR_SET(_json, trimmed, 0);
+    _json_buffer = buf_create();
+    bool ret = func();
+    if (!ret) {
+        buf_del(_json_buffer);
+        _json_buffer = -1;
+    }
+    return _json_buffer;
+}
+
+string json_get(int buf, string key)
+{
+    for (int i = 1, n = buf_getsize(buf); i < n; i += 2) {
+        if (bufstr_get(buf, i) == key) return bufstr_get(buf, i + 1);
+    }
+    return string_null;
+}
+
+void json_del(int buf)
+{
+    buf_del(buf);
+}
+
+void json_dump(int buf)
+{
+    for (int i = 0, n = buf_getsize(buf); i < n; ++i) {
+        print(bufstr_get(buf, i), "\n");
+    }
+}
+
+#undef JSON_BEGIN
+#undef JSON_FAIL
+#undef JSON_END
+
+TEST(json, Parse)
+{
+    string s = "{\n\
+    \"m_string\": \"\\\"string\\\"\",\n\
+    \"m_int\": 123,\n\
+    \"m_bool\": true,\n\
+    \"m_null\": null,\n\
+    \"m_obj\": { },\n\
+    \"m_arr\": [ ]\n}"; // "
+    print(s, "\n");
+    int buf = json_parse(s, _json_parse_object);
+    EXPECT_NE(-1, buf);
+    json_dump(buf);
+    SUCCEED();
+}
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__))
diff --git a/qcsrc/lib/matrix/_mod.inc b/qcsrc/lib/matrix/_mod.inc
new file mode 100644 (file)
index 0000000..84522f1
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "command.qc"
+#include "matrix.qc"
diff --git a/qcsrc/lib/matrix/command.qc b/qcsrc/lib/matrix/command.qc
new file mode 100644 (file)
index 0000000..27c7ec9
--- /dev/null
@@ -0,0 +1,48 @@
+#include "command.qh"
+
+#include <common/command/all.qh>
+
+GENERIC_COMMAND(mx, "Send a matrix command") {
+    switch (argv(1)) {
+        case "user":
+            if (matrix_user) strunzone(matrix_user);
+            matrix_user = strzone(substring(command, argv_start_index(2), -1));
+            break;
+        case "token":
+            if (matrix_access_token) strunzone(matrix_access_token);
+            matrix_access_token = strzone(substring(command, argv_start_index(2), -1));
+            break;
+        case "messages":
+            MX_Messages(string_null);
+            break;
+        case "nick":
+            MX_Nick(substring(command, argv_start_index(2), -1));
+            break;
+        case "join":
+            string s = substring(command, argv_start_index(2), -1);
+            if (s != matrix_room && matrix_room != "") {
+                MX_Leave(matrix_room);
+                strunzone(matrix_room);
+            }
+            matrix_room = strzone(s);
+            MX_Join(matrix_room);
+            break;
+        case "sync":
+            MX_Sync(string_null);
+            break;
+        case "typing":
+            MX_Typing(true);
+            break;
+        case "say":
+            MX_Say(substring(command, argv_start_index(2), -1));
+            break;
+        case "leave":
+            MX_Leave(matrix_room);
+            matrix_room = string_null;
+            break;
+        case "forget":
+            MX_Forget(matrix_room);
+            matrix_room = "";
+            break;
+    }
+}
diff --git a/qcsrc/lib/matrix/command.qh b/qcsrc/lib/matrix/command.qh
new file mode 100644 (file)
index 0000000..7645954
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+
+#include "matrix.qh"
diff --git a/qcsrc/lib/matrix/matrix.qc b/qcsrc/lib/matrix/matrix.qc
new file mode 100644 (file)
index 0000000..23ec02e
--- /dev/null
@@ -0,0 +1,212 @@
+#include "matrix.qh"
+
+.string message;
+
+void MX_Nick_(entity fh, entity pass, int status);
+void MX_Nick(string name)
+{
+    if (!matrix_access_token) return;
+    entity pass = new_pure(mx);
+    pass.message = name;
+    url_single_fopen(
+        sprintf("%s/_matrix/client/r0/profile/%s/displayname?access_token=%s", autocvar_matrix_server, matrix_user, matrix_access_token),
+        FILE_WRITE,
+        MX_Nick_,
+        pass
+    );
+}
+void MX_Nick_(entity fh, entity pass, int status)
+{
+    switch (status) {
+        case URL_READY_CANWRITE: {
+            fh.url_verb = "PUT";
+            fh.url_content_type = "application/json";
+            url_fputs(fh, sprintf("{\"displayname\": \"%s\"}", pass.message));
+            remove(pass);
+            url_fclose(fh);
+            break;
+        }
+    }
+}
+
+
+void MX_Messages_(entity fh, entity pass, int status);
+void MX_Messages(string from)
+{
+    if (!matrix_access_token) return;
+    string s = sprintf("%s/_matrix/client/r0/events?room_id=%s&limit=50&timeout=30000&from=%s&access_token=%s", autocvar_matrix_server, matrix_room, from, matrix_access_token);
+    url_single_fopen(
+        s,
+        FILE_READ,
+        MX_Messages_,
+        NULL
+    );
+}
+void MX_Messages_(entity fh, entity pass, int status)
+{
+    switch (status) {
+        default: {
+            LOG_WARNINGF("status: %d", status);
+            break;
+        }
+        case URL_READY_CLOSED: break;
+        case URL_READY_CANREAD: {
+            string json = "";
+            for (string s; (s = url_fgets(fh)); ) { json = strcat(json, s, "\n"); }
+            url_fclose(fh);
+            int buf = json_parse(json, _json_parse_object);
+            EXPECT_NE(-1, buf);
+            for (int i = 0, n = stof(json_get(buf, "chunk.length")); i < n; ++i) {
+                MX_Handle(buf, sprintf("chunk.%d", i));
+            }
+            MX_Messages(json_get(buf, "end"));
+            break;
+        }
+    }
+}
+
+
+void MX_Sync_(entity fh, entity pass, int status);
+void MX_Sync(string since)
+{
+    if (!matrix_access_token) return;
+    string s = strcat(autocvar_matrix_server, "/_matrix/client/r0/sync?");
+    if (since) {
+        s = strcat(s,
+            "since=", since, "&",
+            "timeout=30000&",
+            sprintf("filter={\"account_data\":{\"types\":[]},\"presence\":{\"types\":[]},\"room\":{\"rooms\":[\"%s\"]}}&", matrix_room)
+        );
+    } else {
+        s = strcat(s,
+            "timeout=0&",
+            "filter={\"account_data\":{\"types\":[]},\"presence\":{\"types\":[]},\"room\":{\"rooms\":[]}}&"
+        );
+    }
+    s = strcat(s, "access_token=", matrix_access_token);
+    url_single_fopen(s, FILE_READ, MX_Sync_, NULL);
+}
+void MX_Sync_(entity fh, entity pass, int status)
+{
+    switch (status) {
+        default: {
+            LOG_WARNINGF("status: %d", status);
+            break;
+        }
+        case URL_READY_CLOSED: break;
+        case URL_READY_CANREAD: {
+            string json = "";
+            for (string s; (s = url_fgets(fh)); ) { json = strcat(json, s, "\n"); }
+            url_fclose(fh);
+            int buf = json_parse(json, _json_parse_object);
+            EXPECT_NE(-1, buf);
+            string arr = sprintf("rooms.join.%s.timeline.events", matrix_room);
+            for (int i = 0, n = stof(json_get(buf, sprintf("%s.length", arr))); i < n; ++i) {
+                MX_Handle(buf, sprintf("%s.%d", arr, i));
+            }
+            MX_Sync(json_get(buf, "next_batch"));
+            break;
+        }
+    }
+}
+
+
+void MX_JLF_(entity fh, entity pass, int status);
+void MX_Join(string room)
+{
+    if (!matrix_access_token) return;
+    url_single_fopen(
+        sprintf("%s/_matrix/client/r0/rooms/%s/join?access_token=%s", autocvar_matrix_server, matrix_room, matrix_access_token),
+        FILE_WRITE,
+        MX_JLF_,
+        NULL
+    );
+}
+void MX_Leave(string room)
+{
+    if (!matrix_access_token) return;
+    url_single_fopen(
+        sprintf("%s/_matrix/client/r0/rooms/%s/leave?access_token=%s", autocvar_matrix_server, matrix_room, matrix_access_token),
+        FILE_WRITE,
+        MX_JLF_,
+        NULL
+    );
+}
+void MX_Forget(string room)
+{
+    if (!matrix_access_token) return;
+    url_single_fopen(
+        sprintf("%s/_matrix/client/r0/rooms/%s/forget?access_token=%s", autocvar_matrix_server, matrix_room, matrix_access_token),
+        FILE_WRITE,
+        MX_JLF_,
+        NULL
+    );
+}
+void MX_JLF_(entity fh, entity pass, int status)
+{
+    switch (status) {
+        case URL_READY_CANWRITE: {
+            fh.url_content_type = "application/json";
+            url_fputs(fh, sprintf("{}", pass.message));
+            url_fclose(fh);
+            break;
+        }
+    }
+}
+
+
+void MX_Typing_(entity fh, entity pass, int status);
+void MX_Typing(bool state)
+{
+    if (!matrix_access_token) return;
+    entity pass = new_pure(mx);
+    pass.message = state ? "true" : "false";
+    url_single_fopen(
+        sprintf("%s/_matrix/client/r0/rooms/%s/typing/%s?access_token=%s", autocvar_matrix_server, matrix_room, matrix_user, matrix_access_token),
+        FILE_WRITE,
+        MX_Typing_,
+        pass
+    );
+}
+void MX_Typing_(entity fh, entity pass, int status)
+{
+    switch (status) {
+        case URL_READY_CANWRITE: {
+            fh.url_verb = "PUT";
+            fh.url_content_type = "application/json";
+            url_fputs(fh, sprintf("{\"typing\": %s, \"timeout\": 30000}", pass.message));
+            remove(pass);
+            url_fclose(fh);
+            break;
+        }
+    }
+}
+
+
+void MX_Say_(entity fh, entity pass, int status);
+void MX_Say(string body)
+{
+    if (!matrix_access_token) return;
+    static int txnid;
+    entity pass = new_pure(mx);
+    pass.message = strzone(body);
+    url_single_fopen(
+        sprintf("%s/_matrix/client/r0/rooms/%s/send/m.room.message/%d?access_token=%s", autocvar_matrix_server, matrix_room, ++txnid, matrix_access_token),
+        FILE_WRITE,
+        MX_Say_,
+        pass
+    );
+}
+void MX_Say_(entity fh, entity pass, int status)
+{
+    switch (status) {
+        case URL_READY_CANWRITE: {
+            fh.url_verb = "PUT";
+            fh.url_content_type = "application/json";
+            url_fputs(fh, sprintf("{\"msgtype\": \"m.text\", \"body\": \"%s\"}", pass.message));
+            strunzone(pass.message); remove(pass);
+            url_fclose(fh);
+            break;
+        }
+    }
+}
diff --git a/qcsrc/lib/matrix/matrix.qh b/qcsrc/lib/matrix/matrix.qh
new file mode 100644 (file)
index 0000000..076d8a2
--- /dev/null
@@ -0,0 +1,17 @@
+#pragma once
+
+string autocvar_matrix_server = "http://matrix.org";
+string matrix_user;
+string matrix_access_token;
+string matrix_room;
+
+void MX_Messages(string from);
+void MX_Nick(string name);
+void MX_Join(string room);
+void MX_Sync(string since);
+void MX_Typing(bool state);
+void MX_Say(string body);
+void MX_Leave(string room);
+void MX_Forget(string room);
+
+var void(int buf, string ancestor) MX_Handle;
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 b2b1419abe5efa6cb77fdaed91f6e0bc0e8f06f9..fd6ca20365000cc0fa7553e57b560823452eec24 100644 (file)
@@ -50,10 +50,10 @@ entity __spawn(string _classname, string _sourceLoc, bool pure)
        if (pure) {
                make_pure(this);
                #ifdef CSQC
-               setorigin(this, '0 0 10000');
+               setorigin(this, (world.mins + world.maxs) * 0.5);
                #endif
                #ifdef SVQC
-        setorigin(this, '0 0 -10000');
+        setorigin(this, (world.mins + world.maxs) * 0.5);
         #endif
        }
        return this;
@@ -175,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 99bea5be7cd7ca5b0b8bc02963e4398d9ca0755c..31d7d07c80db730f1db4f376a71c3f6f6dae1de9 100644 (file)
@@ -2,33 +2,45 @@
 
 // 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: propagate SELFPARAM()
+#if 1
+    #undef self
+    #define self (this, self)
 #endif
 
-// Step 3: const self
+// 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
+
+.void(entity this) selftouch;
+void touch_self() { SELFPARAM(); this.selftouch(this); }
+#define settouch(e, f) (e.touch = touch_self, e.selftouch = f)
+
+.void(entity this) selfuse;
+void use_self() { SELFPARAM(); this.selfuse(this); }
+#define setuse(e, f) (e.use = use_self, e.selfuse = f)
+
+.void(entity this) selfthink;
+void think_self() { SELFPARAM(); this.selfthink(this); }
+#define setthink(e, f) (e.think = think_self, e.selfthink = f)
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 \
                        { \
index 47a8175cac598554b3f2965a7dfc83db5429d2f5..384188091d0c4b0c92917bacafd3253707be3fe6 100644 (file)
@@ -281,16 +281,24 @@ void buf_save(float buf, string pFilename)
 
 /**
  * converts a number to a string with the indicated number of decimals
- * works for up to 10 decimals!
  */
 string ftos_decimals(float number, int decimals)
 {
        // inhibit stupid negative zero
        if (number == 0) number = 0;
-       // we have sprintf...
        return sprintf("%.*f", decimals, number);
 }
 
+/**
+ * converts a number to a string with the minimum number of decimals
+ */
+string ftos_mindecimals(float number)
+{
+       // inhibit stupid negative zero
+       if (number == 0) number = 0;
+       return sprintf("%.7g", number);
+}
+
 int vercmp_recursive(string v1, string v2)
 {
        int dot1 = strstrofs(v1, ".", 0);
index af00f979ca0175dd8a5316e64525763b819adbf4..d05ae28cd903b76edc4770204b142d5f8689c589 100644 (file)
@@ -46,19 +46,19 @@ bool RUN_ALL_TESTS();
 #define EXPECT_FALSE(condition) EXPECT_EQ(false, condition)
 #define ASSERT_FALSE(condition) ASSERT_EQ(false, condition)
 
-#define EXPECT_NE(val1, val2) EXPECT_TRUE(val1 != val2)
+#define EXPECT_NE(val1, val2) EXPECT_TRUE((val1) != (val2))
 #define ASSERT_NE(val1, val2) _TEST_ASSERT(EXPECT_NE(val1, val2))
 
-#define EXPECT_LT(val1, val2) EXPECT_TRUE(val1 < val2)
+#define EXPECT_LT(val1, val2) EXPECT_TRUE((val1) < (val2))
 #define ASSERT_LT(val1, val2) _TEST_ASSERT(EXPECT_LT(val1, val2))
 
-#define EXPECT_LE(val1, val2) EXPECT_TRUE(val1 <= val2)
+#define EXPECT_LE(val1, val2) EXPECT_TRUE((val1) <= (val2))
 #define ASSERT_LE(val1, val2) _TEST_ASSERT(EXPECT_LE(val1, val2))
 
-#define EXPECT_GT(val1, val2) EXPECT_TRUE(val1 > val2)
+#define EXPECT_GT(val1, val2) EXPECT_TRUE((val1) > (val2))
 #define ASSERT_GT(val1, val2) _TEST_ASSERT(EXPECT_GT(val1, val2))
 
-#define EXPECT_GE(val1, val2) EXPECT_TRUE(val1 >= val2)
+#define EXPECT_GE(val1, val2) EXPECT_TRUE((val1) >= (val2))
 #define ASSERT_GE(val1, val2) _TEST_ASSERT(EXPECT_GE(val1, val2))
 
 #define EXPECT_NO_FATAL_FAILURE(statement) EXPECT_NO_FATAL_FAILURE_(statement, { })
index 80145d8b84c15142b97be992968e38601e1f7c5f..c4c700a72d6b8341e9e561af642d638853c78e9d 100644 (file)
@@ -7,6 +7,8 @@ const float URL_FH_STDOUT = -2;
 
 // URLs
 .string url_url;
+.string url_content_type;
+.string url_verb;
 .float url_wbuf;
 .float url_wbufpos;
 .float url_rbuf;
@@ -96,6 +98,8 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                // create a writing end that does nothing yet
                                e = new_pure(url_single_fopen_file);
                                e.url_url = strzone(url);
+                               e.url_content_type = "text/plain";
+                               e.url_verb = "";
                                e.url_fh = URL_FH_CURL;
                                e.url_wbuf = buf_create();
                                if (e.url_wbuf < 0)
@@ -231,7 +235,7 @@ void url_fclose(entity e)
                        }
 
                        // POST the data
-                       if (!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, "text/plain", "", e.url_wbuf, 0))
+                       if (!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, e.url_content_type, e.url_verb, e.url_wbuf, 0))
                        {
                                LOG_INFO("url_fclose: failure in crypto_uri_postbuf\n");
                                e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
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 7444a5ded2af5d86ad9ab09804a2be013953b4c8..2b860d6f4311283a905d8d48c760402513ba06e6 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;
@@ -517,116 +518,116 @@ float WarpZone_Projectile_Touch()
 
 #ifdef SVQC
 
-void WarpZone_InitStep_FindOriginTarget()
-{SELFPARAM();
-       if(self.killtarget != "")
+void WarpZone_InitStep_FindOriginTarget(entity this)
+{
+       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 == "")
+void WarpZonePosition_InitStep_FindTarget(entity this)
+{
+       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();
+void WarpZoneCamera_InitStep_FindTarget(entity this)
+{
        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()
-{SELFPARAM();
+void WarpZone_InitStep_UpdateTransform(entity this)
+{
        vector org, ang, norm, point;
        float area;
        vector tri, a, b, c, n;
        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,68 +677,68 @@ 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;
+void WarpZone_InitStep_ClearTarget(entity this)
+{
+       if(this.enemy)
+               this.enemy.enemy = world;
+       this.enemy = world;
 }
 
 entity warpzone_first; .entity warpzone_next;
-void WarpZone_InitStep_FindTarget()
-{SELFPARAM();
+void WarpZone_InitStep_FindTarget(entity this)
+{
        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)
+void WarpZone_InitStep_FinalizeTransform(entity this)
+{
+       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,88 +766,85 @@ 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();
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               WarpZone_InitStep_ClearTarget();
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               WarpZone_InitStep_FindTarget();
-       for(setself(warpzone_camera_first); self; setself(self.warpzone_next))
-               WarpZoneCamera_InitStep_FindTarget();
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               WarpZone_InitStep_FinalizeTransform();
-       setself(this);
+{
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               WarpZone_InitStep_ClearTarget(e);
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               WarpZone_InitStep_FindTarget(e);
+       for(entity e = warpzone_camera_first; e; e = e.warpzone_next)
+               WarpZoneCamera_InitStep_FindTarget(e);
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               WarpZone_InitStep_FinalizeTransform(e);
 }
 
 void WarpZone_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_InitStep_UpdateTransform();
-               setself(self.enemy);
-               WarpZone_InitStep_UpdateTransform();
-               setself(this);
-               WarpZone_InitStep_FinalizeTransform();
-               setself(self.enemy);
-               WarpZone_InitStep_FinalizeTransform();
-               setself(this);
-               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;
-       }
-       self.nextthink = time;
+               WarpZone_InitStep_UpdateTransform(this);
+               WarpZone_InitStep_UpdateTransform(this.enemy);
+               WarpZone_InitStep_FinalizeTransform(this);
+               WarpZone_InitStep_FinalizeTransform(this.enemy);
+               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;
+       }
+       this.nextthink = time;
 }
 
 void WarpZone_StartFrame()
@@ -855,20 +853,19 @@ void WarpZone_StartFrame()
        if (!warpzone_initialized)
        {
                warpzone_initialized = true;
-               for (setself(warpzone_first); self; setself(self.warpzone_next))
-                       WarpZone_InitStep_FindOriginTarget();
-               for (setself(warpzone_position_first); self; setself(self.warpzone_next))
-                       WarpZonePosition_InitStep_FindTarget();
-               for (setself(warpzone_first); self; setself(self.warpzone_next))
-                       WarpZone_InitStep_UpdateTransform();
-               setself(this);
+               for(entity e = warpzone_first; e; e = e.warpzone_next)
+                       WarpZone_InitStep_FindOriginTarget(e);
+               for(entity e = warpzone_position_first; e; e = e.warpzone_next)
+                       WarpZonePosition_InitStep_FindTarget(e);
+               for(entity e = warpzone_first; e; e = e.warpzone_next)
+                       WarpZone_InitStep_UpdateTransform(e);
                WarpZones_Reconnect();
                WarpZone_PostInitialize_Callback();
        }
 
        entity oldother = other;
 
-       FOREACH_ENTITY(true,
+       FOREACH_ENTITY(!is_pure(it),
        {
                if(warpzone_warpzones_exist)
                        WarpZone_StoreProjectileData(it);
@@ -911,32 +908,29 @@ bool visible_to_some_client(entity ent)
 }
 void trigger_warpzone_reconnect_use()
 {SELFPARAM();
-       entity e;
-       e = self;
        // NOTE: this matches for target, not targetname, but of course
        // targetname must be set too on the other entities
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && (visible_to_some_client(self) || visible_to_some_client(self.enemy))));
-       for(setself(warpzone_camera_first); self; setself(self.warpzone_next))
-               self.warpzone_reconnecting = ((e.target == "" || self.target == e.target) && !((e.spawnflags & 1) && visible_to_some_client(self)));
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               if(self.warpzone_reconnecting)
-                       WarpZone_InitStep_ClearTarget();
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               if(self.warpzone_reconnecting)
-                       WarpZone_InitStep_FindTarget();
-       for(setself(warpzone_camera_first); self; setself(self.warpzone_next))
-               if(self.warpzone_reconnecting)
-                       WarpZoneCamera_InitStep_FindTarget();
-       for(setself(warpzone_first); self; setself(self.warpzone_next))
-               if(self.warpzone_reconnecting || self.enemy.warpzone_reconnecting)
-                       WarpZone_InitStep_FinalizeTransform();
-       setself(e);
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               e.warpzone_reconnecting = ((this.target == "" || e.target == this.target) && !((this.spawnflags & 1) && (visible_to_some_client(e) || visible_to_some_client(e.enemy))));
+       for(entity e = warpzone_camera_first; e; e = e.warpzone_next)
+               e.warpzone_reconnecting = ((this.target == "" || e.target == this.target) && !((this.spawnflags & 1) && visible_to_some_client(e)));
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               if(e.warpzone_reconnecting)
+                       WarpZone_InitStep_ClearTarget(e);
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               if(e.warpzone_reconnecting)
+                       WarpZone_InitStep_FindTarget(e);
+       for(entity e = warpzone_camera_first; e; e = e.warpzone_next)
+               if(e.warpzone_reconnecting)
+                       WarpZoneCamera_InitStep_FindTarget(e);
+       for(entity e = warpzone_first; e; e = e.warpzone_next)
+               if(e.warpzone_reconnecting || e.enemy.warpzone_reconnecting)
+                       WarpZone_InitStep_FinalizeTransform(e);
 }
 
 spawnfunc(trigger_warpzone_reconnect)
 {
-       self.use = trigger_warpzone_reconnect_use;
+       this.use = trigger_warpzone_reconnect_use;
 }
 
 spawnfunc(target_warpzone_reconnect)
@@ -944,15 +938,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 = "";
 }
index 589808ec117bdeb2cf8924137193e0c4bc34766d..8fdd71d84cfc8388c4d0d472aa77c9f047ca3f55 100644 (file)
@@ -1,4 +1,5 @@
 // generated file; do not modify
 #include "draw.qc"
 #include "item.qc"
+#include "matrix.qc"
 #include "menu.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
                {
diff --git a/qcsrc/menu/matrix.qc b/qcsrc/menu/matrix.qc
new file mode 100644 (file)
index 0000000..b0c4ec8
--- /dev/null
@@ -0,0 +1,26 @@
+var void MX_Handle(int buf, string ancestor)
+{
+    string type = json_get(buf, strcat(ancestor, ".type"));
+    switch (type) {
+        case "m.typing": {
+            string arr = strcat(ancestor, ".content.user_ids");
+            for (int i = 0, n = stof(json_get(buf, sprintf("%s.length", arr))); i < n; ++i) {
+                string s = json_get(buf, sprintf("%s.%d", arr, i));
+                print("\{1}", s, " is typing...\n");
+            }
+            break;
+        }
+        case "m.room.message": {
+            string msgtype = json_get(buf, strcat(ancestor, ".content.msgtype"));
+            switch (msgtype) {
+                case "m.text": {
+                    string sender = json_get(buf, strcat(ancestor, ".sender"));
+                    string body = json_get(buf, strcat(ancestor, ".content.body"));
+                    if (body) print("\{1}", sender, ": ", body, "\n");
+                    break;
+                }
+            }
+            break;
+        }
+    }
+}
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)
index 21743b9a1506801ea9a4a86bce1843c706d85447..6015e48bad45369c9b350e4eefe38d29202f2e8a 100644 (file)
@@ -77,9 +77,9 @@ void XonoticCheckBox_saveCvars(entity me)
                return;
 
        if(me.checked)
-               cvar_set(me.cvarName, ftos(me.yesValue));
+               cvar_set(me.cvarName, ftos_mindecimals(me.yesValue));
        else
-               cvar_set(me.cvarName, ftos(me.noValue));
+               cvar_set(me.cvarName, ftos_mindecimals(me.noValue));
 
        CheckSendCvars(me, me.cvarName);
 }
index c158ebabfca0309288fbc2f1537434b450bc2bba..ac305b83258638cd4352305a7071d338a5d85b3d 100644 (file)
@@ -11,6 +11,8 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
 
        DIALOG_HUDPANEL_COMMON();
 
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_combined", _("Combine health and armor")));
        me.TR(me);
                me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar")));
        me.TR(me);
index 68ffe79ea56546b2139ddfe6a18b8f5ac213865a..495047c5fca1788ff6cb4e21b338fd0c8b0e9878 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticHUDHealthArmorDialog, XonoticRootDialog)
        ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel"))
        ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4)
-       ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15)
+       ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 16)
        ATTRIB(XonoticHUDHealthArmorDialog, columns, float, 4)
        ATTRIB(XonoticHUDHealthArmorDialog, name, string, "HUDhealtharmor")
        ATTRIB(XonoticHUDHealthArmorDialog, requiresConnection, float, true)
index 1b0666c75afd59f3c4ad86f10ad13a034bf6b709..0f5c5a4af225bf2dd34cf7c9f31b7975d9076159 100644 (file)
@@ -135,6 +135,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticCheckBox_T(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"),
                        _("Use high resolution lightmaps, which will look pretty but use up some extra video memory (default: enabled)")));
+                       e.applyButton = effectsApplyButton;
                me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_deluxemapping", _("Deluxe mapping"),
                        _("Use per-pixel lighting effects (default: enabled)")));
                        setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
index 1ec53c623eebe6bec086520cf9e52b2c7f788958..9320a6ebf2101603fe79e478d3b1abf347f8fe7e 100644 (file)
@@ -86,6 +86,7 @@ void XonoticVideoSettingsTab_fill(entity me)
                        e.addValue(e, _("4x"), "4");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "r_viewfbo", 0, 0);
+                       e.applyButton = videoApplyButton;
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
                        setDependent(e, "vid_samples", 1, 1);
@@ -154,6 +155,7 @@ void XonoticVideoSettingsTab_fill(entity me)
                        _("Make the CPU wait for the GPU to finish each frame, can help with some strange input or video lag on some machines (default: disabled)")));
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
+                       e.applyButton = videoApplyButton;
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"),
index fc4228cf98b0503b55f013a15df217d1909978f5..c8e057a641416aa922a9760b6cbaafa3072b881e 100644 (file)
@@ -58,7 +58,7 @@ void XonoticSlider_saveCvars(entity me)
        if (!me.cvarName)
                return;
 
-       cvar_set(me.cvarName, ftos(me.value));
+       cvar_set(me.cvarName, ftos_mindecimals(me.value));
 
        CheckSendCvars(me, me.cvarName);
 }
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)
index d502c48ed35b35c8f28c2806364bb0fd13db00bb..9d0531ac62c5a9bca1211a1bfb71a29bf7797a0b 100644 (file)
@@ -15,6 +15,7 @@
 #include "ipban.qc"
 #include "item_key.qc"
 #include "mapvoting.qc"
+#include "matrix.qc"
 #include "miscfunctions.qc"
 #include "playerdemo.qc"
 #include "portals.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)
index 893bb647859e8da75b80b26b05e028c59e1ab530..4a395574aa515e257cae3d950305c99a085641b6 100644 (file)
@@ -331,6 +331,7 @@ int autocvar_sv_clientcommand_antispam_count;
 bool autocvar_sv_curl_serverpackages_auto;
 bool autocvar_sv_db_saveasdump;
 bool autocvar_sv_defaultcharacter;
+bool autocvar_sv_defaultcharacterskin;
 string autocvar_sv_defaultplayercolors;
 string autocvar_sv_defaultplayermodel;
 string autocvar_sv_defaultplayermodel_blue;
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;
 }
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 184710818c1aac266a32e620695cd97fbbd66b1f..225ae859754952e1ca5b6e411bb6ca61d2f84084 100644 (file)
@@ -32,6 +32,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
        w = new(waypoint);
        w.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        w.wpflags = f;
+       w.solid = SOLID_TRIGGER;
        setorigin(w, (m1 + m2) * 0.5);
        setsize(w, m1 - w.origin, m2 - w.origin);
        if (vlen(w.size) > 0)
index 7dab5ade00d9ade8b4fc8cd717fca0a531c85c47..e13678dce5995e6381c3dd248cdb275aecc174a8 100644 (file)
@@ -97,15 +97,15 @@ 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))) \
                break
 
 float num_autoscreenshot;
-void info_autoscreenshot_findtarget()
-{SELFPARAM();
+void info_autoscreenshot_findtarget(entity this)
+{
        entity e;
        e = find(world, targetname, self.target);
        if(!e)
@@ -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)
                                        {
@@ -696,7 +696,7 @@ float CheatCommand(float argc)
                        setself(new(cheattriggerteleport));
                        setorigin(self, self.origin);
                        self.target = argv(1);
-                       teleport_findtarget();
+                       teleport_findtarget(self);
                        if(!wasfreed(self))
                        {
                                Simple_TeleportPlayer(self, this);
@@ -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..ffbb55087bef4ac48a98e36c8d9402fc9c7eb64c 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() {
@@ -370,6 +371,19 @@ void FixPlayermodel(entity player)
                        defaultmodel = substring(defaultmodel, 0, i);
                }
        }
+       if(autocvar_sv_defaultcharacterskin && !defaultskin)
+       {
+               if(teamplay)
+               {
+                       string s = Static_Team_ColorName_Lower(player.team);
+                       if (s != "neutral")
+                               defaultskin = cvar(strcat("sv_defaultplayerskin_", s));
+               }
+
+               if(!defaultskin)
+                       defaultskin = autocvar_sv_defaultplayerskin;
+       }
+
        MUTATOR_CALLHOOK(FixPlayermodel, defaultmodel, defaultskin);
        defaultmodel = ret_string;
        defaultskin = ret_int;
@@ -400,8 +414,16 @@ void FixPlayermodel(entity player)
                        chmdl = true;
                }
 
-               oldskin = player.skin;
-               player.skin = stof(player.playerskin);
+               if(!autocvar_sv_defaultcharacterskin)
+               {
+                       oldskin = player.skin;
+                       player.skin = stof(player.playerskin);
+               }
+               else
+               {
+                       oldskin = player.skin;
+                       player.skin = defaultskin;
+               }
        }
 
        if(chmdl || oldskin != player.skin) // model or skin has changed
@@ -568,7 +590,8 @@ void PutClientInServer()
                this.oldorigin = this.origin;
                this.prevorigin = this.origin;
                this.lastteleporttime = time; // prevent insane speeds due to changing origin
-        this.hud = HUD_NORMAL;
+               this.conveyor = NULL; // prevent conveyors at the previous location from moving a freshly spawned player
+               this.hud = HUD_NORMAL;
 
                this.event_damage = PlayerDamage;
 
@@ -607,7 +630,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 +694,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 +716,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 +740,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 +782,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 +818,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 +869,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 +890,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 +916,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 +956,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 +1008,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 +1166,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 +1199,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 +1216,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 +1228,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 +1280,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 +1500,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 +1518,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 +1540,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 +1655,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 +1671,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 +1700,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 +1731,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 +1754,7 @@ bool SpectatePrev()
                }
        }
 
-       SetSpectatee(self, other);
+       SetSpectatee(this, other);
        return SpectateSet();
 }
 
@@ -1745,51 +1768,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 +1863,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 +1958,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 +2007,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 +2026,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 +2051,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 +2072,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;
+                                       this.impulse = CHIMPULSE_SPEEDRUN.impulse;
                                }
-                               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;
-                               }
-                               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 +2416,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 +2456,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..8aaf68cda69dac1753364cfe1e84cd07c10129c3 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;
@@ -657,6 +657,12 @@ void MoveToTeam(entity client, int team_colour, int type)
        LogTeamchange(client.playerid, client.team, type);
 }
 
+/** print(), but only print if the server is not local */
+void dedicated_print(string input)
+{
+       if (server_is_dedicated) print(input);
+}
+
 /**
  * message "": do not say, just test flood control
  * return value:
@@ -664,20 +670,14 @@ void MoveToTeam(entity client, int team_colour, int type)
  *   0 = reject
  *  -1 = fake accept
  */
-int Say(entity source, float teamsay, entity privatesay, string msgin, bool floodcontrol)
+int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol)
 {
-       string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, colorprefix;
-       float flood;
-       var .float flood_field;
-       float ret;
-       string privatemsgprefix = string_null; float privatemsgprefixlen = 0;
-
-       if(!teamsay && !privatesay)
-               if(substring(msgin, 0, 1) == " ")
-                       msgin = substring(msgin, 1, strlen(msgin) - 1); // work around DP say bug (say_team does not have this!)
+       if (!teamsay && !privatesay) if (substring(msgin, 0, 1) == " ")
+        msgin = substring(msgin, 1, -1); // work around DP say bug (say_team does not have this!)
 
        msgin = formatmessage(msgin);
 
+    string colorstr;
        if (!IS_PLAYER(source))
                colorstr = "^0"; // black for spectators
        else if(teamplay)
@@ -691,6 +691,11 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
        if(intermission_running)
                teamsay = false;
 
+    if (!source) {
+               colorstr = "";
+               teamsay = false;
+    }
+
        if(msgin != "")
                msgin = trigger_magicear_processmessage_forallears(source, teamsay, privatesay, msgin);
 
@@ -705,18 +710,18 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
        }
        */
 
-       if(autocvar_g_chat_teamcolors)
-               namestr = playername(source);
-       else
-               namestr = source.netname;
+    string namestr = "";
+    if (source)
+        namestr = autocvar_g_chat_teamcolors ? playername(source) : source.netname;
 
-       if(strdecolorize(namestr) == namestr)
-               colorprefix = "^3";
-       else
-               colorprefix = "^7";
+    string colorprefix = (strdecolorize(namestr) == namestr) ? "^3" : "^7";
 
-       if(msgin != "")
-       {
+    string msgstr, cmsgstr;
+    string privatemsgprefix = string_null;
+    int privatemsgprefixlen = 0;
+       if (msgin == "") {
+        msgstr = cmsgstr = "";
+       } else {
                if(privatesay)
                {
                        msgstr = strcat("\{1}\{13}* ", colorprefix, namestr, "^3 tells you: ^7");
@@ -750,23 +755,22 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
                                msgin = strreplace("/me", strcat(colorprefix, namestr), msgin);
                                msgstr = strcat("\{1}^4* ", "^7", msgin);
                        }
-                       else
-                               msgstr = strcat("\{1}", colorprefix, namestr, "^7: ", msgin);
+                       else {
+                msgstr = "\{1}";
+                msgstr = strcat(msgstr, (namestr != "") ? strcat(colorprefix, namestr, "^7: ") : "^7");
+                msgstr = strcat(msgstr, msgin);
+            }
                        cmsgstr = "";
                }
                msgstr = strcat(strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint
        }
-       else
-       {
-               msgstr = cmsgstr = "";
-       }
 
-       fullmsgstr = msgstr;
-       fullcmsgstr = cmsgstr;
+       string fullmsgstr = msgstr;
+       string fullcmsgstr = cmsgstr;
 
        // FLOOD CONTROL
-       flood = 0;
-       flood_field = floodcontrol_chat;
+       int flood = 0;
+       var .float flood_field = floodcontrol_chat;
        if(floodcontrol)
        {
                float flood_spl;
@@ -838,6 +842,7 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
                        source.(flood_field) = flood = 0;
        }
 
+    string sourcemsgstr, sourcecmsgstr;
        if(flood == 2) // cannot happen for empty msgstr
        {
                if(autocvar_g_chat_flood_notify_flooder)
@@ -858,8 +863,7 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
                sourcecmsgstr = cmsgstr;
        }
 
-       if(!privatesay)
-       if (!IS_PLAYER(source))
+       if (!privatesay && source && !IS_PLAYER(source))
        {
                if (!intermission_running)
                        if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover)))
@@ -873,6 +877,7 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
        if(privatesay)
                sourcemsgstr = strcat(privatemsgprefix, substring(sourcemsgstr, privatemsgprefixlen, -1));
 
+    int ret;
        if(source.muted)
        {
                // always fake the message
@@ -913,7 +918,7 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
                {
                        sprint(source, sourcemsgstr);
                        dedicated_print(msgstr); // send to server console too
-                       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && it.active_minigame == source.active_minigame, LAMBDA(sprint(it, msgstr)));
+                       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && it.active_minigame == source.active_minigame, sprint(it, msgstr));
                }
                else if(teamsay > 0) // team message, only sent to team mates
                {
@@ -921,26 +926,27 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
                        dedicated_print(msgstr); // send to server console too
                        if(sourcecmsgstr != "")
                                centerprint(source, sourcecmsgstr);
-                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source && it.team == source.team, LAMBDA(
+                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source && it.team == source.team, {
                                sprint(it, msgstr);
                                if(cmsgstr != "")
                                        centerprint(it, cmsgstr);
-                       ));
+                       });
                }
                else if(teamsay < 0) // spectator message, only sent to spectators
                {
                        sprint(source, sourcemsgstr);
                        dedicated_print(msgstr); // send to server console too
-                       FOREACH_CLIENT(!IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source, LAMBDA(sprint(it, msgstr)));
-               }
-               else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players
-               {
-                       sprint(source, sourcemsgstr);
-                       dedicated_print(msgstr); // send to server console too
-                       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source, LAMBDA(sprint(it, msgstr)));
+                       FOREACH_CLIENT(!IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source, sprint(it, msgstr));
                }
                else
-                       bprint(msgstr); // entirely normal message, sent to all players -- bprint sends to server console too.
+               {
+            if (source) {
+                sprint(source, sourcemsgstr);
+                dedicated_print(msgstr); // send to server console too
+                MX_Say(strcat(playername(source), "^7: ", msgin));
+            }
+            FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source, sprint(it, msgstr));
+        }
        }
 
        return ret;
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 37177326f077e888cb864140679891086f3a6ff9..5e9273f7cd43702f62592c461ea8ecabefe9ab66 100644 (file)
@@ -36,12 +36,13 @@ flags:
 */
 void dynlight_think()
 {
+    SELFPARAM();
        if(!self.owner)
                remove(self);
 
        self.nextthink = time + 0.1;
 }
-void dynlight_find_aiment()
+void dynlight_find_aiment(entity this)
 {
        entity targ;
        if (!self.target)
@@ -57,7 +58,7 @@ void dynlight_find_aiment()
        self.think = dynlight_think;
        self.nextthink = time + 0.1;
 }
-void dynlight_find_path()
+void dynlight_find_path(entity this)
 {
        entity targ;
        if (!self.target)
@@ -69,7 +70,7 @@ void dynlight_find_path()
        self.think = train_next;
        self.nextthink = time + 0.1;
 }
-void dynlight_find_target()
+void dynlight_find_target(entity this)
 {
        entity targ;
        if (!self.target)
@@ -83,6 +84,7 @@ void dynlight_find_target()
 }
 void dynlight_use()
 {
+    SELFPARAM();
        if (self.light_lev == 0)
                self.light_lev = self.lefty;
        else
index 6612b837c1542ff8b7991051cf4d54f868f5ceae..baca561786a00bcf9da35e7883100fd622242951 100644 (file)
@@ -51,8 +51,8 @@ void g_clientmodel_use()
        g_clientmodel_setcolormaptoactivator();
 }
 
-void g_model_dropbyspawnflags()
-{SELFPARAM();
+void g_model_dropbyspawnflags(entity this)
+{
        if((self.spawnflags & 3) == 1) // ALIGN_ORIGIN
        {
                traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
@@ -70,11 +70,11 @@ void g_model_dropbyspawnflags()
        }
 }
 
-void g_clientmodel_dropbyspawnflags()
-{SELFPARAM();
+void g_clientmodel_dropbyspawnflags(entity this)
+{
        vector o0;
        o0 = self.origin;
-       g_model_dropbyspawnflags();
+       g_model_dropbyspawnflags(self);
        if(self.origin != o0)
                self.SendFlags |= 2;
 }
index 97450cd4ca107333c5255e9e024d26f4bc6f5a13..a2cbc5a431e4d2fd9ad6bb3ed462ac9d4c5dffc5 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();
+void LODmodel_attach(entity this)
+{
        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 90378d510d07bec60f75228bc7021c02e7fd6651..49bcd8904f86e7bf07a9e791d9835a4ef145aa4f 100644 (file)
@@ -143,7 +143,7 @@ float LOD_customize();
 
 void LOD_uncustomize();
 
-void LODmodel_attach();
+void LODmodel_attach(entity this);
 
 void ApplyMinMaxScaleAngles(entity e);
 
index f1154e1b59539c66039e39b3b4373aafd25a2f3f..054e19d7466589c9ae0b3146843b9329d21157b9 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()
 {
@@ -413,6 +413,7 @@ void cvar_changes_init()
                BADCVAR("sv_autotaunt");
                BADCVAR("sv_curl_defaulturl");
                BADCVAR("sv_defaultcharacter");
+               BADCVAR("sv_defaultcharacterskin");
                BADCVAR("sv_defaultplayercolors");
                BADCVAR("sv_defaultplayermodel");
                BADCVAR("sv_defaultplayerskin");
@@ -511,15 +512,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 +528,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)
@@ -562,6 +563,18 @@ void __init_dedicated_server_shutdown() {
        MapInfo_Shutdown();
 }
 
+void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override)
+{
+       if(!autocvar_g_campaign)
+       {
+               if(fraglimit_override >= 0) cvar_set("fraglimit", ftos(fraglimit_override));
+               if(timelimit_override >= 0) cvar_set("timelimit", ftos(timelimit_override));
+               if(leadlimit_override >= 0) cvar_set("leadlimit", ftos(leadlimit_override));
+               if(qualifying_override >= 0) cvar_set("g_race_qualifying_timelimit", ftos(qualifying_override));
+       }
+       limits_are_set = true;
+}
+
 void Map_MarkAsRecent(string m);
 float world_already_spawned;
 void Nagger_Init();
@@ -572,9 +585,8 @@ spawnfunc(worldspawn)
 {
        server_is_dedicated = boolean(stof(cvar_defstring("is_dedicated")));
 
+    bool wantrestart = false;
        {
-               bool wantrestart = false;
-
                if (!server_is_dedicated)
                {
                        // force unloading of server pk3 files when starting a listen server
@@ -718,6 +730,12 @@ spawnfunc(worldspawn)
        readlevelcvars();
        GrappleHookInit();
 
+       if(!limits_are_set)
+               SetLimits(autocvar_fraglimit_override, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
+
+       if(warmup_limit == 0)
+               warmup_limit = (autocvar_timelimit > 0) ? autocvar_timelimit * 60 : autocvar_timelimit;
+
        player_count = 0;
        bot_waypoints_for_items = autocvar_g_waypoints_for_items;
        if(bot_waypoints_for_items == 1)
@@ -849,7 +867,7 @@ spawnfunc(worldspawn)
 
        CheatInit();
 
-       localcmd("\n_sv_hook_gamestart ", GetGametype(), "\n");
+       if (!wantrestart) localcmd("\n_sv_hook_gamestart ", GetGametype(), "\n");
 
        // fill sv_curl_serverpackages from .serverpackage files
        if (autocvar_sv_curl_serverpackages_auto)
@@ -1545,9 +1563,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 +1585,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 cd1cafd36a2fd0a5ca60ab1b011391a8a740c559..5366d0a782129ff2cce3e1064a76c14fb877f337 100644 (file)
@@ -10,6 +10,9 @@ const int WINNING_YES = 1; // winner found
 const int WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
 const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
 
+bool limits_are_set = false;
+void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
+
 float WinningCondition_Scores(float limit, float leadlimit);
 void SetWinners(.float field, float value);
 void CheckRules_Player();
diff --git a/qcsrc/server/matrix.qc b/qcsrc/server/matrix.qc
new file mode 100644 (file)
index 0000000..b7d26de
--- /dev/null
@@ -0,0 +1,22 @@
+#include "matrix.qh"
+
+#include "cl_player.qh"
+
+var void MX_Handle(int buf, string ancestor)
+{
+    string type = json_get(buf, strcat(ancestor, ".type"));
+    switch (type) {
+        case "m.room.message": {
+            string msgtype = json_get(buf, strcat(ancestor, ".content.msgtype"));
+            switch (msgtype) {
+                case "m.text": {
+                    string sender = json_get(buf, strcat(ancestor, ".sender"));
+                    string body = json_get(buf, strcat(ancestor, ".content.body"));
+                    if (sender != matrix_user && body) Say(NULL, false, NULL, body, false);
+                    break;
+                }
+            }
+            break;
+        }
+    }
+}
diff --git a/qcsrc/server/matrix.qh b/qcsrc/server/matrix.qh
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
index 65d38c8aa90ec3bb672e3edab877bf61d5422a4e..72747037dee0c8739223fe5f2ca1744351138841 100644 (file)
@@ -851,7 +851,7 @@ void remove_safely(entity e)
     builtin_remove(e);
 }
 
-void InitializeEntity(entity e, void() func, float order)
+void InitializeEntity(entity e, void(entity this) func, float order)
 {
     entity prev, cur;
 
@@ -885,7 +885,7 @@ void InitializeEntity(entity e, void() func, float order)
     }
 }
 void InitializeEntitiesRun()
-{SELFPARAM();
+{
     entity startoflist = initialize_entity_first;
     initialize_entity_first = NULL;
     remove = remove_except_protected;
@@ -899,7 +899,7 @@ void InitializeEntitiesRun()
         e.initialize_entity_order = 0;
        entity next = e.initialize_entity_next;
         e.initialize_entity_next = NULL;
-        var void() func = e.initialize_entity;
+        var void(entity this) func = e.initialize_entity;
         e.initialize_entity = func_null;
         if (e.classname == "initialize_entity")
         {
@@ -910,7 +910,7 @@ void InitializeEntitiesRun()
         //dprint("Delayed initialization: ", e.classname, "\n");
         if (func)
         {
-               WITH(entity, self, e, func());
+               WITHSELF(e, func(e));
         }
         else
         {
@@ -987,8 +987,8 @@ void adaptor_think2use_hittype_splash() // for timed projectile detonation
 }
 
 // deferred dropping
-void DropToFloor_Handler()
-{SELFPARAM();
+void DropToFloor_Handler(entity this)
+{
     builtin_droptofloor();
     self.dropped_origin = self.origin;
 }
index d828d70f900257421daefaa973ceef1581b76b47..634d3fb647185594e04001b18c1b1790ecf17942 100644 (file)
@@ -262,8 +262,6 @@ void readlevelcvars()
 
        warmup_stage = cvar("g_warmup");
        warmup_limit = cvar("g_warmup_limit");
-       if(warmup_limit == 0)
-               warmup_limit = (autocvar_timelimit > 0) ? autocvar_timelimit * 60 : autocvar_timelimit;
        g_warmup_allguns = cvar("g_warmup_allguns");
        g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
 
@@ -357,7 +355,7 @@ const float INITPRIO_SETLOCATION            = 90;
 const float INITPRIO_LINKDOORS                         = 91;
 const float INITPRIO_LAST                              = 99;
 
-.void() initialize_entity;
+.void(entity this) initialize_entity;
 .float initialize_entity_order;
 .entity initialize_entity_next;
 entity initialize_entity_first;
@@ -367,5 +365,5 @@ entity initialize_entity_first;
 
 
 float sound_allowed(float dest, entity e);
-void InitializeEntity(entity e, void() func, float order);
+void InitializeEntity(entity e, void(entity this) func, float order);
 void SetCustomizer(entity e, float() customizer, void() uncustomizer);
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
index ae5166c7c47df6d43a775504f7464faf017c8cd0..34c19d425178a0d9c02e3f844d1aa6edb6730034 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());
                }
        }
 
@@ -147,8 +147,8 @@ void assault_objective_decrease_use()
        }
 }
 
-void assault_setenemytoobjective()
-{SELFPARAM();
+void assault_setenemytoobjective(entity this)
+{
        entity objective;
        for(objective = world; (objective = find(objective, targetname, self.target)); )
        {
@@ -208,9 +208,9 @@ void target_objective_decrease_activate()
        }
 }
 
-void target_objective_decrease_findtarget()
+void target_objective_decrease_findtarget(entity this)
 {
-       assault_setenemytoobjective();
+       assault_setenemytoobjective(this);
 }
 
 void target_assault_roundend_reset(entity this)
@@ -225,8 +225,8 @@ void target_assault_roundend_use()
        self.winning = 1; // round has been won by attackers
 }
 
-void assault_roundstart_use()
-{SELFPARAM();
+void assault_roundstart_use(entity this)
+{
        activator = self;
        SUB_UseTargets();
 
@@ -239,9 +239,14 @@ void assault_roundstart_use()
                        it.team = NUM_TEAM_1;
 
                // Dubbles as teamchange
-               WITH(entity, self, it, turret_respawn());
+               WITHSELF(it, turret_respawn());
        ));
 }
+void assault_roundstart_use_self()
+{
+    SELFPARAM();
+    assault_roundstart_use(this);
+}
 
 void assault_wall_think()
 {SELFPARAM();
@@ -268,7 +273,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 +337,7 @@ int WinningCondition_Assault()
                        }
                        else
                        {
-                               WITH(entity, self, ent, assault_new_round());
+                               WITHSELF(ent, assault_new_round());
                        }
                }
        }
@@ -432,8 +437,8 @@ spawnfunc(target_assault_roundstart)
 
        assault_attacker_team = NUM_TEAM_1;
        self.classname = "target_assault_roundstart";
-       self.use = assault_roundstart_use;
-       self.reset2 = assault_roundstart_use;
+       self.use = assault_roundstart_use_self;
+       self.reset2 = assault_roundstart_use_self;
        InitializeEntity(self, assault_roundstart_use, INITPRIO_FINDTARGET);
 }
 
index c5dedbae705081f573db6757c13c1ed5cc60c61a..072fe90ddee9566093d39bd2de0577a8c7fdc3c1 100644 (file)
@@ -47,7 +47,7 @@ REGISTER_MUTATOR(ca, false)
                EliminatedPlayers_Init(ca_isEliminated);
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, -1, -1);
+               SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, autocvar_timelimit_override, -1);
 
                if (autocvar_g_ca_team_spawns)
                        have_team_spawns = -1; // request team spawns
@@ -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;
@@ -331,7 +331,7 @@ MUTATOR_HOOKFUNCTION(ca, ForbidPlayerScore_Clear)
 MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
 {
     SELFPARAM();
-       if (this.caplayer == 1)
+       if (!IS_DEAD(this))
                ca_LastPlayerForTeam_Notify();
        if (this.killindicator_teamchange == -2)
                this.caplayer = 0;
index ba1e7a84fbc4a985befefcffb088af17cc91e46e..83618a2f80a7be965982fcafdf85e582ee232e93 100644 (file)
@@ -13,7 +13,7 @@ REGISTER_MUTATOR(ctf, false)
                ctf_Initialize();
 
                ActivateTeamplay();
-               SetLimits(autocvar_capturelimit_override, autocvar_captureleadlimit_override, -1, -1);
+               SetLimits(autocvar_capturelimit_override, autocvar_captureleadlimit_override, autocvar_timelimit_override, -1);
                have_team_spawns = -1; // request team spawns
        }
 
@@ -1158,8 +1158,8 @@ void ctf_Reset(entity this)
        ctf_RespawnFlag(this);
 }
 
-void ctf_DelayedFlagSetup() // called after a flag is placed on a map by ctf_FlagSetup()
-{SELFPARAM();
+void ctf_DelayedFlagSetup(entity this) // called after a flag is placed on a map by ctf_FlagSetup()
+{
        // bot waypoints
        waypoint_spawnforitem_force(self, self.origin);
        self.nearestwaypointtimeout = 0; // activate waypointing again
@@ -2551,10 +2551,10 @@ 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.
+void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
 {
        ctf_teams = 2;
 
index 1f99c938de021984872d4416b6167dab6c0e232a..f05b53ce8cbc6998407f91ac71998a0d13c9a5bf 100644 (file)
@@ -15,7 +15,7 @@ REGISTER_MUTATOR(cts, false)
 
                g_race_qualifying = true;
                independent_players = 1;
-               SetLimits(0, 0, -1, -1);
+               SetLimits(0, 0, autocvar_timelimit_override, -1);
 
                cts_Initialize();
        }
index ba6a48f354decfe842607c6a127fe43c41fd8045..3a32c203140d754cc97eed98aefd38f1af99600d 100644 (file)
@@ -22,7 +22,7 @@ REGISTER_MUTATOR(dom, false)
                        fraglimit_override = autocvar_g_domination_roundbased_point_limit;
 
                ActivateTeamplay();
-               SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, -1, -1);
+               SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, autocvar_timelimit_override, -1);
                have_team_spawns = -1; // request team spawns
        }
 
@@ -681,7 +681,7 @@ void dom_spawnteams(int teams)
        dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, SND_Null, "", "");
 }
 
-void dom_DelayedInit() // Do this check with a delay so we can wait for teams to be set up.
+void dom_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
 {
        // if no teams are found, spawn defaults
        if(find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
index bee23d10148ca298da4e52bdab45b95bc0b213c3..f57661fba9617c1fb2d27683bdeb55e59eebeb4a 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_MUTATOR(ft, false)
                freezetag_Initialize();
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, -1, -1);
+               SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, autocvar_timelimit_override, -1);
 
                if (autocvar_g_freezetag_team_spawns)
                        have_team_spawns = -1; // request team spawns
@@ -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 7b2972c84c5b07be474e905fc62c06012e15e76d..e49bf3d546e2d726c3b3cff23075b19e2d268bf5 100644 (file)
@@ -19,7 +19,7 @@ REGISTER_MUTATOR(inv, false)
 
                cvar_settemp("g_monsters", "1");
 
-               SetLimits(autocvar_g_invasion_point_limit, -1, -1, -1);
+               SetLimits(autocvar_g_invasion_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
                if (autocvar_g_invasion_teams >= 2)
                {
                        ActivateTeamplay();
@@ -482,7 +482,7 @@ void invasion_ScoreRules(float inv_teams)
        ScoreRules_basics_end();
 }
 
-void invasion_DelayedInit() // Do this check with a delay so we can wait for teams to be set up.
+void invasion_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
 {
        if(autocvar_g_invasion_teams)
                invasion_teams = bound(2, autocvar_g_invasion_teams, 4);
index 4654795608ff7566a9461b12cc8c5ce7880b2d84..66ac8a80e38619e61012ce18b3185cda04556926 100644 (file)
@@ -82,8 +82,8 @@ void ka_EventLog(string mode, entity actor) // use an alias for easy changing an
 }
 
 void ka_TouchEvent();
-void ka_RespawnBall() // runs whenever the ball needs to be relocated
-{SELFPARAM();
+void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
+{
        if(gameover) { return; }
        vector oldballorigin = self.origin;
 
@@ -100,7 +100,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
        self.angles = '0 0 0';
        self.effects = autocvar_g_keepawayball_effects;
        self.touch = ka_TouchEvent;
-       self.think = ka_RespawnBall;
+       setthink(self, ka_RespawnBall);
        self.nextthink = time + autocvar_g_keepawayball_respawntime;
 
        Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
@@ -130,7 +130,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        if(!self) { return; }
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        { // The ball fell off the map, respawn it since players can't get to it
-               ka_RespawnBall();
+               ka_RespawnBall(self);
                return;
        }
        if(IS_DEAD(other)) { return; }
@@ -193,7 +193,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ball.movetype = MOVETYPE_BOUNCE;
        ball.wait = time + 1;
        ball.touch = ka_TouchEvent;
-       ball.think = ka_RespawnBall;
+       setthink(ball, ka_RespawnBall);
        ball.nextthink = time + autocvar_g_keepawayball_respawntime;
        ball.takedamage = DAMAGE_YES;
        ball.effects &= ~EF_NODRAW;
@@ -230,12 +230,12 @@ void ka_Reset(entity this)
 
        if(time < game_starttime)
        {
-               this.think = ka_RespawnBall;
+               setthink(this, ka_RespawnBall);
                this.touch = func_null;
                this.nextthink = game_starttime;
        }
        else
-               ka_RespawnBall();
+               ka_RespawnBall(this);
 }
 
 
index dbcaa5f898362a082be5f916222151c0c1e30e7d..e311f72c1303830f49535beda0c59b242c6eaa6e 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_MUTATOR(kh, false)
                kh_Initialize();
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_keyhunt_point_limit, autocvar_g_keyhunt_point_leadlimit, -1, -1);
+               SetLimits(autocvar_g_keyhunt_point_limit, autocvar_g_keyhunt_point_leadlimit, autocvar_timelimit_override, -1);
                if (autocvar_g_keyhunt_team_spawns)
                        have_team_spawns = -1; // request team spawns
        }
index 4f84c5abbcb6c71994884d3a68e13f2ef703c5c8..22850d8b8be9221dbae26169b3a2bed7a2632539 100644 (file)
@@ -13,7 +13,7 @@ REGISTER_MUTATOR(lms, false)
                        error("This is a game type and it cannot be added at runtime.");
                lms_Initialize();
 
-               SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, -1, -1);
+               SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, autocvar_timelimit_override, -1);
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
@@ -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 3f6a8a85603f6c95dbb7361472d1e457ee5e3b3f..7b769e29ff152f193fd1573c09697da7dede3dd6 100644 (file)
@@ -424,7 +424,7 @@ MUTATOR_HOOKFUNCTION(rc, CheckRules_World)
        {
                if(!g_race_qualifying)
                {
-                       ret_float = WinningCondition_QualifyingThenRace(checkrules_fraglimit);
+                       ret_float = WinningCondition_Race(checkrules_fraglimit);
                        return true;
                }
                else if(g_race_qualifying == 2)
@@ -468,9 +468,8 @@ void rc_SetLimits()
        qualifying_override = autocvar_g_race_qualifying_timelimit_override;
        fraglimit_override = autocvar_g_race_laps_limit;
        leadlimit_override = 0; // currently not supported by race
-       timelimit_override = -1; // use default if we don't set it below
+       timelimit_override = autocvar_timelimit_override;
 
-       // we need to find out the correct value for g_race_qualifying
        float want_qualifying = ((qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit) > 0;
 
        if(autocvar_g_campaign)
@@ -478,20 +477,20 @@ void rc_SetLimits()
                g_race_qualifying = 1;
                independent_players = 1;
        }
-       else if(!autocvar_g_campaign && want_qualifying)
+       else if(want_qualifying)
        {
                g_race_qualifying = 2;
                independent_players = 1;
-               race_fraglimit = (race_fraglimit >= 0) ? fraglimit_override : autocvar_fraglimit;
-               race_leadlimit = (race_leadlimit >= 0) ? leadlimit_override : autocvar_leadlimit;
-               race_timelimit = (race_timelimit >= 0) ? timelimit_override : autocvar_timelimit;
+               race_fraglimit = (fraglimit_override >= 0) ? fraglimit_override : autocvar_fraglimit;
+               race_leadlimit = (leadlimit_override >= 0) ? leadlimit_override : autocvar_leadlimit;
+               race_timelimit = (timelimit_override >= 0) ? timelimit_override : autocvar_timelimit;
+               qualifying_override = (qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit;
                fraglimit_override = 0;
                leadlimit_override = 0;
-               timelimit_override = autocvar_g_race_qualifying_timelimit;
+               timelimit_override = qualifying_override;
        }
        else
                g_race_qualifying = 0;
-
        SetLimits(fraglimit_override, leadlimit_override, timelimit_override, qualifying_override);
 }
 
index 3167d603bf9798a57e0bc59f31b540da65b97646..6c22a8e198fceaace9cf96812449f5d216a19497 100644 (file)
@@ -5,7 +5,7 @@
 int autocvar_g_tdm_point_limit;
 int autocvar_g_tdm_point_leadlimit;
 bool autocvar_g_tdm_team_spawns;
-void tdm_DelayedInit();
+void tdm_DelayedInit(entity this);
 
 REGISTER_MUTATOR(tdm, false)
 {
@@ -16,7 +16,7 @@ REGISTER_MUTATOR(tdm, false)
                InitializeEntity(world, tdm_DelayedInit, INITPRIO_GAMETYPE);
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, -1, -1);
+               SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, autocvar_timelimit_override, -1);
                if (autocvar_g_tdm_team_spawns)
                        have_team_spawns = -1; // request team spawns
        }
@@ -64,10 +64,10 @@ 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()
+void tdm_DelayedInit(entity this)
 {
        // if no teams are found, spawn defaults
        if(find(world, classname, "tdm_team") == world)
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 273be69d7444c45b37183b01501a93aaa602b722..9fd6ca7b3f9d2f0db732ebcd6a673d7c9b0ea30a 100644 (file)
@@ -726,67 +726,58 @@ float race_waypointsprite_visible_for_player(entity e)
                return false;
 }
 
-float have_verified;
-void trigger_race_checkpoint_verify()
-{SELFPARAM();
-       entity cp;
-       float i, p;
-       float qual;
-
-       if(have_verified)
-               return;
-       have_verified = 1;
+void trigger_race_checkpoint_verify(entity this)
+{
+    static bool have_verified;
+       if (have_verified) return;
+       have_verified = true;
 
-       qual = g_race_qualifying;
+       bool qual = g_race_qualifying;
 
-       setself(spawn());
-       TRANSMUTE(Player, self);
+       int pl_race_checkpoint = 0;
+       int pl_race_place = 0;
 
-       if(g_race)
-       {
-               for(i = 0; i <= race_highest_checkpoint; ++i)
-               {
-                       self.race_checkpoint = race_NextCheckpoint(i);
+       if (g_race) {
+               for (int i = 0; i <= race_highest_checkpoint; ++i) {
+                       pl_race_checkpoint = race_NextCheckpoint(i);
 
                        // race only (middle of the race)
-                       g_race_qualifying = 0;
-                       self.race_place = 0;
-                       if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
-                               error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for respawning in race) - bailing out"));
+                       g_race_qualifying = false;
+                       pl_race_place = 0;
+                       if (!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false)) {
+                               error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for respawning in race) - bailing out"));
+            }
 
-                       if(i == 0)
-                       {
+                       if (i == 0) {
                                // qualifying only
                                g_race_qualifying = 1;
-                               self.race_place = race_lowest_place_spawn;
-                               if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
-                                       error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out"));
+                               pl_race_place = race_lowest_place_spawn;
+                               if (!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false)) {
+                                       error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out"));
+                }
 
                                // race only (initial spawn)
                                g_race_qualifying = 0;
-                               for(p = 1; p <= race_highest_place_spawn; ++p)
-                               {
-                                       self.race_place = p;
-                                       if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
-                                               error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for initially spawning in race) - bailing out"));
+                               for (int p = 1; p <= race_highest_place_spawn; ++p) {
+                                       pl_race_place = p;
+                                       if (!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false)) {
+                                               error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for initially spawning in race) - bailing out"));
+                    }
                                }
                        }
                }
-       }
-       else if(!defrag_ents)
-       {
+       } else if (!defrag_ents) {
                // qualifying only
-               self.race_checkpoint = race_NextCheckpoint(0);
+               pl_race_checkpoint = race_NextCheckpoint(0);
                g_race_qualifying = 1;
-               self.race_place = race_lowest_place_spawn;
-               if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false))
-                       error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out"));
-       }
-       else
-       {
-               self.race_checkpoint = race_NextCheckpoint(0);
+               pl_race_place = race_lowest_place_spawn;
+               if (!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, false)) {
+                       error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out"));
+        }
+       } else {
+               pl_race_checkpoint = race_NextCheckpoint(0);
                g_race_qualifying = 1;
-               self.race_place = 0; // there's only one spawn on defrag maps
+               pl_race_place = 0; // there's only one spawn on defrag maps
 
                // check if a defragcp file already exists, then read it and apply the checkpoint order
                float fh;
@@ -794,19 +785,18 @@ void trigger_race_checkpoint_verify()
                string l;
 
                defragcpexists = fh = fopen(strcat("maps/", GetMapname(), ".defragcp"), FILE_READ);
-               if(fh >= 0)
-               {
-                       while((l = fgets(fh)))
-                       {
+               if (fh >= 0) {
+                       while ((l = fgets(fh))) {
                                len = tokenize_console(l);
-                               if(len != 2)
-                               {
+                               if (len != 2) {
                                        defragcpexists = -1; // something's wrong in the defrag cp file, set defragcpexists to -1 so that it will be rewritten when someone finishes
                                        continue;
                                }
-                               for(cp = world; (cp = find(cp, classname, "target_checkpoint"));)
-                                       if(argv(0) == cp.targetname)
+                               for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
+                                       if (argv(0) == cp.targetname) {
                                                cp.race_checkpoint = stof(argv(1));
+                    }
+                }
                        }
                        fclose(fh);
                }
@@ -814,60 +804,55 @@ void trigger_race_checkpoint_verify()
 
        g_race_qualifying = qual;
 
-       if(race_timed_checkpoint)
-       {
-               if(defrag_ents)
-               {
-                       for(cp = world; (cp = find(cp, classname, "target_startTimer"));)
+       if (race_timed_checkpoint) {
+               if (defrag_ents) {
+                       for (entity cp = world; (cp = find(cp, classname, "target_startTimer"));) {
                                WaypointSprite_UpdateSprites(cp.sprite, WP_RaceStart, WP_Null, WP_Null);
-                       for(cp = world; (cp = find(cp, classname, "target_stopTimer"));)
+            }
+                       for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) {
                                WaypointSprite_UpdateSprites(cp.sprite, WP_RaceFinish, WP_Null, WP_Null);
-
-                       for(cp = world; (cp = find(cp, classname, "target_checkpoint"));)
-                       {
-                               if(cp.race_checkpoint == -2) // something's wrong with the defrag cp file or it has not been written yet, set defragcpexists to -1 so that it will be rewritten when someone finishes
+            }
+                       for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
+                               if (cp.race_checkpoint == -2) { // something's wrong with the defrag cp file or it has not been written yet, set defragcpexists to -1 so that it will be rewritten when someone finishes
                                        defragcpexists = -1;
+                }
                        }
-
-                       if(defragcpexists != -1)
-                       {
+                       if (defragcpexists != -1) {
                                float largest_cp_id = 0;
-                               for(cp = world; (cp = find(cp, classname, "target_checkpoint"));)
-                                       if(cp.race_checkpoint > largest_cp_id)
+                               for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
+                                       if (cp.race_checkpoint > largest_cp_id) {
                                                largest_cp_id = cp.race_checkpoint;
-                               for(cp = world; (cp = find(cp, classname, "target_stopTimer"));)
+                    }
+                }
+                               for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) {
                                        cp.race_checkpoint = largest_cp_id + 1; // finish line
+                }
                                race_highest_checkpoint = largest_cp_id + 1;
                                race_timed_checkpoint = largest_cp_id + 1;
-                       }
-                       else
-                       {
-                               for(cp = world; (cp = find(cp, classname, "target_stopTimer"));)
+                       } else {
+                               for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) {
                                        cp.race_checkpoint = 255; // finish line
+                }
                                race_highest_checkpoint = 255;
                                race_timed_checkpoint = 255;
                        }
-               }
-               else
-               {
-                       for(cp = world; (cp = find(cp, classname, "trigger_race_checkpoint")); )
-                               if(cp.sprite)
-                               {
-                                       if(cp.race_checkpoint == 0)
+               } else {
+                       for (entity cp = world; (cp = find(cp, classname, "trigger_race_checkpoint")); ) {
+                               if (cp.sprite) {
+                                       if (cp.race_checkpoint == 0) {
                                                WaypointSprite_UpdateSprites(cp.sprite, WP_RaceStart, WP_Null, WP_Null);
-                                       else if(cp.race_checkpoint == race_timed_checkpoint)
+                    } else if (cp.race_checkpoint == race_timed_checkpoint) {
                                                WaypointSprite_UpdateSprites(cp.sprite, WP_RaceFinish, WP_Null, WP_Null);
+                    }
                                }
+            }
                }
        }
 
-       if(defrag_ents)
-       {
-               entity trigger, targ;
-               for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
-                       for(targ = world; (targ = find(targ, targetname, trigger.target)); )
-                               if (targ.classname == "target_checkpoint" || targ.classname == "target_startTimer" || targ.classname == "target_stopTimer")
-                               {
+       if (defrag_ents) {
+               for (entity trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); ) {
+                       for (entity targ = world; (targ = find(targ, targetname, trigger.target)); ) {
+                               if (targ.classname == "target_checkpoint" || targ.classname == "target_startTimer" || targ.classname == "target_stopTimer") {
                                        trigger.wait = 0;
                                        trigger.delay = 0;
                                        targ.wait = 0;
@@ -885,9 +870,9 @@ void trigger_race_checkpoint_verify()
                                        //setorigin(targ, trigger.origin);
                                        //remove(trigger);
                                }
+            }
+        }
        }
-       remove(self);
-       setself(this);
 }
 
 vector trigger_race_checkpoint_spawn_evalfunc(entity player, entity spot, vector current)
@@ -1075,7 +1060,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 d6f3559cdc27f1ea69150e53d6397e9b00f8df6b..ef614c7ac3eaf55885ae4bb8d99246e8ac9d09f3 100644 (file)
@@ -68,7 +68,7 @@ spawnfunc(item_enviro)         { spawnfunc_item_invincible(this);     }
 .float delay;
 
 // weapon remove ent from df
-void target_init_verify()
+void target_init_verify(entity this)
 {
        entity trigger, targ;
        for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
@@ -95,8 +95,8 @@ spawnfunc(target_init)
 }
 
 // weapon give ent from defrag
-void target_give_init()
-{SELFPARAM();
+void target_give_init(entity this)
+{
        entity targ;
        for (targ = world; (targ = find(targ, targetname, self.target)); ) {
                if (targ.classname == "weapon_rocketlauncher" || targ.classname == "weapon_devastator") {
index fabeaeced96f4e41b2476aaad022b9e4176eac82..c275faa7c300b3d97c1115f47603f06317108388 100644 (file)
@@ -31,7 +31,7 @@ void LogTeamchange(float player_id, float team_number, float type)
        GameLogEcho(strcat(":team:", ftos(player_id), ":", ftos(team_number), ":", ftos(type)));
 }
 
-void default_delayedinit()
+void default_delayedinit(entity this)
 {
        if(!scores_initialized)
                ScoreRules_generic();
@@ -44,23 +44,6 @@ void ActivateTeamplay()
        cvar_set("teamplay", "2");  // DP needs this for sending proper getstatus replies.
 }
 
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override)
-{
-       // enforce the server's universal frag/time limits
-       // set to -1 to not change value
-       if(!autocvar_g_campaign)
-       {
-               if(fraglimit_override >= 0)
-                       cvar_set("fraglimit", ftos(fraglimit_override));
-               if(timelimit_override >= 0)
-                       cvar_set("timelimit", ftos(timelimit_override));
-               if(leadlimit_override >= 0)
-                       cvar_set("leadlimit", ftos(leadlimit_override));
-               if(qualifying_override >= 0)
-                       cvar_set("g_race_qualifying_timelimit", ftos(qualifying_override));
-       }
-}
-
 void InitGameplayMode()
 {
        VoteReset();
@@ -89,8 +72,6 @@ void InitGameplayMode()
 
        MapInfo_ClearTemps();
 
-       // set both here, gamemode can override it later
-       SetLimits(autocvar_fraglimit_override, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
        gamemode_name = MapInfo_Type_ToText(MapInfo_LoadedGametype);
 
        cache_mutatormsg = strzone("");
index e24005a3211336bc53a8c082751df9bf82eeac74..df82a9cae6040e830e077a22bee2f13db963db9d 100644 (file)
@@ -16,12 +16,10 @@ void TeamchangeFrags(entity e);
 
 void LogTeamchange(float player_id, float team_number, float type);
 
-void default_delayedinit();
+void default_delayedinit(entity this);
 
 void ActivateTeamplay();
 
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
-
 void InitGameplayMode();
 
 string GetClientVersionMessage();
index be5d3773c0a1bfc92fefded156fe985ec669f83f..7bbf00dc51c335262f6b3a757b3d97188d5692c5 100644 (file)
@@ -1,7 +1,7 @@
 #include "tests.qh"
 
-void test_weapons_hurt() {
-    SELFPARAM();
+void test_weapons_hurt(entity this)
+{
     EXPECT_NE(100, this.health);
     remove(this.enemy);
     remove(this);
@@ -48,7 +48,8 @@ TEST(Vehicles, Spawn)
     noref entity v = it = new(vehicle);
     Vehicle veh = VEH_BUMBLEBEE;
     it.active = ACTIVE_NOT;
-    WITH(entity, self, it, vehicle_initialize(veh, false); it.nextthink = time);
+    vehicle_initialize(it, veh, false);
+    it.nextthink = time;
 
     SUCCEED();
 }
index 1337a1d71b89a097082565df800e6ea2a2e203ba..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)
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 21279dae93b6589f9b801f892f7f5f6694272ab9..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)
@@ -772,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 39ada82f782b62bbeae93db7926f7be05f9f49d9..0dfad90ec964e6396afcc79dbfd51644a1c873c9 100644 (file)
@@ -18,6 +18,7 @@ sv_eventlog 1
 sv_logscores_bots 1
 g_weaponarena all
 g_weaponarena_random 2
+g_playerstats_gamereport_uri ""
 
 // Start!