]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into matthiaskrgr/nadecountdown_nopicmip
authorMartin Taibr <taibr.martin@gmail.com>
Wed, 30 Aug 2017 17:11:18 +0000 (19:11 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Wed, 30 Aug 2017 17:11:18 +0000 (19:11 +0200)
272 files changed:
.gitlab-ci.yml
CMakeLists.txt
balance-mario.cfg
balance-overkill.cfg
balance-samual.cfg
balance-xdf.cfg
balance-xonotic.cfg
balance-xpm.cfg
commands.cfg
defaultClient.cfg
defaultOverkill.cfg
defaultServer.cfg
defaultXonotic.cfg
gamemodes-server.cfg
mutators.cfg
qcsrc/Makefile
qcsrc/client/bgmscript.qc
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/defs.qh
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/panel/quickmenu.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/vote.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/progs.inc
qcsrc/client/view.qc
qcsrc/common/_all.inc
qcsrc/common/command/generic.qc
qcsrc/common/command/rpn.qc
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/debug.qh
qcsrc/common/effects/effectinfo.qc
qcsrc/common/effects/qc/_mod.inc
qcsrc/common/effects/qc/_mod.qh
qcsrc/common/effects/qc/all.inc [deleted file]
qcsrc/common/effects/qc/all.qc [deleted file]
qcsrc/common/effects/qc/all.qh [deleted file]
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/casings.qh
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/effects/qc/lightningarc.qc
qcsrc/common/effects/qc/modeleffects.qc
qcsrc/common/gamemodes/_mod.inc
qcsrc/common/gamemodes/_mod.qh
qcsrc/common/gamemodes/gamemode/nexball/_mod.inc
qcsrc/common/gamemodes/gamemode/nexball/_mod.qh
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh
qcsrc/common/gamemodes/rules.qc [new file with mode: 0644]
qcsrc/common/gamemodes/rules.qh [new file with mode: 0644]
qcsrc/common/gamemodes/sv_rules.qc [new file with mode: 0644]
qcsrc/common/gamemodes/sv_rules.qh [new file with mode: 0644]
qcsrc/common/items/all.qh
qcsrc/common/items/item.qh
qcsrc/common/items/item/pickup.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/minigames/minigame/bd.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/monsters/sv_spawn.qc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc
qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/mutators/mutator/physical_items/sv_physical_items.qc
qcsrc/common/mutators/mutator/sandbox/sv_sandbox.qc
qcsrc/common/mutators/mutator/vampire/sv_vampire.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/notifications/all.qc
qcsrc/common/notifications/all.qh
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/playerstats.qc
qcsrc/common/state.qc
qcsrc/common/t_items.qc
qcsrc/common/t_items.qh
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/rotating.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/disablerelay.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/turrets/_all.inc [deleted file]
qcsrc/common/turrets/_all.qh [deleted file]
qcsrc/common/turrets/_mod.inc
qcsrc/common/turrets/_mod.qh
qcsrc/common/turrets/all.qc
qcsrc/common/turrets/all.qh
qcsrc/common/turrets/checkpoint.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/config.qc
qcsrc/common/turrets/targettrigger.qc
qcsrc/common/turrets/turret/ewheel.qc
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/flac.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/fusionreactor.qc
qcsrc/common/turrets/turret/hellion.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/machinegun.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/mlrs.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/phaser.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/tesla.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/turrets/util.qc
qcsrc/common/turrets/util.qh
qcsrc/common/util.qc
qcsrc/common/vehicles/_all.inc [deleted file]
qcsrc/common/vehicles/_all.qh [deleted file]
qcsrc/common/vehicles/_mod.inc
qcsrc/common/vehicles/_mod.qh
qcsrc/common/vehicles/all.qc
qcsrc/common/vehicles/all.qh
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/weapons/all.inc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/calculations.qc
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/arc.qh
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/blaster.qh
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/crylink.qh
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/fireball.qh
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hagar.qh
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hlac.qh
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/hook.qh
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/machinegun.qh
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/minelayer.qh
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/mortar.qh
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/porto.qh
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/rifle.qh
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/seeker.qh
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shockwave.qh
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/shotgun.qh
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/tuba.qh
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vaporizer.qh
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/common/weapons/weapon/vortex.qh
qcsrc/lib/angle.qc
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/lib/csqcmodel/interpolate.qh
qcsrc/lib/log.qh
qcsrc/lib/math.qh
qcsrc/lib/test.qc
qcsrc/lib/urllib.qc
qcsrc/lib/warpzone/server.qc
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/maplist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/skinlist.qc
qcsrc/menu/xonotic/slider_decibels.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/bot/default/aim.qc
qcsrc/server/bot/default/bot.qc
qcsrc/server/bot/default/scripting.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/campaign.qc
qcsrc/server/cheats.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/banning.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/radarmap.qh
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/compat/quake3.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/g_world.qh
qcsrc/server/impulse.qc
qcsrc/server/ipban.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/gamemode.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_assault.qh
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ca.qh
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qh
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_cts.qh
qcsrc/server/mutators/mutator/gamemode_deathmatch.qh
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_domination.qh
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qh
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qh
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qh
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qh
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_lms.qh
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/mutators/mutator/gamemode_race.qh
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qh
qcsrc/server/player.qc
qcsrc/server/playerdemo.qc
qcsrc/server/portals.qc
qcsrc/server/progs.inc
qcsrc/server/race.qc
qcsrc/server/scores.qh
qcsrc/server/scores_rules.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/sv_main.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponstats.qc
scripts/ok_nade_counter.shader

index 5427860963c0ccbf2c1760a8f49e6d75497d7acc..9305f527cd3abc9640d17bff880e021b854d7b17 100644 (file)
@@ -29,7 +29,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
     - make
-    - EXPECT=585cfa6d62ce59f4854bedfce7c51c20
+    - EXPECT=ed9be8d1b1a544f89bcdd7d36876fede
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 5ef6db722ad01d876772623932376593297cf8d0..2e5fc791f8585428c314a2ae9293bb011d371e3a 100644 (file)
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
 project(xonotic-data ASM)
 
+set(all qc-all)
+add_custom_target(${all})
+
 set(checks qc-checks)
 add_custom_target(${checks})
 
@@ -73,14 +76,17 @@ set_source_files_properties(
 )
 
 add_executable(csprogs qcsrc/client/progs.inc)
+add_dependencies(${all} csprogs)
 add_dependencies(csprogs ${checks})
 target_compile_definitions(csprogs PRIVATE -DGAMEQC -DCSQC)
 
 add_executable(progs qcsrc/server/progs.inc)
+add_dependencies(${all} progs)
 add_dependencies(progs ${checks})
 target_compile_definitions(progs PRIVATE -DGAMEQC -DSVQC)
 
 add_executable(menu qcsrc/menu/progs.inc)
+add_dependencies(${all} menu)
 add_dependencies(menu ${checks})
 target_compile_definitions(menu PRIVATE -DMENUQC)
 
index 42cf31196553096d8e7a3e6df76db560f99cdc29..a8f59a8cd75a31c5f5b23b1dc4590007dd7bf8df 100644 (file)
@@ -114,7 +114,7 @@ set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0.02
@@ -123,7 +123,7 @@ set g_balance_pause_armor_rot 1
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
 set g_balance_armor_blockpercent 0.7
 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
 set g_balance_fuel_regenlinear 0
@@ -134,7 +134,7 @@ set g_balance_pause_fuel_rot 5
 set g_balance_pause_fuel_rot_spawn 10
 set g_balance_fuel_regenstable 50
 set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
 // }}}
 
 // {{{ misc
index fc99616f94eaff821e575442fcdfca74d0de6052..3f025655c8826083e1280112a4550d85100d12d8 100644 (file)
@@ -114,7 +114,7 @@ set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 200
-set g_balance_health_limit 999
+set g_balance_health_limit 200
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0
@@ -123,7 +123,7 @@ set g_balance_pause_armor_rot 5
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 0
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
 set g_balance_armor_blockpercent 0.6
 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
 set g_balance_fuel_regenlinear 0
@@ -134,7 +134,7 @@ set g_balance_pause_fuel_rot 5
 set g_balance_pause_fuel_rot_spawn 10
 set g_balance_fuel_regenstable 50
 set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
 // }}}
 
 // {{{ misc
index 4357eff7646aad75e967bfbd9de0f32b697b104b..52fd03dc7e32dcc3223fa5508c0b7b19bd6c1b32 100644 (file)
@@ -114,7 +114,7 @@ set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0.04
@@ -123,7 +123,7 @@ set g_balance_pause_armor_rot 1
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
 set g_balance_armor_blockpercent 0.6
 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
 set g_balance_fuel_regenlinear 0
@@ -134,7 +134,7 @@ set g_balance_pause_fuel_rot 5
 set g_balance_pause_fuel_rot_spawn 10
 set g_balance_fuel_regenstable 50
 set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
 // }}}
 
 // {{{ misc
index a7d6b43740de047372c391bb438c70919ffd87b4..4d26972067abdcf3fd4a18f1e3db231bd19e4958 100644 (file)
@@ -114,7 +114,7 @@ set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0.02
@@ -123,7 +123,7 @@ set g_balance_pause_armor_rot 1
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
 set g_balance_armor_blockpercent 0.7
 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
 set g_balance_fuel_regenlinear 0
@@ -134,7 +134,7 @@ set g_balance_pause_fuel_rot 5
 set g_balance_pause_fuel_rot_spawn 10
 set g_balance_fuel_regenstable 50
 set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
 // }}}
 
 // {{{ misc
index 5bd1536feab823df7b40dbd50df1133d194222ef..fece8cd726072f6b9f0ca81677ce05ffc00815d7 100644 (file)
@@ -114,7 +114,7 @@ set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0.02
@@ -123,7 +123,7 @@ set g_balance_pause_armor_rot 1
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
 set g_balance_armor_blockpercent 0.7
 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
 set g_balance_fuel_regenlinear 0
@@ -134,7 +134,7 @@ set g_balance_pause_fuel_rot 5
 set g_balance_pause_fuel_rot_spawn 10
 set g_balance_fuel_regenstable 50
 set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
 // }}}
 
 // {{{ misc
index 5c14aa36206256e19c240ecf105815a8c7fc8e41..984972623228b5a3c98c0bf6a035db3d9a7b83d9 100644 (file)
@@ -114,7 +114,7 @@ set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0.02
@@ -123,7 +123,7 @@ set g_balance_pause_armor_rot 1
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
 set g_balance_armor_blockpercent 0.7
 set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
 set g_balance_fuel_regenlinear 0
@@ -134,7 +134,7 @@ set g_balance_pause_fuel_rot 5
 set g_balance_pause_fuel_rot_spawn 10
 set g_balance_fuel_regenstable 50
 set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
 // }}}
 
 // {{{ misc
index 93b68f901e57154ec7512a2d98830fce7ec168ad..66ca90e2aa25dcb0aab5f659ba07b2c722b2e44b 100644 (file)
@@ -185,6 +185,7 @@ alias skinmob "editmob skin ${* ?}"
 alias namemob "editmob name ${* ?}"
 alias movemob "editmob movetarget ${* ?}"
 alias butcher "editmob butcher ${* ?}"
+alias mobbutcher "editmob butcher ${* ?}"
 
 
 // ============================================================
@@ -209,7 +210,6 @@ alias gettaginfo           "qc_cmd_sv     gettaginfo           ${* ?}" // Get sp
 alias gotomap              "qc_cmd_sv     gotomap              ${* ?}" // Simple command to switch to another map
 alias lockteams            "qc_cmd_sv     lockteams            ${* ?}" // Disable the ability for players to switch or enter teams
 alias make_mapinfo         "qc_cmd_sv     make_mapinfo         ${* ?}" // Automatically rebuild mapinfo files
-alias mobbutcher           "qc_cmd_sv     mobbutcher           ${* ?}" // Remove all monsters on the map
 alias moveplayer           "qc_cmd_sv     moveplayer           ${* ?}" // Change the team/status of a player
 alias nospectators         "qc_cmd_sv     nospectators         ${* ?}" // Automatically remove spectators from a match
 alias playerdemo           "qc_cmd_sv     playerdemo           ${* ?}" // Control the ability to save demos of players
index 7aa1ad5cf07afc03f9d6fb879693ea649ee4789a..e4904ff58134dea57a745398fb65123d1f3b035c 100644 (file)
@@ -33,7 +33,6 @@ mod_q3bsp_lightmapmergepower 4
 _cl_color "112.211" // same effect as 112, but menuqc can detect this as the default and not intentionally set
 _cl_name ""
 seta _cl_gender 0 "storage cvar for current player gender (0 = undisclosed, 1 = male, 2 = female)"
-_cl_playermodel models/player/erebus.iqm
 _cl_playerskin 0
 
 seta cl_reticle 1 "enable zoom reticles"
@@ -269,7 +268,7 @@ r_shadow_realtime_world_lightmaps 1
 r_shadow_realtime_world_importlightentitiesfrommap 0 // Whether build process uses keepLights is nontransparent and may change, so better make keepLights not matter.
 cl_decals_fadetime 5
 cl_decals_time 1
-seta cl_gunalign 3 "Gun alignment; 1 = center (if allowed by g_shootfromclient) or right, 2 = center (if allowed by g_shootfromclient) or left, 3 = right only, 4 = left only"
+seta cl_gunalign 3 "Gun alignment; 1 = center, 3 = right, 4 = left; requires reconnect"
 seta cl_nogibs 0 "reduce number of violence effects, or remove them totally"
 seta cl_particlegibs 0 "simpler gibs"
 seta cl_gibs_damageforcescale 3.5 "force to push around gibs"
index 634943c581dfd85e7c94b2fef04bc0f3b704ad93..2444301b9e7b34c75b8bacf3ebdd367615ec4939 100644 (file)
@@ -8,6 +8,15 @@ exec physicsOverkill.cfg
 
 // general gameplay
 set g_overkill 1
+
+// hack - eventually, we should be able to choose overkill models in menu like for vanilla
+set sv_defaultcharacter 1
+set sv_defaultplayermodel "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+set sv_defaultplayermodel_red "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm"
+set sv_defaultplayermodel_blue "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+set sv_defaultplayermodel_yellow "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm"
+set sv_defaultplayermodel_pink "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+
 set g_respawn_ghosts 0
 
 set g_nades 1
index ed24832d142e70aedf1445a76bf9b57a8e38edcf..596576a097fb93c6841a9e76ba1927a5909a1e13 100644 (file)
@@ -185,6 +185,9 @@ set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
 set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
 set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
 set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
+set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"
+set g_pickup_respawntime_scaling_offset 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening"
+set g_pickup_respawntime_scaling_linear 1 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly"
 set g_weaponarena "0"  "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
 set g_weaponarena_random "0"   "if set to a number, only that weapon count is given on every spawn (randomly)"
 set g_weaponarena_random_with_blaster "1"      "additionally, always provide the blaster in random weapon arena games"
index b3b23fec76e6619a0bc286bac4d68723f33dac37..eb6c72a5640408a2167b68bacd6ed45440ca5752 100644 (file)
@@ -29,6 +29,8 @@ exec defaultServer.cfg
 
 set ekg 0      "Throw huge amounts of gibs"
 
+_cl_playermodel "models/player/erebus.iqm"
+
 locs_enable 0
 pausable 0
 set samelevel 0 "when 1, always play the same level over and over again"
index 684edb3a83c64c73776554c649dcbdc3d5e0ea8b..6790a3b4fb9575ab91e070c57bc984ac97609ba2 100644 (file)
@@ -256,9 +256,9 @@ set g_ctf_flag_dropped_floatinwater 200 "move upwards while in water at this vel
 set g_ctf_throw 1 "throwing allows circumventing carrierkill score, so enable this with care!"
 set g_ctf_throw_angle_max 90 "maximum upwards angle you can throw the flag"
 set g_ctf_throw_angle_min -90 "minimum downwards angle you can throw the flag"
-set g_ctf_throw_punish_count 2
+set g_ctf_throw_punish_count 3
 set g_ctf_throw_punish_delay 30
-set g_ctf_throw_punish_time 5
+set g_ctf_throw_punish_time 10
 set g_ctf_throw_strengthmultiplier 2 "multiplier for velocity when you have the strength... essentially, throw the flag REALLY hard when you have the strength :D"
 set g_ctf_throw_velocity_forward 500 "how fast or far a player can throw the flag"
 set g_ctf_throw_velocity_up 200 "upwards velocity added upon initial throw"
@@ -521,3 +521,4 @@ set g_invasion_spawn_delay 0.25
 set g_invasion_spawnpoint_spawn_delay 0.5
 set g_invasion_teams 0 "number of teams in invasion (note: use mapinfo to set this)"
 set g_invasion_team_spawns 1 "use team spawns in teamplay invasion mode"
+set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: complete the stage (note: use mapinfo to set this)"
index 9e8460da15ad4dbcfcc3edf24802e65eaf02a3a4..23c72435c1e399233872a18114c265debb945150 100644 (file)
@@ -176,7 +176,7 @@ set g_random_gravity_negative 1000 "negative gravity multiplier"
 // =======
 set g_nades 0 "enable off-hand grenades"
 set g_nades_spread 0.04 "random spread offset of throw direction"
-set g_nades_throw_offset "0 0 0" "nade throwing offset"
+set g_nades_throw_offset "0 -25 0" "nade throwing offset"
 set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire"
 set g_nades_client_select 0 "allow client side selection of nade type"
 set g_nades_pickup 0 "allow picking up thrown nades (not your own)"
index bd17dad6aaf5e93c0c729891009cfedfa85ca258..bfea08b5f92df070fbcc59269b5ec65ed7bb3162 100644 (file)
@@ -14,17 +14,17 @@ ENABLE_DEBUGTRACE ?= 0
 BUILD_MOD ?=
 
 ifndef ZIP
-       ifneq ($(shell which zip),)
+       ifneq ($(shell which zip 2>/dev/null),)
                ZIP := zip -9
        endif
-       ifneq ($(shell which 7z),)
+       ifneq ($(shell which 7z 2>/dev/null),)
                ZIP := 7z a -tzip -mx=9
        endif
-       ifneq ($(shell which 7za),)
+       ifneq ($(shell which 7za 2>/dev/null),)
                ZIP := 7za a -tzip -mx=9
        endif
     ifndef ZIP
-        $(warning "No zip in ($(PATH))")
+        $(warning "No zip / 7z / 7za in ($(PATH))")
         ZIP := : zip_not_found
     endif
 endif
index 4dc6204cb06a67362e130301cc191b50f8793269..2db9e54cf1af01dfd8bf9e0348a204f11d9e4f47 100644 (file)
@@ -138,7 +138,7 @@ void BGMScript_InitEntity(entity e)
                e.bgmscriptline = e.bgmscriptline0 = i;
                if(i >= bgmscriptbufsize)
                {
-                       LOG_INFOF("ERROR: bgmscript does not define %s\n", e.bgmscript);
+                       LOG_INFOF("ERROR: bgmscript does not define %s", e.bgmscript);
                        strunzone(e.bgmscript);
                        e.bgmscript = string_null;
                }
index 6777eefa9572b734b66eaed6bb92dcfd348e7bf2..8faf0f387b6ccd33103cbfd825dec2692a7ac760 100644 (file)
@@ -52,22 +52,22 @@ void LocalCommand_blurtest(int request)
                        blurtest_time1 = time + stof(argv(1));
                        blurtest_radius = stof(argv(2));
                        blurtest_power = stof(argv(3));
-                       LOG_INFO("Enabled blurtest\n");
+                       LOG_INFO("Enabled blurtest");
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 cl_cmd blurtest");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
        #else
        if (request)
        {
-               LOG_INFO("Blurtest is not enabled on this client.\n");
+               LOG_INFO("Blurtest is not enabled on this client.");
                return;
        }
        #endif
@@ -105,23 +105,25 @@ void LocalCommand_boxparticles(int request, int argc)
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
+                       LOG_INFO("Incorrect parameters for ^2boxparticles^7");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
-                       LOG_INFO("  'effectname' is the name of a particle effect in effectinfo.txt\n");
-                       LOG_INFO("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
-                       LOG_INFO("  'org_from' is the starting origin of the box\n");
-                       LOG_INFO("  'org_to' is the ending origin of the box\n");
-                       LOG_INFO("  'dir_from' is the minimum velocity\n");
-                       LOG_INFO("  'dir_to' is the maximum velocity\n");
-                       LOG_INFO("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
-                       LOG_INFO("  'flags' can contain:\n");
-                       LOG_INFO("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
-                       LOG_INFO("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
-                       LOG_INFO("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
-                       LOG_INFO("    128 to draw a trail, not a box\n");
+                       LOG_INFO(
+                           "Usage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n"
+                "  'effectname' is the name of a particle effect in effectinfo.txt\n"
+                "  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n"
+                "  'org_from' is the starting origin of the box\n"
+                "  'org_to' is the ending origin of the box\n"
+                "  'dir_from' is the minimum velocity\n"
+                "  'dir_to' is the maximum velocity\n"
+                "  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n"
+                "  'flags' can contain:\n"
+                "    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n"
+                "    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n"
+                "    4 to respect globals particles_fade (set right before via prvm_globalset client)\n"
+                "    128 to draw a trail, not a box\n"
+                       );
                        return;
                }
        }
@@ -146,13 +148,13 @@ void LocalCommand_create_scrshot_ent(int request)
                                fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
                                fputs(fh, "}\n");
 
-                               LOG_INFO("Completed screenshot entity dump in ^2data/data/", path, MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+                               LOG_INFO("Completed screenshot entity dump in ^2data/data/", path, MapInfo_Map_bspname, "_scrshot_ent.txt^7.");
 
                                fclose(fh);
                        }
                        else
                        {
-                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
+                               LOG_INFO("^1Error: ^7Could not dump to file!");
                        }
                        return;
                }
@@ -160,8 +162,8 @@ void LocalCommand_create_scrshot_ent(int request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent [path]\n");
-                       LOG_INFO("  Where 'path' can be the subdirectory of data/data in which the file is saved.\n");
+                       LOG_INFO("Usage:^3 cl_cmd create_scrshot_ent [path]");
+                       LOG_INFO("  Where 'path' can be the subdirectory of data/data in which the file is saved.");
                        return;
                }
        }
@@ -190,8 +192,8 @@ void LocalCommand_debugmodel(int request, int argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
-                       LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.\n");
+                       LOG_INFO("Usage:^3 cl_cmd debugmodel model");
+                       LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.");
                        return;
                }
        }
@@ -236,12 +238,12 @@ void LocalCommand_handlevote(int request, int argc)
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
+                       LOG_INFO("Incorrect parameters for ^2handlevote^7");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
-                       LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
+                       LOG_INFO("Usage:^3 cl_cmd handlevote vote");
+                       LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.");
                        return;
                }
        }
@@ -279,10 +281,10 @@ void LocalCommand_hud(int request, int argc)
                                {
                                        if (argv(2) == "help")
                                        {
-                                               LOG_INFO(" quickmenu [[default | file | \"\"] submenu file]\n");
-                                               LOG_INFO("Called without options (or with \"\") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
-                                               LOG_INFO("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.\n");
-                                               LOG_INFO("A file name can also be given to open a different quickmenu\n");
+                                               LOG_INFO(" quickmenu [[default | file | \"\"] submenu file]");
+                                               LOG_INFO("Called without options (or with \"\") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.");
+                                               LOG_INFO("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.");
+                                               LOG_INFO("A file name can also be given to open a different quickmenu");
                                                return;
                                        }
                                        string file = ((argv(4) == "") ? autocvar_hud_panel_quickmenu_file : argv(4));
@@ -337,16 +339,16 @@ void LocalCommand_hud(int request, int argc)
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2hud^7\n");
+                       LOG_INFO("Incorrect parameters for ^2hud^7");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
-                       LOG_INFO("  Where 'action' is the command to complete,\n");
-                       LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
-                       LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
-                       LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       LOG_INFO("  Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       LOG_INFO("Usage:^3 cl_cmd hud action [configname | radartoggle | layout]");
+                       LOG_INFO("  Where 'action' is the command to complete,");
+                       LOG_INFO("  'configname' is the name to save to for \"save\" action,");
+                       LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,");
+                       LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.");
+                       LOG_INFO("  Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"");
                        return;
                }
        }
@@ -368,12 +370,12 @@ void LocalCommand_localprint(int request, int argc)
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2localprint^7\n");
+                       LOG_INFO("Incorrect parameters for ^2localprint^7");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
-                       LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
+                       LOG_INFO("Usage:^3 cl_cmd localprint \"message\"");
+                       LOG_INFO("  'message' is the centerprint message to send to yourself.");
                        return;
                }
        }
@@ -395,12 +397,12 @@ void LocalCommand_mv_download(int request, int argc)
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
+                       LOG_INFO("Incorrect parameters for ^2mv_download^7");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
-                       LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+                       LOG_INFO("Usage:^3 cl_cmd mv_download mapid");
+                       LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.");
                        return;
                }
        }
@@ -432,12 +434,12 @@ void LocalCommand_sendcvar(int request, int argc)
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
+                       LOG_INFO("Incorrect parameters for ^2sendcvar^7");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
-                       LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
+                       LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>");
+                       LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.");
                        return;
                }
        }
@@ -484,7 +486,7 @@ CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like weaponpriority)") { Lo
 
 void LocalCommand_macro_help()
 {
-       FOREACH(CLIENT_COMMANDS, true, LOG_INFOF("  ^2%s^7: %s\n", it.m_name, it.m_description));
+       FOREACH(CLIENT_COMMANDS, true, LOG_INFOF("  ^2%s^7: %s", it.m_name, it.m_description));
 }
 
 bool LocalCommand_macro_command(int argc, string command)
@@ -531,14 +533,14 @@ void GameCommand(string command)
        {
                if (argc == 1)
                {
-                       LOG_INFO("\nClient console commands:\n");
+                       LOG_INFO("Client console commands:");
                        LocalCommand_macro_help();
 
-                       LOG_INFO("\nGeneric commands shared by all programs:\n");
+                       LOG_INFO("\nGeneric commands shared by all programs:");
                        GenericCommand_macro_help();
 
-                       LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
-                       LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.");
+                       LOG_INFO("For help about a specific command, type cl_cmd help COMMAND");
 
                        return;
                }
@@ -558,7 +560,7 @@ void GameCommand(string command)
           ) return;
 
        // nothing above caught the command, must be invalid
-       LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
+       LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.");
 }
 
 
index 9893b8ae3cbc215fb08acb5c30586eed19fd934d..6499a683e8f4c2cf198be39cb0bee2c9eb9e9a3f 100644 (file)
@@ -134,7 +134,7 @@ void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
                this.forceplayermodels_isgoodmodel = fexists(this.forceplayermodels_savemodel);
                this.forceplayermodels_isgoodmodel_mdl = this.forceplayermodels_savemodel;
                if(!this.forceplayermodels_isgoodmodel)
-                       LOG_INFOF("Warning: missing model %s has been used\n", this.forceplayermodels_savemodel);
+                       LOG_INFOF("Warning: missing model %s has been used", this.forceplayermodels_savemodel);
        }
 }
 void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
index d36994ec3d2e69bbc6849d82eaf3272686c01949..9a5335eff06b7c4ca56a73b17d3324b2a2b9618e 100644 (file)
@@ -74,6 +74,9 @@ float race_myrank;
 float nb_pb_period;
 
 // Spectating
+// -1 - observing
+// 0 - playing
+// >0 - id of spectated player
 float spectatee_status;
 
 // short mapname
index a1f1cc7ecfd6d7e069b4a2d5d90f41a8b4810a14..ec07ee4095a30e3c1c462f25fae034882e87b123 100644 (file)
@@ -239,11 +239,11 @@ void HUD_Panel_ExportCfg(string cfgname)
 
                HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
 
-               LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
+               LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)"), filename);
                fclose(fh);
        }
        else
-               LOG_INFOF(_("^1Couldn't write to %s\n"), filename);
+               LOG_INFOF(_("^1Couldn't write to %s"), filename);
 }
 
 void HUD_Configure_Exit_Force()
index 3233d1b9ba9ea22acaf0d2cf3f869f08f5704473..9af8673dab8941adc2ad73decdd4834ba6ddce63 100644 (file)
@@ -83,12 +83,12 @@ bool QuickMenu_Open(string mode, string submenu, string file)
        if(mode == "file")
        {
                if(file == "" || file == "0")
-                       LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
+                       LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu");
                else
                {
                        fh = fopen(file, FILE_READ);
                        if(fh < 0)
-                               LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", file);
+                               LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu", file);
                }
                if(fh < 0)
                        mode = "default";
index 34ecd834f7ec682ca1e6c1c00d9f8164928e783a..8e0d0f057695d8e237fbcbe2816b11298c6fce89 100644 (file)
@@ -153,13 +153,12 @@ float SetTeam(entity pl, float Team);
 //float lastpnum;
 void Scoreboard_UpdatePlayerTeams()
 {
-       float Team;
        entity pl, tmp;
        //int num = 0;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
                //num += 1;
-               Team = entcs_GetScoreTeam(pl.sv_entnum);
+               int Team = entcs_GetScoreTeam(pl.sv_entnum);
                if(SetTeam(pl, Team))
                {
                        tmp = pl.sort_prev;
@@ -296,48 +295,48 @@ void Scoreboard_UpdateTeamPos(entity Team)
 
 void Cmd_Scoreboard_Help()
 {
-       LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
-       LOG_INFO(_("^3|---------------------------------------------------------------|\n"));
-       LOG_INFO(_("Usage:\n"));
-       LOG_INFO(_("^2scoreboard_columns_set default\n"));
-       LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
-       LOG_INFO(_("The following field names are recognized (case insensitive):\n"));
-       LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n"));
-       LOG_INFO("\n");
-
-       LOG_INFO(_("^3name^7 or ^3nick^7             Name of a player\n"));
-       LOG_INFO(_("^3ping^7                     Ping time\n"));
-       LOG_INFO(_("^3pl^7                       Packet loss\n"));
-       LOG_INFO(_("^3elo^7                      Player ELO\n"));
-       LOG_INFO(_("^3kills^7                    Number of kills\n"));
-       LOG_INFO(_("^3deaths^7                   Number of deaths\n"));
-       LOG_INFO(_("^3suicides^7                 Number of suicides\n"));
-       LOG_INFO(_("^3frags^7                    kills - suicides\n"));
-       LOG_INFO(_("^3kd^7                       The kill-death ratio\n"));
-       LOG_INFO(_("^3dmg^7                      The total damage done\n"));
-       LOG_INFO(_("^3dmgtaken^7                 The total damage taken\n"));
-       LOG_INFO(_("^3sum^7                      frags - deaths\n"));
-       LOG_INFO(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
-       LOG_INFO(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
-       LOG_INFO(_("^3captime^7                  Time of fastest cap (CTF)\n"));
-       LOG_INFO(_("^3fckills^7                  Number of flag carrier kills\n"));
-       LOG_INFO(_("^3returns^7                  Number of flag returns\n"));
-       LOG_INFO(_("^3drops^7                    Number of flag drops\n"));
-       LOG_INFO(_("^3lives^7                    Number of lives (LMS)\n"));
-       LOG_INFO(_("^3rank^7                     Player rank\n"));
-       LOG_INFO(_("^3pushes^7                   Number of players pushed into void\n"));
-       LOG_INFO(_("^3destroyed^7                Number of keys destroyed by pushing them into void\n"));
-       LOG_INFO(_("^3kckills^7                  Number of keys carrier kills\n"));
-       LOG_INFO(_("^3losses^7                   Number of times a key was lost\n"));
-       LOG_INFO(_("^3laps^7                     Number of laps finished (race/cts)\n"));
-       LOG_INFO(_("^3time^7                     Total time raced (race/cts)\n"));
-       LOG_INFO(_("^3fastest^7                  Time of fastest lap (race/cts)\n"));
-       LOG_INFO(_("^3ticks^7                    Number of ticks (DOM)\n"));
-       LOG_INFO(_("^3takes^7                    Number of domination points taken (DOM)\n"));
-       LOG_INFO(_("^3bckills^7                  Number of ball carrier kills\n"));
-       LOG_INFO(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
-       LOG_INFO(_("^3score^7                    Total score\n"));
-       LOG_INFO("\n");
+       LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command."));
+       LOG_INFO(_("^3|---------------------------------------------------------------|"));
+       LOG_INFO(_("Usage:"));
+       LOG_INFO(_("^2scoreboard_columns_set default"));
+       LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ..."));
+       LOG_INFO(_("The following field names are recognized (case insensitive):"));
+       LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields."));
+       LOG_INFO("");
+
+       LOG_INFO(_("^3name^7 or ^3nick^7             Name of a player"));
+       LOG_INFO(_("^3ping^7                     Ping time"));
+       LOG_INFO(_("^3pl^7                       Packet loss"));
+       LOG_INFO(_("^3elo^7                      Player ELO"));
+       LOG_INFO(_("^3kills^7                    Number of kills"));
+       LOG_INFO(_("^3deaths^7                   Number of deaths"));
+       LOG_INFO(_("^3suicides^7                 Number of suicides"));
+       LOG_INFO(_("^3frags^7                    kills - suicides"));
+       LOG_INFO(_("^3kd^7                       The kill-death ratio"));
+       LOG_INFO(_("^3dmg^7                      The total damage done"));
+       LOG_INFO(_("^3dmgtaken^7                 The total damage taken"));
+       LOG_INFO(_("^3sum^7                      frags - deaths"));
+       LOG_INFO(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured"));
+       LOG_INFO(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up"));
+       LOG_INFO(_("^3captime^7                  Time of fastest cap (CTF)"));
+       LOG_INFO(_("^3fckills^7                  Number of flag carrier kills"));
+       LOG_INFO(_("^3returns^7                  Number of flag returns"));
+       LOG_INFO(_("^3drops^7                    Number of flag drops"));
+       LOG_INFO(_("^3lives^7                    Number of lives (LMS)"));
+       LOG_INFO(_("^3rank^7                     Player rank"));
+       LOG_INFO(_("^3pushes^7                   Number of players pushed into void"));
+       LOG_INFO(_("^3destroyed^7                Number of keys destroyed by pushing them into void"));
+       LOG_INFO(_("^3kckills^7                  Number of keys carrier kills"));
+       LOG_INFO(_("^3losses^7                   Number of times a key was lost"));
+       LOG_INFO(_("^3laps^7                     Number of laps finished (race/cts)"));
+       LOG_INFO(_("^3time^7                     Total time raced (race/cts)"));
+       LOG_INFO(_("^3fastest^7                  Time of fastest lap (race/cts)"));
+       LOG_INFO(_("^3ticks^7                    Number of ticks (DOM)"));
+       LOG_INFO(_("^3takes^7                    Number of domination points taken (DOM)"));
+       LOG_INFO(_("^3bckills^7                  Number of ball carrier kills"));
+       LOG_INFO(_("^3bctime^7                   Total amount of time holding the ball in Keepaway"));
+       LOG_INFO(_("^3score^7                    Total score"));
+       LOG_INFO("");
 
        LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
                "of game types, then a slash, to make the field show up only in these\n"
@@ -347,11 +346,10 @@ void Cmd_Scoreboard_Help()
        LOG_INFO(_("The special game type names 'teams' and 'noteams' can be used to\n"
                "include/exclude ALL teams/noteams game modes.\n\n"));
 
-       LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
-       LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields\n"
+       LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4"));
+       LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields"
                "right of the vertical bar aligned to the right.\n"));
-       LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
-               "other gamemodes except DM.\n"));
+       LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\nother gamemodes except DM.\n"));
 }
 
 // NOTE: adding a gametype with ? to not warn for an optional field
@@ -476,7 +474,7 @@ LABEL(notfound)
                                else
                                {
                                        if(!nocomplain)
-                                               LOG_INFOF("^1Error:^7 Unknown score field: '%s'\n", str);
+                                               LOG_INFOF("^1Error:^7 Unknown score field: '%s'", str);
                                        continue;
                                }
 LABEL(found)
@@ -515,7 +513,7 @@ LABEL(found)
                        sbt_field_title[0] = strzone(TranslateScoresLabel("name"));
                        sbt_field[0] = SP_NAME;
                        ++sbt_num_fields;
-                       LOG_INFO("fixed missing field 'name'\n");
+                       LOG_INFO("fixed missing field 'name'");
 
                        if(!have_separator)
                        {
@@ -530,7 +528,7 @@ LABEL(found)
                                sbt_field[1] = SP_SEPARATOR;
                                sbt_field_size[1] = stringwidth("|", false, hud_fontsize);
                                ++sbt_num_fields;
-                               LOG_INFO("fixed missing field '|'\n");
+                               LOG_INFO("fixed missing field '|'");
                        }
                }
                else if(!have_separator)
@@ -540,7 +538,7 @@ LABEL(found)
                        sbt_field_size[sbt_num_fields] = stringwidth("|", false, hud_fontsize);
                        sbt_field[sbt_num_fields] = SP_SEPARATOR;
                        ++sbt_num_fields;
-                       LOG_INFO("fixed missing field '|'\n");
+                       LOG_INFO("fixed missing field '|'");
                }
                if(!have_secondary)
                {
@@ -549,7 +547,7 @@ LABEL(found)
                        sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
                        sbt_field[sbt_num_fields] = ps_secondary;
                        ++sbt_num_fields;
-                       LOG_INFOF("fixed missing field '%s'\n", scores_label(ps_secondary));
+                       LOG_INFOF("fixed missing field '%s'", scores_label(ps_secondary));
                }
                if(!have_primary)
                {
@@ -558,7 +556,7 @@ LABEL(found)
                        sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
                        sbt_field[sbt_num_fields] = ps_primary;
                        ++sbt_num_fields;
-                       LOG_INFOF("fixed missing field '%s'\n", scores_label(ps_primary));
+                       LOG_INFOF("fixed missing field '%s'", scores_label(ps_primary));
                }
        }
 
index 750e62ef82ca44ba685032e61552639e2c6026a0..15e18e8f445a2b86f7ed9af851c332a856b99e4c 100644 (file)
@@ -24,7 +24,7 @@ void HUD_Vote()
                {
                        vote_yescount = 0;
                        vote_nocount = 0;
-                       LOG_INFO(_("^1You must answer before entering hud configure mode\n"));
+                       LOG_INFO(_("^1You must answer before entering hud configure mode"));
                        cvar_set("_hud_configure", "0");
                }
                if(vote_called_vote)
index 479dd7e8eab8486ed14e23b1b333a58df3a1ac59..ae624ef85c88c1a7c2b6a09d0fb7617629cfb089 100644 (file)
@@ -1,8 +1,10 @@
 #include "main.qh"
 
+#include "defs.qh"
+#include <common/ent_cs.qh>
 #include "miscfunctions.qh"
 #include <common/effects/effect.qh>
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
 #include <common/effects/all.qh>
 #include <common/effects/all.inc>
 #include "hud/_mod.qh"
@@ -95,7 +97,7 @@ void CSQC_Init()
        prvm_language = strzone(cvar_string("prvm_language"));
 
 #ifdef WATERMARK
-       LOG_INFOF("^4CSQC Build information: ^1%s\n", WATERMARK);
+       LOG_INFOF("^4CSQC Build information: ^1%s", WATERMARK);
 #endif
 
        {
@@ -150,6 +152,9 @@ void CSQC_Init()
 
        GetTeam(NUM_SPECTATOR, true); // add specs first
 
+       for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w)
+               weapon_accuracy[w] = -1;
+
        // precaches
 
        if(autocvar_cl_reticle)
@@ -409,7 +414,7 @@ NET_HANDLE(ENT_CLIENT_SCORES, bool isnew)
        if(!isNew && n != this.sv_entnum)
        {
                //print("A CSQC entity changed its owner!\n");
-               LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", etof(this), this.classname);
+               LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)", etof(this), this.classname);
                isNew = true;
                Ent_Remove(this);
        }
@@ -491,9 +496,9 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
 
     int f = ReadByte();
 
-       scoreboard_showscores_force = (f & 1);
+       scoreboard_showscores_force = (f & BIT(0));
 
-       if(f & 2)
+       if(f & BIT(1))
        {
                newspectatee_status = ReadByte();
                if(newspectatee_status == player_localnum + 1)
@@ -502,9 +507,9 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
        else
                newspectatee_status = 0;
 
-       spectatorbutton_zoom = (f & 4);
+       spectatorbutton_zoom = (f & BIT(2));
 
-       if(f & 16)
+       if(f & BIT(4))
        {
                num_spectators = ReadByte();
 
@@ -821,7 +826,7 @@ void CSQC_Ent_Update(entity this, bool isnew)
        {
                if (t != this.enttype || isnew)
                {
-                       LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", etof(this), this.entnum, this.enttype, t);
+                       LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)", etof(this), this.entnum, this.enttype, t);
                        Ent_Remove(this);
                        clearentity(this);
                        isnew = true;
@@ -831,7 +836,7 @@ void CSQC_Ent_Update(entity this, bool isnew)
        {
                if (!isnew)
                {
-                       LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", etof(this), this.entnum, t);
+                       LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)", etof(this), this.entnum, t);
                        isnew = true;
                }
        }
@@ -841,7 +846,7 @@ void CSQC_Ent_Update(entity this, bool isnew)
        FOREACH(LinkedEntities, it.m_id == t, {
                if (isnew) this.classname = it.netname;
                if (autocvar_developer_csqcentities)
-            LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
+            LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
                done = it.m_read(this, NULL, isnew);
                MUTATOR_CALLHOOK(Ent_Update, this, isnew);
                break;
@@ -881,7 +886,7 @@ void Ent_Remove(entity this)
 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed.  Essentially call remove(this) as well.
 void CSQC_Ent_Remove(entity this)
 {
-       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype);
+       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}", this, this.entnum, this.enttype);
        if (wasfreed(this))
        {
                LOG_WARN("CSQC_Ent_Remove called for already removed entity. Packet loss?");
@@ -903,20 +908,20 @@ void Gamemode_Init()
 // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided.  To execute standard behavior, simply execute localcmd with the string.
 void CSQC_Parse_StuffCmd(string strMessage)
 {
-       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
+       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")", strMessage);
        localcmd(strMessage);
 }
 // CSQC_Parse_Print : Provides the print string in the first parameter that the server provided.  To execute standard behavior, simply execute print with the string.
 void CSQC_Parse_Print(string strMessage)
 {
-       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")\n", strMessage);
+       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")", strMessage);
        print(ColorTranslateRGB(strMessage));
 }
 
 // CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.
 void CSQC_Parse_CenterPrint(string strMessage)
 {
-       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
+       if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")", strMessage);
        centerprint_hud(strMessage);
 }
 
@@ -930,12 +935,12 @@ bool CSQC_Parse_TempEntity()
 
        FOREACH(TempEntities, it.m_id == nTEID, {
                if (autocvar_developer_csqcentities)
-                       LOG_INFOF("CSQC_Parse_TempEntity() nTEID=%s (%d)\n", it.netname, nTEID);
+                       LOG_INFOF("CSQC_Parse_TempEntity() nTEID=%s (%d)", it.netname, nTEID);
                return it.m_read(NULL, NULL, true);
        });
 
        if (autocvar_developer_csqcentities)
-               LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
+               LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d", nTEID);
 
        // No special logic for this temporary entity; return 0 so the engine can handle it
        return false;
index 9e783d306237b8dd49c27872c1b1cdd44098f17f..b34bd0f3a1476b9fda20e2da89b0c7249c648a03 100644 (file)
@@ -497,7 +497,7 @@ void Cmd_MapVote_MapDownload(int argc)
 
        if(argc != 2 || !mv_pk3list)
        {
-               LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
+               LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!"));
                return;
        }
 
@@ -507,7 +507,7 @@ void Cmd_MapVote_MapDownload(int argc)
                        break;
 
        if(!pak || pak.sv_entnum != id) {
-               LOG_INFO(_("^1Error:^7 Couldn't find pak index.\n"));
+               LOG_INFO(_("^1Error:^7 Couldn't find pak index."));
                return;
        }
 
@@ -516,7 +516,7 @@ void Cmd_MapVote_MapDownload(int argc)
                mv_preview[id] = true;
                return;
        } else {
-               LOG_INFO(_("Requesting preview...\n"));
+               LOG_INFO(_("Requesting preview..."));
                localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n"));
        }
 }
index 84a475a7d8a80512b3f8d214711fe62d4553f0bb..fd1647ddcce350abe5a7af8ea85b2e2fe70f1630 100644 (file)
@@ -569,7 +569,7 @@ void URI_Get_Callback(int id, int status, string data)
        }
        else
        {
-               LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
+               LOG_INFOF("Received HTTP request data for an invalid id %d.", id);
        }
 }
 
@@ -584,7 +584,7 @@ void Accuracy_LoadLevels()
                if(acc_levels > MAX_ACCURACY_LEVELS)
                        acc_levels = MAX_ACCURACY_LEVELS;
                if(acc_levels < 2)
-                       LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values\n");
+                       LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values");
 
                int i;
                for(i = 0; i < acc_levels; ++i)
index 66827c8f30e3bdc2bfeb9508ce64a5a69bf86bea..55e54d8ac2c641ad49b10bf03a979f0603eff9d3 100644 (file)
@@ -1,11 +1,11 @@
 #include "player_skeleton.qh"
 
 #include <common/physics/movetypes/movetypes.qh>
+#include <common/physics/player.qh>
 #include "mutators/events.qh"
 #include "../lib/csqcmodel/cl_player.qh"
 #include "../lib/warpzone/anglestransform.qh"
 
-.vector v_angle;
 .float v_angle_save_x;
 
 class(Skeleton) .float skeleton_info_modelindex;
index f6a7999d440a455a30dc5d0b70aa9e74f4113139..3b607a7e14add199cd354940018de71d588f2566 100644 (file)
@@ -5,7 +5,7 @@
 #include <client/_mod.inc>
 
 #include <common/_all.inc>
-#include <common/effects/qc/all.qc>
+#include <common/effects/qc/_mod.inc>
 
 #include <lib/csqcmodel/cl_model.qc>
 #include <lib/csqcmodel/cl_player.qc>
index e4f38b24c2d145e917765d4ee725f171feff083b..7a054606313f1e64d90b61105c2ae98683a909b9 100644 (file)
@@ -1782,7 +1782,7 @@ void CSQC_UpdateView(entity this, float w, float h)
                ov_enabled = true;
 
                #if 0
-               LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
+               LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f",
                        vtos(ov_org),
                        vtos(getpropertyvec(VF_ANGLES)),
                        ov_distance,
index 56681b099e756f6075da949446ca5dd605c7f102..32dbf5208ff23a278196f70ad4d9156a1e0f9d55 100644 (file)
@@ -45,8 +45,8 @@ noref float autocvar_net_connecttimeout = 30;
 #include "items/_mod.inc"
     #include "weapons/_all.inc"
         #include "monsters/_mod.inc"
-        #include "turrets/all.qc"
-        #include "vehicles/all.qc"
+        #include "turrets/_mod.inc"
+        #include "vehicles/_mod.inc"
 
 #include "mutators/_mod.inc"
     #include "gamemodes/_mod.inc"
index a9abd9886856080454e2db48ba3614b4d9201c7a..c58a3df75a50d83e55731bc5955020f999781007 100644 (file)
@@ -86,12 +86,12 @@ void GenericCommand_addtolist(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2addtolist^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
-                       LOG_INFO("  Where 'variable' is what to add 'value' to.\n");
-                       LOG_INFO("See also: ^2removefromlist^7\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " addtolist variable value");
+                       LOG_INFO("  Where 'variable' is what to add 'value' to.");
+                       LOG_INFO("See also: ^2removefromlist^7");
                        return;
                }
        }
@@ -153,7 +153,7 @@ void GenericCommand_qc_curl(float request, float argc)
                                curl_uri_get_pos = (curl_uri_get_pos + 1) % (URI_GET_CURL_END - URI_GET_CURL + 1);
                        }
                        else
-                               LOG_INFO(_("error creating curl handle\n"));
+                               LOG_INFO(_("error creating curl handle"));
 
                        buf_del(buf);
 
@@ -163,7 +163,7 @@ void GenericCommand_qc_curl(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]");
                        return;
                }
        }
@@ -203,13 +203,13 @@ GENERIC_COMMAND(dumpcommands, "Dump all commands on the program to *_cmd_dump.tx
                                CMD_Write("\ndump of generic commands:\n");
                                GenericCommand_macro_write_aliases(fh);
 
-                               LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
+                               LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.");
 
                                fclose(fh);
                        }
                        else
                        {
-                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
+                               LOG_INFO("^1Error: ^7Could not dump to file!");
                        }
                        return;
                }
@@ -217,8 +217,8 @@ GENERIC_COMMAND(dumpcommands, "Dump all commands on the program to *_cmd_dump.tx
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpcommands");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
@@ -241,7 +241,7 @@ void GenericCommand_maplist(float request, float argc)
                                        {
                                                if (!fexists(strcat("maps/", argv(2), ".bsp")))
                                                {
-                                                       LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!\n");
+                                                       LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!");
                                                        break;
                                                }
 
@@ -295,13 +295,13 @@ void GenericCommand_maplist(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2maplist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2maplist^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
-                       LOG_INFO("  Where 'action' is the command to complete,\n");
-                       LOG_INFO("  and 'map' is what it acts upon (if required).\n");
-                       LOG_INFO("  Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " maplist action [map]");
+                       LOG_INFO("  Where 'action' is the command to complete,");
+                       LOG_INFO("  and 'map' is what it acts upon (if required).");
+                       LOG_INFO("  Full list of commands here: \"add, cleanup, remove, shuffle.\"");
                        return;
                }
        }
@@ -320,8 +320,8 @@ void GenericCommand_nextframe(float request, float arguments, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
-                       LOG_INFO("  Where command will be executed next frame of this VM\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...");
+                       LOG_INFO("  Where command will be executed next frame of this VM");
                        return;
                }
        }
@@ -351,12 +351,12 @@ void GenericCommand_removefromlist(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2removefromlist^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
-                       LOG_INFO("  Where 'variable' is what cvar to remove 'value' from.\n");
-                       LOG_INFO("See also: ^2addtolist^7\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value");
+                       LOG_INFO("  Where 'variable' is what cvar to remove 'value' from.");
+                       LOG_INFO("See also: ^2addtolist^7");
                        return;
                }
        }
@@ -375,10 +375,10 @@ void GenericCommand_restartnotifs(float request)
                        int NOTIF_MULTI_COUNT   = 0; FOREACH(Notifications, it.nent_type == MSG_MULTI,   { ++NOTIF_MULTI_COUNT;  });
                        int NOTIF_CHOICE_COUNT  = 0; FOREACH(Notifications, it.nent_type == MSG_CHOICE,  { ++NOTIF_CHOICE_COUNT; });
                        LOG_INFOF(
-                               strcat(
-                                       "Restart_Notifications(): Restarting %d notifications... ",
-                                       "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
-                               ),
+                           (
+                    "Restart_Notifications(): Restarting %d notifications... "
+                    "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d"
+                ),
                                (
                                        NOTIF_ANNCE_COUNT +
                                        NOTIF_INFO_COUNT +
@@ -395,7 +395,7 @@ void GenericCommand_restartnotifs(float request)
                        Destroy_All_Notifications();
                        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
                        #else
-                       LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
+                       LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd."));
                        #endif
                        return;
                }
@@ -403,8 +403,8 @@ void GenericCommand_restartnotifs(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " restartnotifs");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
@@ -430,12 +430,12 @@ void GenericCommand_settemp(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2settemp^7\n");
+                       LOG_INFO("Incorrect parameters for ^2settemp^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
-                       LOG_INFO("  Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
-                       LOG_INFO("See also: ^2settemp_restore^7\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"");
+                       LOG_INFO("  Where 'cvar' is the cvar you want to temporarily set with 'arguments'.");
+                       LOG_INFO("See also: ^2settemp_restore^7");
                        return;
                }
        }
@@ -460,9 +460,9 @@ void GenericCommand_settemp_restore(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2settemp^7\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp_restore");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2settemp^7");
                        return;
                }
        }
@@ -488,7 +488,7 @@ void GenericCommand_runtest(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
                        return;
                }
        }
@@ -531,7 +531,7 @@ GENERIC_COMMAND(runtest, "Run unit tests") { GenericCommand_runtest(request, arg
 
 void GenericCommand_macro_help()
 {
-       FOREACH(GENERIC_COMMANDS, true, LOG_INFOF("  ^2%s^7: %s\n", it.m_name, it.m_description));
+       FOREACH(GENERIC_COMMANDS, true, LOG_INFOF("  ^2%s^7: %s", it.m_name, it.m_description));
 }
 
 float GenericCommand_macro_command(float argc, string command)
index 828fbdf7dd7850004caa793a342896077a5530e4..7e1c4f52eb2879e58f47328c9402f33879398cd5 100644 (file)
@@ -13,7 +13,7 @@ string rpn_pop()
                --rpn_sp;
                return rpn_stack[rpn_sp];
        } else {
-               LOG_INFO("rpn: stack underflow\n");
+               LOG_INFO("rpn: stack underflow");
                rpn_error = true;
                return "";
        }
@@ -24,7 +24,7 @@ void rpn_push(string s)
                rpn_stack[rpn_sp] = s;
                ++rpn_sp;
        } else {
-               LOG_INFO("rpn: stack overflow\n");
+               LOG_INFO("rpn: stack overflow");
                rpn_error = true;
        }
 }
@@ -33,7 +33,7 @@ string rpn_get()
        if(rpn_sp > 0) {
                return rpn_stack[rpn_sp - 1];
        } else {
-               LOG_INFO("rpn: empty stack\n");
+               LOG_INFO("rpn: empty stack");
                rpn_error = true;
                return "";
        }
@@ -43,7 +43,7 @@ void rpn_set(string s)
        if(rpn_sp > 0) {
                rpn_stack[rpn_sp - 1] = s;
        } else {
-               LOG_INFO("rpn: empty stack\n");
+               LOG_INFO("rpn: empty stack");
                rpn_error = true;
        }
 }
@@ -107,7 +107,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                }
                                                else
                                                {
-                                                       LOG_INFO("rpn: empty cvar name for 'def'\n");
+                                                       LOG_INFO("rpn: empty cvar name for 'def'");
                                                        rpn_error = true;
                                                }
                                        } else if(rpncmd == "defs" || rpncmd == "@") {
@@ -132,7 +132,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                }
                                                else
                                                {
-                                                       LOG_INFO("rpn: empty cvar name for 'defs'\n");
+                                                       LOG_INFO("rpn: empty cvar name for 'defs'");
                                                        rpn_error = true;
                                                }
                                        } else if(rpncmd == "load") {
@@ -288,7 +288,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                                db_put(rpn_db, "stack.pos", ftos(i-2));
                                                } else {
                                                        rpn_error = 1;
-                                                       LOG_INFO("rpn: database underflow\n");
+                                                       LOG_INFO("rpn: database underflow");
                                                }
                                        } else if(rpncmd == "dbget") {
 
@@ -298,7 +298,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        rpn_push(db_get(rpn_db, strcat("stack.", ftos(i-1))));
                                                } else {
                                                        rpn_error = 1;
-                                                       LOG_INFO("rpn: database empty\n");
+                                                       LOG_INFO("rpn: database empty");
                                                }
                                        } else if(rpncmd == "dblen") {
                                                rpn_push(db_get(rpn_db, "stack.pointer"));
@@ -347,7 +347,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                if(!j)
                                                {
                                                        rpn_error = true;
-                                                       LOG_INFO("rpn: empty database\n");
+                                                       LOG_INFO("rpn: empty database");
                                                } else {
                                                        --j;
                                                        rpn_push(db_get(rpn_db, strcat("stack.", ftos(i))));
@@ -372,7 +372,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        rpn_push(db_get(rpn_db, strcat("stack.", s)));
                                                } else {
                                                        rpn_error = 1;
-                                                       LOG_INFO("rpn: empty database\n");
+                                                       LOG_INFO("rpn: empty database");
                                                }
                                        } else if(rpncmd == "dbat") {
                                                rpn_push(db_get(rpn_db, "stack.pos"));
@@ -384,7 +384,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                {
                                                        if(i < 0 || i >= j)
                                                        {
-                                                               LOG_INFO("rpn: database cursor out of bounds\n");
+                                                               LOG_INFO("rpn: database cursor out of bounds");
                                                                rpn_error = true;
                                                        }
                                                        if(!rpn_error)
@@ -398,7 +398,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                if(!j)
                                                {
                                                        rpn_error = true;
-                                                       LOG_INFO("rpn: empty database, cannot move cursor\n");
+                                                       LOG_INFO("rpn: empty database, cannot move cursor");
                                                }
                                                if(!rpn_error)
                                                {
@@ -412,7 +412,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        j = stof(db_get(rpn_db, "stack.pointer"));
                                                        if(i < 0 || i >= j)
                                                        {
-                                                               LOG_INFO("rpn: database cursor destination out of bounds\n");
+                                                               LOG_INFO("rpn: database cursor destination out of bounds");
                                                                rpn_error = true;
                                                        }
                                                        if(!rpn_error)
@@ -514,7 +514,7 @@ LABEL(skip_difference)
                                                {
                                                        if (!fexists(s))
                                                        {
-                                                               LOG_INFO("rpn: ERROR: ", s, " does not exist!\n");
+                                                               LOG_INFO("rpn: ERROR: ", s, " does not exist!");
                                                                rpn_error = true;
                                                        }
                                                }
@@ -553,7 +553,7 @@ LABEL(skip_difference)
                                while(rpn_sp > 0)
                                {
                                        s = rpn_pop();
-                                       LOG_INFO("rpn: still on stack: ", s, "\n");
+                                       LOG_INFO("rpn: still on stack: ", s);
                                }
                        }
 
@@ -563,42 +563,42 @@ LABEL(skip_difference)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
-                       LOG_INFO("    Operator description (x: string, s: set, f: float):\n");
-                       LOG_INFO("    x pop ----------------------------->     : removes the top\n");
-                       LOG_INFO("    x dup -----------------------------> x x : duplicates the top\n");
-                       LOG_INFO("    x x exch --------------------------> x x : swap the top two\n");
-                       LOG_INFO("    /cvarname load --------------------> x   : loads a cvar\n");
-                       LOG_INFO("    /cvarname x def ------------------->     : writes to a cvar\n");
-                       LOG_INFO("    f f add|sub|mul|div|mod|pow -------> f   : adds/... two numbers\n");
-                       LOG_INFO("    f f and|or|xor|bitand|bitor|bitxor > f   : logical and bitwise operations\n");
-                       LOG_INFO("    f f eq|ne|gt|ge|lt|le|max|min -----> f   : compares two numbers\n");
-                       LOG_INFO("    f neg|abs|sgn|rand|floor|ceil------> f   : negates/... a number\n");
-                       LOG_INFO("    f not|bitnot ----------------------> f   : logical and bitwise negation\n");
-                       LOG_INFO("    f exp|log|sin|cos -----------------> f   : exponential function & Co.\n");
-                       LOG_INFO("    f f f bound -----------------------> f   : bounds the middle number\n");
-                       LOG_INFO("    f1 f2 b when ----------------------> f   : f1 if b, f2 otherwise\n");
-                       LOG_INFO("    s s union|intersection|difference -> s   : set operations\n");
-                       LOG_INFO("    s shuffle -------------------------> s   : randomly arrange elements\n");
-                       LOG_INFO("    /key /value put ------------------->     : set a database key\n");
-                       LOG_INFO("    /key get --------------------------> s   : get a database value\n");
-                       LOG_INFO("    x dbpush -------------------------->     : pushes the top onto the database\n");
-                       LOG_INFO("    dbpop|dbget -----------------------> x   : removes/reads DB's top\n");
-                       LOG_INFO("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos\n");
-                       LOG_INFO("    dbclr ----------------------------->     : clear the DB\n");
-                       LOG_INFO("    s dbsave|dbload-------------------->     : save/load the DB to/from a file\n");
-                       LOG_INFO("    x dbins --------------------------->     : moves the top into the DB\n");
-                       LOG_INFO("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor\n");
-                       LOG_INFO("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor\n");
-                       LOG_INFO("    s localtime -----------------------> s   : formats the current local time\n");
-                       LOG_INFO("    s gmtime --------------------------> s   : formats the current UTC time\n");
-                       LOG_INFO("    time ------------------------------> f   : seconds since VM start\n");
-                       LOG_INFO("    s /MD4 digest ---------------------> s   : MD4 digest\n");
-                       LOG_INFO("    s /SHA256 digest ------------------> s   : SHA256 digest\n");
-                       LOG_INFO("    s /formatstring sprintf1s ---------> s   : sprintf with 1 string (pad, cut)\n");
-                       LOG_INFO("    s eval ---------------------------->     : does something eval\n");
-                       LOG_INFO("    Set operations operate on 'such''strings'.\n");
-                       LOG_INFO("    Unknown tokens insert their cvar value.\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...");
+                       LOG_INFO("    Operator description (x: string, s: set, f: float):");
+                       LOG_INFO("    x pop ----------------------------->     : removes the top");
+                       LOG_INFO("    x dup -----------------------------> x x : duplicates the top");
+                       LOG_INFO("    x x exch --------------------------> x x : swap the top two");
+                       LOG_INFO("    /cvarname load --------------------> x   : loads a cvar");
+                       LOG_INFO("    /cvarname x def ------------------->     : writes to a cvar");
+                       LOG_INFO("    f f add|sub|mul|div|mod|pow -------> f   : adds/... two numbers");
+                       LOG_INFO("    f f and|or|xor|bitand|bitor|bitxor > f   : logical and bitwise operations");
+                       LOG_INFO("    f f eq|ne|gt|ge|lt|le|max|min -----> f   : compares two numbers");
+                       LOG_INFO("    f neg|abs|sgn|rand|floor|ceil------> f   : negates/... a number");
+                       LOG_INFO("    f not|bitnot ----------------------> f   : logical and bitwise negation");
+                       LOG_INFO("    f exp|log|sin|cos -----------------> f   : exponential function & Co.");
+                       LOG_INFO("    f f f bound -----------------------> f   : bounds the middle number");
+                       LOG_INFO("    f1 f2 b when ----------------------> f   : f1 if b, f2 otherwise");
+                       LOG_INFO("    s s union|intersection|difference -> s   : set operations");
+                       LOG_INFO("    s shuffle -------------------------> s   : randomly arrange elements");
+                       LOG_INFO("    /key /value put ------------------->     : set a database key");
+                       LOG_INFO("    /key get --------------------------> s   : get a database value");
+                       LOG_INFO("    x dbpush -------------------------->     : pushes the top onto the database");
+                       LOG_INFO("    dbpop|dbget -----------------------> x   : removes/reads DB's top");
+                       LOG_INFO("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos");
+                       LOG_INFO("    dbclr ----------------------------->     : clear the DB");
+                       LOG_INFO("    s dbsave|dbload-------------------->     : save/load the DB to/from a file");
+                       LOG_INFO("    x dbins --------------------------->     : moves the top into the DB");
+                       LOG_INFO("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor");
+                       LOG_INFO("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor");
+                       LOG_INFO("    s localtime -----------------------> s   : formats the current local time");
+                       LOG_INFO("    s gmtime --------------------------> s   : formats the current UTC time");
+                       LOG_INFO("    time ------------------------------> f   : seconds since VM start");
+                       LOG_INFO("    s /MD4 digest ---------------------> s   : MD4 digest");
+                       LOG_INFO("    s /SHA256 digest ------------------> s   : SHA256 digest");
+                       LOG_INFO("    s /formatstring sprintf1s ---------> s   : sprintf with 1 string (pad, cut)");
+                       LOG_INFO("    s eval ---------------------------->     : does something eval");
+                       LOG_INFO("    Set operations operate on 'such''strings'.");
+                       LOG_INFO("    Unknown tokens insert their cvar value.");
                        return;
                }
        }
index 9e96756ba52de4feb7709164226599e2a8d1632f..125ef6bf36c99bf5d25a281e88c2053113109a91 100644 (file)
@@ -26,9 +26,6 @@
 # define TAG_VIEWLOC_TYPE entity
 #endif
 
-// new fields
-.vector v_angle;
-
 // add properties you want networked to CSQC here
 #define CSQCMODEL_EXTRAPROPERTIES \
        CSQCMODEL_PROPERTY(BIT(0), int, ReadShort, WriteShort, colormap) \
index 28153a7d404a0eb764de7ca093c79ab43c04cd2f..0200883b8dbbc89867e6c888b7489889bb606f54 100644 (file)
@@ -170,14 +170,14 @@ bool autocvar_debugdraw;
                                        e.debug = true;
                                        --rem;
                                }
-                               LOG_INFOF("%d server entities sent\n", n - rem);
+                               LOG_INFOF("%d server entities sent", n - rem);
                                return;
                        }
 
                        default:
                        case CMD_REQUEST_USAGE:
                        {
-                               LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv"));
+                               LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv");
                                return;
                        }
                }
@@ -194,14 +194,14 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object")
                        int bufhandle = stof(argv(1));
                        int string_index = stof(argv(2));
                        string s = bufstr_get(bufhandle, string_index);
-                       LOG_INFOF("%s\n", s);
+                       LOG_INFOF("%s", s);
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index");
                        return;
                }
        }
@@ -213,13 +213,13 @@ GENERIC_COMMAND(version, "Print the current version")
        {
                case CMD_REQUEST_COMMAND:
                {
-                       LOG_INFO(WATERMARK "\n");
+                       LOG_INFO(WATERMARK);
                        return;
                }
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " version"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " version");
                        return;
                }
        }
@@ -253,7 +253,7 @@ GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars")
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges"));
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges");
                        return;
                }
        }
@@ -326,22 +326,22 @@ GENERIC_COMMAND(find, "Search through entities for matching classname")
                        int entcnt = 0;
                        FOREACH_ENTITY_CLASS_ORDERED(argv(1), true,
                        {
-                               LOG_INFOF("%i (%s)\n", it, it.classname);
+                               LOG_INFOF("%i (%s)", it, it.classname);
                                ++entcnt;
                        });
                        if(entcnt)
-                               LOG_INFOF("Found %d entities\n", entcnt);
+                               LOG_INFOF("Found %d entities", entcnt);
                        return;
                }
 
                default:
                {
-                       LOG_INFO("Incorrect parameters for ^2find^7\n");
+                       LOG_INFO("Incorrect parameters for ^2find^7");
         }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 " GetProgramCommandPrefix() " find classname\n");
-                       LOG_INFO("  Where 'classname' is the classname to search for.\n");
+                       LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " find classname");
+                       LOG_INFO("  Where 'classname' is the classname to search for.");
                        return;
                }
        }
@@ -354,15 +354,15 @@ GENERIC_COMMAND(findat, "Search through entities for matching origin")
                case CMD_REQUEST_COMMAND:
                {
                    vector match = stov(argv(1));
-                   FOREACH_ENTITY_ORDERED(it.origin == match, LOG_INFOF("%i (%s)\n", it, it.classname));
+                   FOREACH_ENTITY_ORDERED(it.origin == match, LOG_INFOF("%i (%s)", it, it.classname));
                        return;
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2findat^7\n");
+                       LOG_INFO("Incorrect parameters for ^2findat^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"\n");
+                       LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"");
                        return;
                }
        }
index f662aee7b2a0e4b8d097537308cf96a98f6a1e41..71260eb3d04fa49ae2ffaeaca9c5b001ec8f8070 100644 (file)
@@ -303,8 +303,8 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
             int fh = fopen(filename, FILE_WRITE);
             if (fh >= 0) {
                effectinfo_dump(fh, alsoprint);
-                LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.\n", filename);
-                               LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.\n", filename);
+                LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.", filename);
+                               LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.", filename);
                 fclose(fh);
             } else {
                 LOG_WARNF("Could not open file '%s'!", filename);
@@ -313,10 +313,10 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
         }
         default:
         case CMD_REQUEST_USAGE: {
-            LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]"));
-            LOG_INFO("  Where 'filename' is the file to write (default is effectinfo_dump.txt),\n");
-            LOG_INFO("  if supplied with '-' output to console as well as default,\n");
-            LOG_INFO("  if left blank, it will only write to default.\n");
+            LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]");
+            LOG_INFO("  Where 'filename' is the file to write (default is effectinfo_dump.txt),");
+            LOG_INFO("  if supplied with '-' output to console as well as default,");
+            LOG_INFO("  if left blank, it will only write to default.");
             return;
         }
     }
index befcce83d8d95ee23300856661ba1fab3ffe46e8..8df95b821ae2ea07cec594230396235d74fb2529 100644 (file)
@@ -1,5 +1,4 @@
 // generated file; do not modify
-#include <common/effects/qc/all.qc>
 #include <common/effects/qc/casings.qc>
 #include <common/effects/qc/damageeffects.qc>
 #include <common/effects/qc/gibs.qc>
index 91298f3124d61c972b9d6bdd970d241c5f882acc..3f6387f0eb21a179d6a259466c914dfbb6cc4d19 100644 (file)
@@ -1,5 +1,4 @@
 // generated file; do not modify
-#include <common/effects/qc/all.qh>
 #include <common/effects/qc/casings.qh>
 #include <common/effects/qc/damageeffects.qh>
 #include <common/effects/qc/gibs.qh>
diff --git a/qcsrc/common/effects/qc/all.inc b/qcsrc/common/effects/qc/all.inc
deleted file mode 100644 (file)
index 6b5c2ff..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "casings.qc"
-#include "damageeffects.qc"
-#include "gibs.qc"
-#include "globalsound.qc"
-#include "lightningarc.qc"
-#include "modeleffects.qc"
diff --git a/qcsrc/common/effects/qc/all.qc b/qcsrc/common/effects/qc/all.qc
deleted file mode 100644 (file)
index f0fc719..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "all.qh"
-
-#define IMPLEMENTATION
-#include "all.inc"
-#undef IMPLEMENTATION
diff --git a/qcsrc/common/effects/qc/all.qh b/qcsrc/common/effects/qc/all.qh
deleted file mode 100644 (file)
index 54cf6b6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#pragma once
-
-#include "all.inc"
index d0befbb7ed04705feb92bb01e63d291011003bed..60f9633027eb2125d0278bd6abaaa2cb9ed1505a 100644 (file)
@@ -1,9 +1,4 @@
 #include "casings.qh"
-#ifdef SVQC
-void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity);
-#endif
-
-#ifdef IMPLEMENTATION
 
 #include <common/util.qh>
 
@@ -178,4 +173,3 @@ NET_HANDLE(casings, bool isNew)
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..137aa365ca1412b16c83b6eda2b0ca681d13709d 100644 (file)
@@ -1 +1,5 @@
 #pragma once
+
+#ifdef SVQC
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity);
+#endif
index 38241c2cc2df62999807f2cc2b153580a2c40d15..c85d66eeb6686cee70d27d77482757baf0336550 100644 (file)
@@ -1,7 +1,5 @@
 #include "damageeffects.qh"
 
-#ifdef IMPLEMENTATION
-
 REGISTER_NET_LINKED(ENT_CLIENT_DAMAGEINFO)
 
 #ifdef SVQC
@@ -415,5 +413,3 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
 }
 
 #endif
-
-#endif
index d1e3d9880da4244206e9ea38ef037c38a828653b..7be63e2e55c5e1056a544f23ae9bc0331ec8138a 100644 (file)
@@ -1,6 +1,5 @@
 #include "gibs.qh"
 
-#ifdef IMPLEMENTATION
 REGISTER_NET_TEMP(net_gibsplash)
 
 #ifdef SVQC
@@ -314,5 +313,3 @@ NET_HANDLE(net_gibsplash, bool isNew)
        delete(this);
 }
 #endif
-
-#endif
index c3aaf62d46d7e91d5c78679585c82d471374665f..edf995a0f6ccf453f64aa49ff175608aa3c6205f 100644 (file)
@@ -2,7 +2,6 @@
 
 #include <common/ent_cs.qh>
 
-#ifdef IMPLEMENTATION
        #include <common/animdecide.qh>
 
        #ifdef SVQC
                }
 
        #endif
-#endif
index c1c3bb8872c3ea917e51168b90be0a8566d43a75..6388575b72cb09a5baa576a0e8c3882fdeff8ffb 100644 (file)
@@ -1,6 +1,5 @@
 #include "lightningarc.qh"
 
-#ifdef IMPLEMENTATION
 REGISTER_NET_TEMP(TE_CSQC_ARC)
 
 #if defined(SVQC)
@@ -117,5 +116,3 @@ void b_make(vector s,vector e, string t,float l,float z)
        }
 
 #endif
-
-#endif
index 8fbef5b587e9c56a7ed1f7cbc20d445cd32dab4f..1b70daee2fbbd5621e8e33198ffcec7c7380b2fd 100644 (file)
@@ -1,7 +1,5 @@
 #include "modeleffects.qh"
 
-#ifdef IMPLEMENTATION
-
 REGISTER_NET_LINKED(ENT_CLIENT_MODELEFFECT)
 
 #ifdef SVQC
@@ -162,5 +160,3 @@ NET_HANDLE(ENT_CLIENT_MODELEFFECT, bool isnew)
        return true;
 }
 #endif
-
-#endif
index c3cec69dc5268cddd04a9afb11e422e4bf3b3a71..90cfa6aa4ce1b4a089bbada081774d692e92b8df 100644 (file)
@@ -1,3 +1,7 @@
 // generated file; do not modify
+#include <common/gamemodes/rules.qc>
+#ifdef SVQC
+    #include <common/gamemodes/sv_rules.qc>
+#endif
 
 #include <common/gamemodes/gamemode/_mod.inc>
index 685c277b4e18bf7771f2852d40138ad39dc14063..b3ed42da611d3a6aeedb4dd2e334cb52cba769a2 100644 (file)
@@ -1,3 +1,7 @@
 // generated file; do not modify
+#include <common/gamemodes/rules.qh>
+#ifdef SVQC
+    #include <common/gamemodes/sv_rules.qh>
+#endif
 
 #include <common/gamemodes/gamemode/_mod.qh>
index f48ef74501f430260f2292642dc6a8e44f6483ad..78727675637493289d22309c4d98da3a1a7649cb 100644 (file)
@@ -1,3 +1,6 @@
 // generated file; do not modify
 #include <common/gamemodes/gamemode/nexball/nexball.qc>
 #include <common/gamemodes/gamemode/nexball/weapon.qc>
+#ifdef SVQC
+    #include <common/gamemodes/gamemode/nexball/sv_weapon.qc>
+#endif
index 4ac2347c5d1893bb031150ae480a6a75af4ddc72..a1cf54437108efae947d84ea02e8e9a9488f3926 100644 (file)
@@ -1,3 +1,6 @@
 // generated file; do not modify
 #include <common/gamemodes/gamemode/nexball/nexball.qh>
 #include <common/gamemodes/gamemode/nexball/weapon.qh>
+#ifdef SVQC
+    #include <common/gamemodes/gamemode/nexball/sv_weapon.qh>
+#endif
index ba42962692441141079d57526061e381fa17322a..5a0ff2a2c22ade90150d22cad3fbcfdb8be07f3b 100644 (file)
@@ -15,6 +15,8 @@ MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
 #ifdef SVQC
 .float metertime = _STAT(NB_METERSTART);
 
+.entity ballcarried;
+
 int autocvar_g_nexball_goalleadlimit;
 #define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
 
@@ -69,14 +71,14 @@ float OtherTeam(float t)  //works only if there are two teams on the map!
        return e.team;
 }
 
-const float ST_NEXBALL_GOALS = 1;
+const int ST_NEXBALL_GOALS = 1;
 void nb_ScoreRules(int teams)
 {
-       ScoreRules_basics(teams, 0, 0, true);
-       ScoreInfo_SetLabel_TeamScore(   ST_NEXBALL_GOALS,  "goals", SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS,  "goals", SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
-       ScoreRules_basics_end();
+    GameRules_scoring(teams, 0, 0, {
+        field_team(ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+        field(SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+        field(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
+    });
 }
 
 void LogNB(string mode, entity actor)
@@ -119,14 +121,16 @@ void relocate_nexball(entity this)
        tracebox(this.origin, BALL_MINS, BALL_MAXS, this.origin, true, this);
        if(trace_startsolid)
        {
-               vector o;
-               o = this.origin;
-               if(!move_out_of_solid(this))
+               vector o = this.origin;
+               if (!move_out_of_solid(this)) {
                        objerror(this, "could not get out of solid at all!");
-               LOG_INFO("^1NOTE: this map needs FIXING. ", this.classname, " at ", vtos(o - '0 0 1'));
-               LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
-               LOG_INFO(" ", ftos(this.origin.y - o.y));
-               LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+        }
+        LOG_INFOF(
+            "^1NOTE: this map needs FIXING. %s at %s needs to be moved out of solid, e.g. by %s",
+            this.classname,
+            vtos(o - '0 0 1'),
+            vtos(this.origin - o)
+        );
                this.origin = o;
        }
 }
@@ -149,6 +153,7 @@ void GiveBall(entity plyr, entity ball)
        {
                ownr.effects &= ~autocvar_g_nexball_basketball_effects_default;
                ownr.ballcarried = NULL;
+               GameRules_scoring_vip(ownr, false);
                if(ownr.metertime)
                {
                        ownr.metertime = 0;
@@ -171,6 +176,7 @@ void GiveBall(entity plyr, entity ball)
        ball.weaponentity_fld = weaponentity;
        ball.team = plyr.team;
        plyr.ballcarried = ball;
+       GameRules_scoring_vip(plyr, true);
        ball.nb_dropper = plyr;
 
        plyr.effects |= autocvar_g_nexball_basketball_effects_default;
@@ -228,8 +234,9 @@ void DropBall(entity ball, vector org, vector vel)
        WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please
        WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
 
-       ball.owner.ballcarried = NULL;
-       ball.owner = NULL;
+       entity e = ball.owner; ball.owner = NULL;
+       e.ballcarried = NULL;
+       GameRules_scoring_vip(e, false);
 }
 
 void InitBall(entity this)
@@ -428,9 +435,9 @@ void GoalTouch(entity this, entity toucher)
        if(isclient)
        {
                if(pscore > 0)
-                       PlayerScore_Add(ball.pusher, SP_NEXBALL_GOALS, pscore);
+                       GameRules_scoring_add(ball.pusher, NEXBALL_GOALS, pscore);
                else if(pscore < 0)
-                       PlayerScore_Add(ball.pusher, SP_NEXBALL_FAULTS, -pscore);
+                       GameRules_scoring_add(ball.pusher, NEXBALL_FAULTS, -pscore);
        }
 
        if(ball.owner)  // Happens on spawnflag GOAL_TOUCHPLAYER
@@ -715,136 +722,6 @@ spawnfunc(ball_bound)
        spawnfunc_nexball_out(this);
 }
 
-//=======================//
-//       Weapon code     //
-//=======================//
-
-
-void W_Nexball_Think(entity this)
-{
-       //dprint("W_Nexball_Think\n");
-       //vector new_dir = steerlib_arrive(this.enemy.origin, 2500);
-       vector new_dir = normalize(this.enemy.origin + '0 0 50' - this.origin);
-       vector old_dir = normalize(this.velocity);
-       float _speed = vlen(this.velocity);
-       vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed;
-       //vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate
-
-       this.velocity = new_vel;
-
-       this.nextthink = time;
-}
-
-void W_Nexball_Touch(entity this, entity toucher)
-{
-       entity ball, attacker;
-       attacker = this.owner;
-       //this.think = func_null;
-       //this.enemy = NULL;
-
-       PROJECTILE_TOUCH(this, toucher);
-       if(attacker.team != toucher.team || autocvar_g_nexball_basketball_teamsteal)
-               if((ball = toucher.ballcarried) && !STAT(FROZEN, toucher) && !IS_DEAD(toucher) && (IS_PLAYER(attacker)))
-               {
-                       toucher.velocity = toucher.velocity + normalize(this.velocity) * toucher.damageforcescale * autocvar_g_balance_nexball_secondary_force;
-                       UNSET_ONGROUND(toucher);
-                       if(!attacker.ballcarried)
-                       {
-                               LogNB("stole", attacker);
-                               _sound(toucher, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
-
-                               if(SAME_TEAM(attacker, toucher) && time > CS(attacker).teamkill_complain)
-                               {
-                                       CS(attacker).teamkill_complain = time + 5;
-                                       CS(attacker).teamkill_soundtime = time + 0.4;
-                                       CS(attacker).teamkill_soundsource = toucher;
-                               }
-
-                               GiveBall(attacker, toucher.ballcarried);
-                       }
-               }
-       delete(this);
-}
-
-void W_Nexball_Attack(entity actor, .entity weaponentity, float t)
-{
-       entity ball;
-       float mul, mi, ma;
-       if(!(ball = actor.ballcarried))
-               return;
-
-       W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
-       tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL);
-       if(trace_startsolid)
-       {
-               if(actor.metertime)
-                       actor.metertime = 0; // Shot failed, hide the power meter
-               return;
-       }
-
-       //Calculate multiplier
-       if(t < 0)
-               mul = 1;
-       else
-       {
-               mi = autocvar_g_nexball_basketball_meter_minpower;
-               ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
-               //One triangle wave period with 1 as max
-               mul = 2 * (t % g_nexball_meter_period) / g_nexball_meter_period;
-               if(mul > 1)
-                       mul = 2 - mul;
-               mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
-       }
-
-       DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(actor, actor.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, false));
-
-
-       //TODO: use the speed_up cvar too ??
-}
-
-vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
-
-void W_Nexball_Attack2(entity actor, .entity weaponentity)
-{
-       if(actor.ballcarried.enemy)
-       {
-               entity _ball = actor.ballcarried;
-               W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
-               DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32));
-               setthink(_ball, W_Nexball_Think);
-               _ball.nextthink = time;
-               return;
-       }
-
-       if(!autocvar_g_nexball_tackling)
-               return;
-
-       W_SetupShot(actor, weaponentity, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0);
-       entity missile = new(ballstealer);
-
-       missile.owner = actor;
-
-       set_movetype(missile, MOVETYPE_FLY);
-       PROJECTILE_MAKETRIGGER(missile);
-
-       //setmodel(missile, "models/elaser.mdl");  // precision set below
-       setsize(missile, '0 0 0', '0 0 0');
-       setorigin(missile, w_shotorg);
-
-       W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
-       missile.angles = vectoangles(missile.velocity);
-       settouch(missile, W_Nexball_Touch);
-       setthink(missile, SUB_Remove);
-       missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
-
-       missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
-       missile.flags = FL_PROJECTILE;
-       IL_PUSH(g_projectiles, missile);
-       IL_PUSH(g_bot_dodge, missile);
-
-       CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
-}
-
 bool ball_customize(entity this, entity client)
 {
        if(!this.owner)
@@ -872,61 +749,6 @@ bool ball_customize(entity this, entity client)
        return true;
 }
 
-METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
-{
-    TC(BallStealer, thiswep);
-    if(fire & 1)
-        if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
-            if(autocvar_g_nexball_basketball_meter)
-            {
-                if(actor.ballcarried && !actor.metertime)
-                    actor.metertime = time;
-                else
-                    weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
-            }
-            else
-            {
-                W_Nexball_Attack(actor, weaponentity, -1);
-                weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
-            }
-    if(fire & 2)
-        if(weapon_prepareattack(thiswep, actor, weaponentity, true, autocvar_g_balance_nexball_secondary_refire))
-        {
-            W_Nexball_Attack2(actor, weaponentity);
-            weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
-        }
-
-    if(!(fire & 1) && actor.metertime && actor.ballcarried)
-    {
-        W_Nexball_Attack(actor, weaponentity, time - actor.metertime);
-        // DropBall or stealing will set metertime back to 0
-        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
-    }
-}
-
-METHOD(BallStealer, wr_setup, void(BallStealer this, entity actor, .entity weaponentity))
-{
-    TC(BallStealer, this);
-    //weapon_setup(WEP_PORTO.m_id);
-}
-
-METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
-{
-    TC(BallStealer, this);
-}
-
-METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
-{
-    TC(BallStealer, this);
-    return true;
-}
-
-METHOD(BallStealer, wr_checkammo2, bool(BallStealer this, entity actor, .entity weaponentity))
-{
-    TC(BallStealer, this);
-    return true;
-}
-
 void nb_DropBall(entity player)
 {
        if(player.ballcarried && g_nexball)
@@ -1134,6 +956,7 @@ MUTATOR_HOOKFUNCTION(nb, SendWaypoint)
 
 REGISTER_MUTATOR(nb, g_nexball)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                g_nexball_meter_period = autocvar_g_nexball_meter_period;
@@ -1153,25 +976,15 @@ REGISTER_MUTATOR(nb, g_nexball)
                InitializeEntity(NULL, nb_delayedinit, INITPRIO_GAMETYPE);
                WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
 
-               ActivateTeamplay();
-               SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, autocvar_timelimit_override, -1);
-               have_team_spawns = -1; // request team spawns
+               GameRules_teams(true);
+               GameRules_limit_score(autocvar_g_nexball_goallimit);
+               GameRules_limit_lead(autocvar_g_nexball_goalleadlimit);
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
        {
                WEP_NEXBALL.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-               // we actually cannot roll back nb_delayedinit here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
        }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
        return 0;
 }
 
diff --git a/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc b/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc
new file mode 100644 (file)
index 0000000..705ac6d
--- /dev/null
@@ -0,0 +1,183 @@
+#include "sv_weapon.qh"
+
+void W_Nexball_Attack(entity actor, .entity weaponentity, float t);
+void W_Nexball_Attack2(entity actor, .entity weaponentity);
+vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
+
+METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
+{
+    TC(BallStealer, thiswep);
+    if(fire & 1)
+        if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
+            if(autocvar_g_nexball_basketball_meter)
+            {
+                if(actor.ballcarried && !actor.metertime)
+                    actor.metertime = time;
+                else
+                    weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
+            }
+            else
+            {
+                W_Nexball_Attack(actor, weaponentity, -1);
+                weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
+            }
+    if(fire & 2)
+        if(weapon_prepareattack(thiswep, actor, weaponentity, true, autocvar_g_balance_nexball_secondary_refire))
+        {
+            W_Nexball_Attack2(actor, weaponentity);
+            weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
+        }
+
+    if(!(fire & 1) && actor.metertime && actor.ballcarried)
+    {
+        W_Nexball_Attack(actor, weaponentity, time - actor.metertime);
+        // DropBall or stealing will set metertime back to 0
+        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
+    }
+}
+
+METHOD(BallStealer, wr_setup, void(BallStealer this, entity actor, .entity weaponentity))
+{
+    TC(BallStealer, this);
+    //weapon_setup(WEP_PORTO.m_id);
+}
+
+METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
+{
+    TC(BallStealer, this);
+}
+
+METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
+{
+    TC(BallStealer, this);
+    return true;
+}
+
+METHOD(BallStealer, wr_checkammo2, bool(BallStealer this, entity actor, .entity weaponentity))
+{
+    TC(BallStealer, this);
+    return true;
+}
+
+void W_Nexball_Think(entity this)
+{
+       //dprint("W_Nexball_Think\n");
+       //vector new_dir = steerlib_arrive(this.enemy.origin, 2500);
+       vector new_dir = normalize(this.enemy.origin + '0 0 50' - this.origin);
+       vector old_dir = normalize(this.velocity);
+       float _speed = vlen(this.velocity);
+       vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed;
+       //vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate
+
+       this.velocity = new_vel;
+
+       this.nextthink = time;
+}
+
+void W_Nexball_Touch(entity this, entity toucher)
+{
+       entity ball, attacker;
+       attacker = this.owner;
+       //this.think = func_null;
+       //this.enemy = NULL;
+
+       PROJECTILE_TOUCH(this, toucher);
+       if(attacker.team != toucher.team || autocvar_g_nexball_basketball_teamsteal)
+               if((ball = toucher.ballcarried) && !STAT(FROZEN, toucher) && !IS_DEAD(toucher) && (IS_PLAYER(attacker)))
+               {
+                       toucher.velocity = toucher.velocity + normalize(this.velocity) * toucher.damageforcescale * autocvar_g_balance_nexball_secondary_force;
+                       UNSET_ONGROUND(toucher);
+                       if(!attacker.ballcarried)
+                       {
+                               LogNB("stole", attacker);
+                               _sound(toucher, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
+
+                               if(SAME_TEAM(attacker, toucher) && time > CS(attacker).teamkill_complain)
+                               {
+                                       CS(attacker).teamkill_complain = time + 5;
+                                       CS(attacker).teamkill_soundtime = time + 0.4;
+                                       CS(attacker).teamkill_soundsource = toucher;
+                               }
+
+                               GiveBall(attacker, toucher.ballcarried);
+                       }
+               }
+       delete(this);
+}
+
+void W_Nexball_Attack(entity actor, .entity weaponentity, float t)
+{
+       entity ball;
+       float mul, mi, ma;
+       if(!(ball = actor.ballcarried))
+               return;
+
+       W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
+       tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL);
+       if(trace_startsolid)
+       {
+               if(actor.metertime)
+                       actor.metertime = 0; // Shot failed, hide the power meter
+               return;
+       }
+
+       //Calculate multiplier
+       if(t < 0)
+               mul = 1;
+       else
+       {
+               mi = autocvar_g_nexball_basketball_meter_minpower;
+               ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
+               //One triangle wave period with 1 as max
+               mul = 2 * (t % g_nexball_meter_period) / g_nexball_meter_period;
+               if(mul > 1)
+                       mul = 2 - mul;
+               mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
+       }
+
+       DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(actor, actor.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, false));
+
+
+       //TODO: use the speed_up cvar too ??
+}
+
+void W_Nexball_Attack2(entity actor, .entity weaponentity)
+{
+       if(actor.ballcarried.enemy)
+       {
+               entity _ball = actor.ballcarried;
+               W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
+               DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32));
+               setthink(_ball, W_Nexball_Think);
+               _ball.nextthink = time;
+               return;
+       }
+
+       if(!autocvar_g_nexball_tackling)
+               return;
+
+       W_SetupShot(actor, weaponentity, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0);
+       entity missile = new(ballstealer);
+
+       missile.owner = actor;
+
+       set_movetype(missile, MOVETYPE_FLY);
+       PROJECTILE_MAKETRIGGER(missile);
+
+       //setmodel(missile, "models/elaser.mdl");  // precision set below
+       setsize(missile, '0 0 0', '0 0 0');
+       setorigin(missile, w_shotorg);
+
+       W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
+       missile.angles = vectoangles(missile.velocity);
+       settouch(missile, W_Nexball_Touch);
+       setthink(missile, SUB_Remove);
+       missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
+
+       missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
+       missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
+       IL_PUSH(g_bot_dodge, missile);
+
+       CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
+}
diff --git a/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qh b/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qh
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
index 223a81f7c4d4dfb6039a3ea6b2189b0df864dfd0..0150de3925ee90072b040e2f5d132cd301a736ad 100644 (file)
@@ -426,8 +426,8 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
                pointparticles(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname);
 
-               PlayerScore_Add(attacker, SP_ONS_TAKES, 1);
-               PlayerScore_Add(attacker, SP_SCORE, 10);
+               GameRules_scoring_add(attacker, ONS_TAKES, 1);
+               GameRules_scoring_add(attacker, SCORE, 10);
 
                this.owner.goalentity = NULL;
                this.owner.islinked = false;
@@ -555,8 +555,8 @@ void ons_ControlPoint_Icon_BuildThink(entity this)
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message);
                        Send_Notification(NOTIF_ALL_EXCEPT, this.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(this.owner.ons_toucher.team, CENTER_ONS_CAPTURE_TEAM), this.owner.message);
                        Send_Notification(NOTIF_ONE, this.owner.ons_toucher, MSG_CENTER, CENTER_ONS_CAPTURE, this.owner.message);
-                       PlayerScore_Add(this.owner.ons_toucher, SP_ONS_CAPS, 1);
-                       PlayerTeamScore_AddScore(this.owner.ons_toucher, 10);
+                       GameRules_scoring_add(this.owner.ons_toucher, ONS_CAPS, 1);
+                       GameRules_scoring_add_team(this.owner.ons_toucher, SCORE, 10);
                }
 
                this.owner.ons_toucher = NULL;
@@ -911,7 +911,7 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d
                else
                {
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED));
-                       PlayerScore_Add(attacker, SP_SCORE, 100);
+                       GameRules_scoring_add(attacker, SCORE, 100);
                }
                this.iscaptured = false;
                this.islinked = false;
@@ -1377,8 +1377,8 @@ void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale
                        best.cnt += 1;
 
                        this.havocbot_attack_time = 0;
-                       if(checkpvs(this.view_ofs,cp))
-                       if(checkpvs(this.view_ofs,best))
+                       if(checkpvs(this.origin + this.view_ofs, cp))
+                       if(checkpvs(this.origin + this.view_ofs, best))
                                this.havocbot_attack_time = time + 2;
                }
                else
@@ -1448,8 +1448,8 @@ bool havocbot_goalrating_ons_generator_attack(entity this, float ratingscale)
                        bestwp.cnt += 1;
 
                        this.havocbot_attack_time = 0;
-                       if(checkpvs(this.view_ofs,g))
-                       if(checkpvs(this.view_ofs,bestwp))
+                       if(checkpvs(this.origin + this.view_ofs, g))
+                       if(checkpvs(this.origin + this.view_ofs, bestwp))
                                this.havocbot_attack_time = time + 5;
 
                        return true;
@@ -2174,11 +2174,11 @@ void ons_ScoreRules()
        if(c2 >= 0) teams |= BIT(1);
        if(c3 >= 0) teams |= BIT(2);
        if(c4 >= 0) teams |= BIT(3);
-       ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
-       ScoreInfo_SetLabel_TeamScore  (ST_ONS_CAPS,     "destroyed", SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_ONS_CAPS,    "caps",      SFL_SORT_PRIO_SECONDARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_ONS_TAKES,    "takes",     0);
-       ScoreRules_basics_end();
+       GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
+           field_team(ST_ONS_CAPS, "destroyed", SFL_SORT_PRIO_PRIMARY);
+           field(SP_ONS_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+           field(SP_ONS_TAKES, "takes", 0);
+       });
 }
 
 void ons_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up
index 0757d7bc6014645c37260a1620563ea066aca9bf..5c7fd469735b1e38cad2abdf8e11165d9ffb3d66 100644 (file)
@@ -5,30 +5,14 @@ void ons_Initialize();
 
 REGISTER_MUTATOR(ons, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               ons_Initialize();
-
-               ActivateTeamplay();
-               SetLimits(autocvar_g_onslaught_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
-               have_team_spawns = -1; // request team spawns
-       }
+               GameRules_teams(true);
+               GameRules_limit_score(autocvar_g_onslaught_point_limit);
 
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back ons_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               ons_Initialize();
        }
-
        return false;
 }
 
diff --git a/qcsrc/common/gamemodes/rules.qc b/qcsrc/common/gamemodes/rules.qc
new file mode 100644 (file)
index 0000000..5cfbba2
--- /dev/null
@@ -0,0 +1 @@
+#include "rules.qh"
diff --git a/qcsrc/common/gamemodes/rules.qh b/qcsrc/common/gamemodes/rules.qh
new file mode 100644 (file)
index 0000000..542548d
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#ifdef SVQC
+#include <common/gamemodes/sv_rules.qh>
+#endif
diff --git a/qcsrc/common/gamemodes/sv_rules.qc b/qcsrc/common/gamemodes/sv_rules.qc
new file mode 100644 (file)
index 0000000..a4a4bcd
--- /dev/null
@@ -0,0 +1,112 @@
+#include "sv_rules.qh"
+
+#include <server/teamplay.qh>
+
+void GameRules_teams(bool value)
+{
+    if (value) {
+        serverflags |= SERVERFLAG_TEAMPLAY;
+        teamplay = 1;
+        cvar_set("teamplay", "2");  // DP needs this for sending proper getstatus replies.
+        GameRules_spawning_teams(true);
+    } else {
+       serverflags &= ~SERVERFLAG_TEAMPLAY;
+       teamplay = 0;
+       cvar_set("teamplay", "0");  // DP needs this for sending proper getstatus replies.
+       GameRules_spawning_teams(false);
+    }
+}
+
+void GameRules_spawning_teams(bool value)
+{
+    have_team_spawns = value ? -1 : 0;
+}
+
+bool _GameRules_score_enabled = true;
+void GameRules_score_enabled(bool value)
+{
+    _GameRules_score_enabled = value;
+}
+
+bool GameRules_limit_score_initialized;
+void GameRules_limit_score(int limit)
+{
+    if (GameRules_limit_score_initialized) return;
+    if (autocvar_g_campaign) return;
+    if (limit < 0) return;
+    cvar_set("fraglimit", ftos(limit));
+    GameRules_limit_score_initialized = true;
+}
+
+bool GameRules_limit_lead_initialized;
+void GameRules_limit_lead(int limit)
+{
+    if (GameRules_limit_lead_initialized) return;
+    if (autocvar_g_campaign) return;
+    if (limit < 0) return;
+    cvar_set("leadlimit", ftos(limit));
+    GameRules_limit_lead_initialized = true;
+}
+
+bool GameRules_limit_time_initialized;
+void GameRules_limit_time(int limit)
+{
+    if (GameRules_limit_time_initialized) return;
+    if (autocvar_g_campaign) return;
+    if (limit < 0) return;
+    cvar_set("timelimit", ftos(limit));
+    GameRules_limit_time_initialized = true;
+}
+
+bool GameRules_limit_time_qualifying_initialized;
+void GameRules_limit_time_qualifying(int limit)
+{
+    if (GameRules_limit_time_qualifying_initialized) return;
+    if (autocvar_g_campaign) return;
+    if (limit < 0) return;
+    cvar_set("g_race_qualifying_timelimit", ftos(limit));
+    GameRules_limit_time_qualifying_initialized = true;
+}
+
+void GameRules_limit_fallbacks()
+{
+    GameRules_limit_score(autocvar_fraglimit_override);
+    GameRules_limit_lead(autocvar_leadlimit_override);
+    GameRules_limit_time(autocvar_timelimit_override);
+}
+
+void _GameRules_scoring_begin(int teams, float spprio, float stprio)
+{
+    ScoreRules_basics(teams, spprio, stprio, _GameRules_score_enabled);
+}
+void _GameRules_scoring_field(entity i, string label, int scoreflags)
+{
+    ScoreInfo_SetLabel_PlayerScore(i, label, scoreflags);
+}
+void _GameRules_scoring_field_team(float i, string label, int scoreflags)
+{
+    ScoreInfo_SetLabel_TeamScore(i, label, scoreflags);
+}
+void _GameRules_scoring_end()
+{
+    ScoreRules_basics_end();
+}
+
+.bool m_GameRules_scoring_vip;
+void GameRules_scoring_vip(entity player, bool value)
+{
+    player.m_GameRules_scoring_vip = value;
+}
+bool GameRules_scoring_is_vip(entity player)
+{
+    return player.m_GameRules_scoring_vip;
+}
+
+float _GameRules_scoring_add(entity client, entity sp, float value)
+{
+    return PlayerScore_Add(client, sp, value);
+}
+float _GameRules_scoring_add_team(entity client, entity sp, int st, float value)
+{
+    return PlayerTeamScore_Add(client, sp, st, value);
+}
diff --git a/qcsrc/common/gamemodes/sv_rules.qh b/qcsrc/common/gamemodes/sv_rules.qh
new file mode 100644 (file)
index 0000000..35a643d
--- /dev/null
@@ -0,0 +1,56 @@
+#pragma once
+
+// todo: accept the number of teams as a parameter
+void GameRules_teams(bool value);
+
+/**
+ * Used to disable team spawns in team modes
+ */
+void GameRules_spawning_teams(bool value);
+
+/**
+ * Disabling score disables the "score" column on the scoreboard
+ */
+void GameRules_score_enabled(bool value);
+
+void GameRules_limit_score(int limit);
+void GameRules_limit_lead(int limit);
+void GameRules_limit_time(int limit);
+void GameRules_limit_time_qualifying(int limit);
+
+/**
+ * Set any unspecified rules to their defaults
+ */
+void GameRules_limit_fallbacks();
+
+/**
+ * @param teams a bitmask of active teams
+ * @param spprio player score priority (if frags aren't enabled)
+ * @param stprio team score priority (if frags aren't enabled)
+ */
+#define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN { \
+    _GameRules_scoring_begin((teams), (spprio), (stprio)); \
+    noref void(entity, string, float) field = _GameRules_scoring_field; \
+    /* todo: just have the one `field` function */ \
+    noref void(int, string, float) field_team = _GameRules_scoring_field_team; \
+    LAMBDA(fields); \
+    _GameRules_scoring_end(); \
+} MACRO_END
+
+void _GameRules_scoring_begin(int teams, float spprio, float stprio);
+void _GameRules_scoring_field(entity i, string label, int scoreflags);
+void _GameRules_scoring_field_team(float i, string label, int scoreflags);
+void _GameRules_scoring_end();
+
+/**
+ * Mark a player as being 'important' (flag carrier, ball carrier, etc)
+ * @param player the entity to mark
+ * @param value VIP status
+ */
+void GameRules_scoring_vip(entity player, bool value);
+bool GameRules_scoring_is_vip(entity player);
+
+#define GameRules_scoring_add(client, fld, value) _GameRules_scoring_add(client, SP_##fld, value)
+float _GameRules_scoring_add(entity client, entity sp, float value);
+#define GameRules_scoring_add_team(client, fld, value) _GameRules_scoring_add_team(client, SP_##fld, ST_##fld, value)
+float _GameRules_scoring_add_team(entity client, entity sp, int st, float value);
index 14c5a347ad26f534158fb635fc5a8ccbb9eb0cdf..623f71b3904ab7654d9e9e88e23291c45d84bb09 100644 (file)
@@ -26,7 +26,7 @@ GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
         }
         default:
         case CMD_REQUEST_USAGE: {
-            LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+            LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
             return;
         }
     }
index 7072261b781b75b797806df8949fcb83ecb8f550..c302ae40281d43699b335ab24a7d382b7d3d667e 100644 (file)
@@ -67,7 +67,7 @@ CLASS(GameItem, Object)
     METHOD(GameItem, show, void(GameItem this))
     {
         TC(GameItem, this);
-        LOG_INFO("A game item\n");
+        LOG_INFO("A game item");
     }
     void ITEM_HANDLE(Show, GameItem this) { this.show(this); }
 ENDCLASS(GameItem)
index fae573c70c5551695c24beccdaf7f4f51563d4aa..39cf78cc3016e3d3b4714bcf169c843892342f59 100644 (file)
@@ -37,7 +37,7 @@ CLASS(Pickup, GameItem)
     METHOD(Pickup, show, void(Pickup this))
     {
         TC(Pickup, this);
-        LOG_INFOF("%s: %s\n", etos(this), this.m_name);
+        LOG_INFOF("%s: %s", etos(this), this.m_name);
     }
     ATTRIB(Pickup, m_itemid, int, 0);
 #ifdef SVQC
index f6a14814bcbab1ac1982ec4f0b9905b0eced93af..62600a9c4b07fec9deb809985b6c88df86aab09b 100644 (file)
@@ -283,7 +283,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        }
        if(fh < 0)
                return 0;
-       LOG_INFO("Analyzing ", fn, " to generate initial mapinfo\n");
+       LOG_INFO("Analyzing ", fn, " to generate initial mapinfo");
 
        inWorldspawn = 2;
        MapInfo_Map_flags = 0;
@@ -1190,7 +1190,7 @@ void MapInfo_LoadMap(string s, float reinit)
        //      MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH.m_flags);
        //}
 
-       LOG_INFO("Switching to map ", s, "\n");
+       LOG_INFO("Switching to map ", s);
 
        cvar_settemp_restore();
        if(reinit)
index 4c0fd782904bab4993f0839d428210bb42b2746d..2dd84596e46991e8f3f75daeb63b524273825d01 100644 (file)
@@ -458,7 +458,7 @@ REGISTER_GAMETYPE(KEEPAWAY, NEW(Keepaway));
 CLASS(Invasion, Gametype)
     INIT(Invasion)
     {
-        this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0",_("Survive against waves of monsters"));
+        this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0 type=0",_("Survive against waves of monsters"));
     }
     METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
     {
@@ -466,6 +466,9 @@ CLASS(Invasion, Gametype)
             case "teams":
                 cvar_set("g_invasion_teams", v);
                 return true;
+            case "type":
+                cvar_set("g_invasion_type", v);
+                return true;
         }
         return false;
     }
index cda2e5d261368c5088beac39f9a60d71b4f98e46..4790f1f1f785eaba2d48eb66a07fbb932a1d8f3f 100644 (file)
@@ -348,7 +348,7 @@ void bd_move(entity minigame, entity player, string dir)
                        entity dozer = bd_find_dozer(minigame);
                        if(!dozer)
                        {
-                               LOG_INFO("Dozer wasn't found!\n");
+                               LOG_INFO("Dozer wasn't found!");
                                return; // should not happen... TODO: end match?
                        }
 
@@ -740,7 +740,7 @@ bool bd_save_level(entity minigame)
 
                if(boulder_count != target_count)
                {
-                       LOG_INFO("Not enough targets or boulders, fix your level!\n");
+                       LOG_INFO("Not enough targets or boulders, fix your level!");
                        return false;
                }
 
@@ -791,7 +791,7 @@ void bd_load_level(entity minigame)
        file_get = fopen(file_name, FILE_READ);
        if(file_get < 0)
        {
-               LOG_INFO("^3BULLDOZER: ^7could not find storage file ^3", file_name, "^7, no items were loaded\n");
+               LOG_INFO("^3BULLDOZER: ^7could not find storage file ^3", file_name, "^7, no items were loaded");
        }
        else
        {
@@ -829,7 +829,7 @@ void bd_close_editor(entity minigame, entity player)
        entity dozer = bd_find_dozer(minigame);
        if(!dozer)
        {
-               LOG_INFO("You need to place a bulldozer on the level to save it!\n");
+               LOG_INFO("You need to place a bulldozer on the level to save it!");
                return;
        }
 
@@ -840,7 +840,7 @@ void bd_close_editor(entity minigame, entity player)
        }
        else
        {
-               LOG_INFO("You need to set the level name!\n");
+               LOG_INFO("You need to set the level name!");
                return;
        }
 }
index b03766bcf234b55d4753b5c65a1c2dddb1b91922..338acacd61fdb343357451cc09c801526196cc2e 100644 (file)
@@ -50,7 +50,7 @@ void M_Shambler_Attack_Swing(entity this)
        Monster_Attack_Melee(this, this.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((random() >= 0.5) ? this.anim_melee2 : this.anim_melee3), this.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW.m_id, true);
 }
 
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
 
 void M_Shambler_Attack_Lightning_Explode(entity this, entity directhitentity)
 {
index 5307ccd2de7324b0cb9430d3b6481295f04b0dbe..80cd21b481b41474dcf860d2d42178c95428f228 100644 (file)
@@ -943,7 +943,7 @@ void Monster_Dead(entity this, entity attacker, float gibbed)
 
        if(IS_PLAYER(attacker))
        if(autocvar_g_monsters_score_spawned || !((this.spawnflags & MONSTERFLAG_SPAWNED) || (this.spawnflags & MONSTERFLAG_RESPAWNED)))
-               PlayerScore_Add(attacker, SP_SCORE, +autocvar_g_monsters_score_kill);
+               GameRules_scoring_add(attacker, SCORE, +autocvar_g_monsters_score_kill);
 
        if(gibbed)
        {
index 4bbe2ce3d8f8a94fc336a0165e8009d0c16b0767..d6989ad31839d52229cc8f612879fd6c83ab8686 100644 (file)
@@ -16,11 +16,12 @@ entity spawnmonster (entity e, string monster, int monster_id, entity spawnedby,
        //if(invincible) { e.spawnflags |= MONSTERFLAG_INVINCIBLE; }
 
        setorigin(e, orig);
+       bool allow_any = boolean(monster == "anyrandom");
 
-       if(monster == "random")
+       if(monster == "random" || allow_any)
        {
                RandomSelection_Init();
-               FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN),
+               FOREACH(Monsters, it != MON_Null && (allow_any || (!(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN))),
                {
                        RandomSelection_AddEnt(it, 1, 1);
                });
index 2b932b275fd61a068ae2b42d618533632ef68b66..4f940c42b3c016f3e9131e0c6d3b213bc4d5497a 100644 (file)
@@ -280,6 +280,20 @@ STATIC_INIT_LATE(Mutators) {
 #define MUTATOR_ONADD                   if (mode == MUTATOR_ADDING)
 #define MUTATOR_ONREMOVE                if (mode == MUTATOR_REMOVING)
 #define MUTATOR_ONROLLBACK_OR_REMOVE    if (mode == MUTATOR_REMOVING || mode == MUTATOR_ROLLING_BACK)
+
+#define MUTATOR_STATIC() MACRO_BEGIN { \
+    MUTATOR_ONADD { \
+        /* game loads at time 1 */ \
+        if (time > 1) { \
+            error("This is a game type and it cannot be added at runtime."); \
+        } \
+    } \
+       MUTATOR_ONREMOVE { \
+               LOG_INFO("This is a game type and it cannot be removed at runtime."); \
+               return -1; \
+       } \
+} MACRO_END
+
 #define MUTATOR_ADD(name)               Mutator_Add(MUTATOR_##name)
 #define MUTATOR_REMOVE(name)            Mutator_Remove(MUTATOR_##name)
 #define MUTATOR_RETURNVALUE             CallbackChain_ReturnValue
@@ -305,7 +319,7 @@ STATIC_INIT_LATE(Mutators) {
 #define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN {                     \
     MUTATOR_ONADD {                                                     \
         if (!CallbackChain_Add(HOOK_##cb, CALLBACK_##func, order)) {    \
-            LOG_INFO("HOOK FAILED: ", #cb, ":", #func, "\n");           \
+            LOG_INFO("HOOK FAILED: ", #cb, ":", #func);                 \
             return true;                                                \
         }                                                               \
     }                                                                   \
index fbb6bcb75762a567ba80cbed3ca1d542b70a74d5..bafe8c460733dae6c492706f8a8b6eb0fb405567 100644 (file)
@@ -158,13 +158,9 @@ CLASS(DamageText, Object)
         if (this.text) strunzone(this.text);
         this.text = strzone(s);
 
-        float size_range = autocvar_cl_damagetext_size_max - autocvar_cl_damagetext_size_min;
-        float damage_range = autocvar_cl_damagetext_size_max_damage - autocvar_cl_damagetext_size_min_damage;
-        float scale_factor = size_range / damage_range;
-        this.m_size = bound(
-            autocvar_cl_damagetext_size_min,
-            (potential - autocvar_cl_damagetext_size_min_damage) * scale_factor + autocvar_cl_damagetext_size_min,
-            autocvar_cl_damagetext_size_max);
+        this.m_size = map_bound_ranges(potential,
+            autocvar_cl_damagetext_size_min_damage, autocvar_cl_damagetext_size_max_damage,
+            autocvar_cl_damagetext_size_min, autocvar_cl_damagetext_size_max);
     }
 
     CONSTRUCTOR(DamageText, int _group, vector _origin, bool _screen_coords, int _health, int _armor, int _potential_damage, int _deathtype, bool _friendlyfire) {
@@ -236,7 +232,11 @@ NET_HANDLE(damagetext, bool isNew)
             }
         }
         make_impure(NEW(DamageText, server_entity_index, entcs.origin, false, health, armor, potential_damage, deathtype, friendlyfire));
-    } else if (autocvar_cl_damagetext_2d) {
+    } else if (autocvar_cl_damagetext_2d && spectatee_status != -1) {
+        // never show 2d damagetext when observing
+        // on some maps (hearth_v2, The_Yard), sometimes has_origin is false even though observers should know about all players
+        // it happens mostly with bots but occasionally also with players
+
         // screen coords only
         vector screen_pos = vec2(vid_conwidth * autocvar_cl_damagetext_2d_pos.x, vid_conheight * autocvar_cl_damagetext_2d_pos.y);
         IL_EACH(g_drawables_2d, it.instanceOfDamageText && it.m_screen_coords && it.m_group == server_entity_index, {
index 0e170e57ec6249fd4e3ed9e82a284145f691a078..4a18cc930879ad34e28ef7551c7af1e381bf8d46 100644 (file)
@@ -1,13 +1,13 @@
 #include "sv_damagetext.qh"
 
-AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: spectators, >= 2: players, >= 3: all players");
+AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage");
 
 REGISTER_MUTATOR(damagetext, true);
 
-#define SV_DAMAGETEXT_DISABLED()        (autocvar_sv_damagetext <= 0 /* disabled */)
-#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1 /* spectators only */)
-#define SV_DAMAGETEXT_PLAYERS()         (autocvar_sv_damagetext >= 2 /* players */)
-#define SV_DAMAGETEXT_ALL()             (autocvar_sv_damagetext >= 3 /* all players */)
+#define SV_DAMAGETEXT_DISABLED()        (autocvar_sv_damagetext <= 0 || autocvar_g_instagib)
+#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1)
+#define SV_DAMAGETEXT_PLAYERS()         (autocvar_sv_damagetext >= 2)
+#define SV_DAMAGETEXT_ALL()             (autocvar_sv_damagetext >= 3)
 MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
     if (SV_DAMAGETEXT_DISABLED()) return;
     const entity attacker = M_ARGV(0, entity);
index d62aa42c4e529e8c64ff85798a8e4a85b98534b9..70aac4d9a3fcda663448d035199f3d46b93dc1a0 100644 (file)
@@ -104,19 +104,20 @@ REGISTER_MUTATOR(dodging, true);
 .int pressedkeys;
 #endif
 
-// returns 1 if the player is close to a wall
+// returns true if the player is close to a wall
 bool check_close_to_wall(entity this, float threshold)
 {
        if (PHYS_DODGING_WALL == 0) { return false; }
 
-#define X(OFFSET) \
-       tracebox(this.origin, this.mins, this.maxs, this.origin + OFFSET, true, this); \
-       if(trace_fraction < 1 && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) && vdist(this.origin - trace_endpos, <, threshold)) \
+#define X(dir) \
+       tracebox(this.origin, this.mins, this.maxs, this.origin + threshold * dir, true, this); \
+       if (trace_fraction < 1 && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) \
                return true;
-       X(1000*v_right);
-       X(-1000*v_right);
-       X(1000*v_forward);
-       X(-1000*v_forward);
+
+       X(v_right);
+       X(-v_right);
+       X(v_forward);
+       X(-v_forward);
 #undef X
 
        return false;
index 090ff82a362f22c7555f851b4c3477ebcfac18fa..18edd482d3c5b942092032ae2bf1371be5d2a2cf 100644 (file)
@@ -889,20 +889,18 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
        delete(e.fake_nade);
        e.fake_nade = NULL;
 
+       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
+
        makevectors(e.v_angle);
 
        // NOTE: always throw from first weapon entity?
        W_SetupShot(e, _nade.weaponentity_fld, false, false, SND_Null, CH_WEAPON_A, 0);
 
-       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
-
        vector offset = (v_forward * autocvar_g_nades_throw_offset.x)
-                                 + (v_right * autocvar_g_nades_throw_offset.y)
-                                 + (v_up * autocvar_g_nades_throw_offset.z);
-       if(autocvar_g_nades_throw_offset == '0 0 0')
-               offset = '0 0 0';
+                     + (v_right * autocvar_g_nades_throw_offset.y)
+                     + (v_up * autocvar_g_nades_throw_offset.z);
 
-       setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
+       setorigin(_nade, w_shotorg + offset);
        //setmodel(_nade, MDL_PROJECTILE_NADE);
        //setattachment(_nade, NULL, "");
        PROJECTILE_MAKETRIGGER(_nade);
@@ -1240,7 +1238,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
                        FOR_EACH_KH_KEY(key) if(key.owner == player) { ++key_count; }
 
                        float time_score;
-                       if(player.flagcarried || player.ballcarried) // this player is important
+                       if(GameRules_scoring_is_vip(player))
                                time_score = autocvar_g_nades_bonus_score_time_flagcarrier;
                        else
                                time_score = autocvar_g_nades_bonus_score_time;
@@ -1379,7 +1377,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
 
                if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target)
                        nades_RemoveBonus(frag_attacker);
-               else if(frag_target.flagcarried)
+               else if(GameRules_scoring_is_vip(frag_target))
                        nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_medium);
                else if(autocvar_g_nades_bonus_score_spree && CS(frag_attacker).killcount > 1)
                {
@@ -1481,11 +1479,6 @@ MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
        M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
 }
 
-MUTATOR_HOOKFUNCTION(nades, BuildMutatorsPrettyString)
-{
-       M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Nades");
-}
-
 MUTATOR_HOOKFUNCTION(nades, BuildGameplayTipsString)
 {
        M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3nades^8 are enabled, press 'g' to use them\n");
index 277a4e7dba0155fbaab58120edbd3ca6742a836c..288c2d5c8363ea473d824edf867275700221b677 100644 (file)
@@ -94,7 +94,7 @@ REGISTER_MUTATOR(nt, cvar("g_new_toys") && !cvar("g_instagib") && !cvar("g_overk
 
        MUTATOR_ONREMOVE
        {
-               LOG_INFO("This cannot be removed at runtime\n");
+               LOG_INFO("This cannot be removed at runtime");
                return -1;
        }
 
index f39c4fc0f7ef7ca4edb7d37780569c436016f9fe..d2a7308dedf04267af31ea7b599a4abd447ca08f 100644 (file)
@@ -303,19 +303,8 @@ MUTATOR_HOOKFUNCTION(ok, SetModname)
        return true;
 }
 
-void ok_SetCvars()
-{
-       // hack to force overkill playermodels
-       cvar_settemp("sv_defaultcharacter", "1");
-       cvar_settemp("sv_defaultplayermodel", "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm");
-       cvar_settemp("sv_defaultplayermodel_red", "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm");
-       cvar_settemp("sv_defaultplayermodel_blue", "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm");
-}
-
 void ok_Initialize()
 {
-       ok_SetCvars();
-
        precache_all_playermodels("models/ok_player/*.dpm");
 
        WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
index 62b30e2d14785e9f9745d4a2059e9b13946046fa..62781c92073cfbd11278ea0313364bdac5bc0d8e 100644 (file)
@@ -23,7 +23,7 @@ REGISTER_MUTATOR(physical_items, cvar("g_physical_items"))
 
        MUTATOR_ONREMOVE
        {
-               LOG_INFO("This cannot be removed at runtime\n");
+               LOG_INFO("This cannot be removed at runtime");
                return -1;
        }
 
index 0fd58c6804bbc8e2eac1a1f42b0fcda86d15455d..93dc602f0299df56c21597ea6cf966e951d2db78 100644 (file)
@@ -407,7 +407,7 @@ void sandbox_Database_Load()
        if(file_get < 0)
        {
                if(autocvar_g_sandbox_info > 0)
-                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded\n"));
+                       LOG_INFO("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded");
        }
        else
        {
@@ -432,7 +432,7 @@ void sandbox_Database_Load()
                        }
                }
                if(autocvar_g_sandbox_info > 0)
-                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name, "\n"));
+                       LOG_INFO("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name);
        }
        fclose(file_get);
 }
@@ -524,7 +524,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                _setmodel(e, argv(2));
 
                                if(autocvar_g_sandbox_info > 0)
-                                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
+                                       LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " spawned an object at origin ^3", vtos(e.origin));
                                return true;
 
                        // ---------------- COMMAND: OBJECT, REMOVE ----------------
@@ -533,7 +533,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                if(e != NULL)
                                {
                                        if(autocvar_g_sandbox_info > 0)
-                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
+                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin));
                                        sandbox_ObjectRemove(e);
                                        return true;
                                }
@@ -582,7 +582,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
 
                                                print_to(player, "^2SANDBOX - INFO: ^7Object pasted successfully");
                                                if(autocvar_g_sandbox_info > 0)
-                                                       LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
+                                                       LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " pasted an object at origin ^3", vtos(e.origin));
                                                return true;
                                }
                                return true;
@@ -617,7 +617,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                                        player.object_attach = NULL; // object was attached, no longer keep it scheduled for attachment
                                                        print_to(player, "^2SANDBOX - INFO: ^7Object attached successfully");
                                                        if(autocvar_g_sandbox_info > 1)
-                                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
+                                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin));
                                                        return true;
                                                }
                                                print_to(player, "^1SANDBOX - WARNING: ^7Object could not be attached to the parent. Make sure you are facing an object that you have edit rights over");
@@ -630,7 +630,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                                        sandbox_ObjectAttach_Remove(e);
                                                        print_to(player, "^2SANDBOX - INFO: ^7Child objects detached successfully");
                                                        if(autocvar_g_sandbox_info > 1)
-                                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " detached objects at origin ^3", vtos(e.origin), "\n"));
+                                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " detached objects at origin ^3", vtos(e.origin));
                                                        return true;
                                                }
                                                print_to(player, "^1SANDBOX - WARNING: ^7Child objects could not be detached. Make sure you are facing an object that you have edit rights over");
@@ -721,7 +721,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
                                        e.message2 = strzone(strftime(true, "%d-%m-%Y %H:%M:%S"));
 
                                        if(autocvar_g_sandbox_info > 1)
-                                               LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
+                                               LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin));
                                        return true;
                                }
 
index 3a435c5ed1dea13ad797e4097e1a79c749b319cf..92c5943c3d75455f7bc3d41b6f95184df7ba8555 100644 (file)
@@ -12,8 +12,7 @@ MUTATOR_HOOKFUNCTION(vampire, PlayerDamage_SplitHealthArmor)
        if(frag_target != frag_attacker)
        if(!IS_DEAD(frag_target))
        {
-               frag_attacker.health += bound(0, damage_take, frag_target.health);
-               frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit);
+               GivePlayerHealth(frag_attacker, bound(0, damage_take, frag_target.health));
        }
 }
 
index 9e20392236ea32ccb73948c1a5707d93c304f1df..6dec163fa237c97f0492f9dfc83a32fadb79f425 100644 (file)
@@ -530,7 +530,7 @@ void Draw_WaypointSprite(entity this)
     if (rgb == '0 0 0')
     {
         this.teamradar_color = '1 0 1';
-        LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+        LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage);
     }
 
     if (time - floor(time) > 0.5)
index 9fac59d5b788835901ee76126f2eb1eca2388a57..b9350758a115fb6ab3558c86e867a5e62d549c73 100644 (file)
@@ -200,7 +200,7 @@ string Process_Notif_Line(
                LOG_INFOF(
                        (
                                "^1TRAILING NEW LINE AT END OF NOTIFICATION: "
-                               "^7net_type = %s, net_name = %s, string = %s.\n"
+                               "^7net_type = %s, net_name = %s, string = %s."
                        ),
                        notiftype,
                        notifname,
@@ -235,7 +235,7 @@ string Process_Notif_Args(
                                        LOG_INFOF(
                                                (
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
-                                                       "^7net_type = %s, net_name = %s, max args = %d.\n"
+                                                       "^7net_type = %s, net_name = %s, max args = %d."
                                                ),
                                                notiftype,
                                                notifname,
@@ -267,7 +267,7 @@ string Process_Notif_Args(
                                                LOG_INFOF(
                                                        (
                                                                "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
-                                                               "^7net_type = %s, net_name = %s, args arg = '%s'.\n"
+                                                               "^7net_type = %s, net_name = %s, args arg = '%s'."
                                                        ),
                                                        notiftype,
                                                        notifname,
@@ -286,7 +286,7 @@ string Process_Notif_Args(
                                        LOG_INFOF(
                                                (
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
-                                                       "^7net_type = %s, net_name = %s, max hudargs = %d.\n"
+                                                       "^7net_type = %s, net_name = %s, max hudargs = %d."
                                                ),
                                                notiftype,
                                                notifname,
@@ -318,7 +318,7 @@ string Process_Notif_Args(
                                                LOG_INFOF(
                                                        (
                                                                "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
-                                                               "^7net_type = %s, net_name = %s, hudargs arg = '%s'.\n"
+                                                               "^7net_type = %s, net_name = %s, hudargs arg = '%s'."
                                                        ),
                                                        notiftype,
                                                        notifname,
@@ -337,7 +337,7 @@ string Process_Notif_Args(
                                        LOG_INFOF(
                                                (
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
-                                                       "^7net_type = %s, net_name = %s, max durcnt = %d.\n"
+                                                       "^7net_type = %s, net_name = %s, max durcnt = %d."
                                                ),
                                                notiftype,
                                                notifname,
@@ -372,7 +372,7 @@ string Process_Notif_Args(
                                                        LOG_INFOF(
                                                                (
                                                                        "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
-                                                                       "^7net_type = %s, net_name = %s, durcnt arg = '%s'.\n"
+                                                                       "^7net_type = %s, net_name = %s, durcnt arg = '%s'."
                                                                ),
                                                                notiftype,
                                                                notifname,
@@ -421,7 +421,7 @@ void Create_Notification_Entity(entity notif,
                        LOG_INFOF(
                                (
                                        "^1NOTIFICATION WITH IMPROPER TYPE: "
-                                       "^7net_type = %d, net_name = %s.\n"
+                                       "^7net_type = %d, net_name = %s."
                                ),
                                typeId,
                                namestring
@@ -471,7 +471,7 @@ void Create_Notification_Entity_Annce(entity notif,
                                        LOG_INFOF(
                                                (
                                                        "^1NOTIFICATION WITH NO SOUND: "
-                                                       "^7net_type = %s, net_name = %s.\n"
+                                                       "^7net_type = %s, net_name = %s."
                                                ),
                                                typestring,
                                                namestring
@@ -529,7 +529,7 @@ void Create_Notification_Entity_InfoCenter(entity notif,
                                                LOG_INFOF(
                                                        (
                                                                "^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: "
-                                                               "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d\n"
+                                                               "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d"
                                                        ),
                                                        typestring,
                                                        namestring,
@@ -563,7 +563,7 @@ void Create_Notification_Entity_InfoCenter(entity notif,
                                                LOG_INFOF(
                                                        (
                                                                "^1NOTIFICATION HAS HUDARGS BUT NO ICON: "
-                                                               "^7net_type = %s, net_name = %s.\n"
+                                                               "^7net_type = %s, net_name = %s."
                                                        ),
                                                        typestring,
                                                        namestring
@@ -635,7 +635,7 @@ void Create_Notification_Entity_InfoCenter(entity notif,
                                        LOG_INFOF(
                                                (
                                                        "^1EMPTY NOTIFICATION: "
-                                                       "^7net_type = %s, net_name = %s.\n"
+                                                       "^7net_type = %s, net_name = %s."
                                                ),
                                                typestring,
                                                namestring
@@ -661,7 +661,7 @@ void Create_Notification_Entity_Multi(entity notif,
                                LOG_INFOF(
                                        (
                                                "^1NOTIFICATION WITH NO SUBCALLS: "
-                                               "^7net_type = %s, net_name = %s.\n"
+                                               "^7net_type = %s, net_name = %s."
                                        ),
                                        typestring,
                                        namestring
@@ -713,7 +713,7 @@ void Create_Notification_Entity_Choice(entity notif,
                                LOG_INFOF(
                                        (
                                                "^1NOTIFICATION IS MISSING CHOICE PARAMS: "
-                                               "^7net_type = %s, net_name = %s.\n"
+                                               "^7net_type = %s, net_name = %s."
                                        ),
                                        typestring,
                                        namestring
index 4cc59a5d000a1cdebaf3f0f654ca48ad2961c406..1721303ab526a6d2fc93d5a406d99b5ad1973d43 100644 (file)
@@ -181,25 +181,25 @@ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt"
                        if (fh >= 0)
                        {
                                Dump_Notifications(fh, alsoprint);
-                               LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
+                               LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.", filename);
                                fclose(fh);
                        }
                        else
                        {
-                               LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
+                               LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
                        }
                        #else
-                       LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+                       LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd."));
                        #endif
                        return;
                }
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
-                       LOG_INFO("  Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
-                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
-                       LOG_INFO("  if left blank, it will only write to default.\n");
+                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]");
+                       LOG_INFO("  Where 'filename' is the file to write (default is notifications_dump.cfg),");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,");
+                       LOG_INFO("  if left blank, it will only write to default.");
                        return;
                }
        }
index 34518bda58467bc6f7236a282a952349fa0329af..20e2d4cc32f16d0b736e421d0a1172262492ff7c 100644 (file)
@@ -491,7 +491,7 @@ void SpecialCommand(entity this)
        if(autocvar_sv_cheats || this.maycheat)
        {
                if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
-                       LOG_INFO("A hollow voice says \"Plugh\".\n");
+                       LOG_INFO("A hollow voice says \"Plugh\".");
        }
        else
                STAT(MOVEVARS_SPECIALCOMMAND, this) = true;
index 7e0d397f38a8f3bf139438e5422a2df8038d54ce..d5a8e605af8a5b1721fa4d478b35d7de88727cc7 100644 (file)
@@ -190,6 +190,13 @@ STATIC_INIT(PHYS_INPUT_BUTTON_DODGE)
        .int items;
 
        .vector movement;
+
+       // angles of the player's view (as opposed to their model which uses `.vector angles;`) in degrees
+       // x is pitch: positive means down (unlike .angles)
+       // y is yaw: between -180 and 180, increases when turning left
+       // z is roll: positive means tilted clockwise, usually is 0
+       // when .fixangle is set, the player's view will change to the direction where the model is facing
+       // more info: https://gitlab.com/xonotic/xonotic-data.pk3dir/merge_requests/447#note_32816794
        .vector v_angle;
 
        .entity hook;
index 0015da784e338f62650a30632f303b35a63018ec..d8af629624b5e8ea10c22f7cc446681fb8346362 100644 (file)
@@ -420,7 +420,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                case URL_READY_ERROR:
                default:
                {
-                       LOG_INFO("Player stats writing failed: ", ftos(status), "\n");
+                       LOG_INFO("Player stats writing failed: ", ftos(status));
                        PlayerStats_GameReport_DelayMapVote = false;
                        if(PS_GR_OUT_DB >= 0)
                        {
@@ -434,13 +434,13 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
 
 void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
 {
-       PlayerScore_Add(joiningplayer, SP_ELO, -1);
+       GameRules_scoring_add(joiningplayer, ELO, -1);
        // http://stats.xonotic.org/player/GgXRw6piDtFIbMArMuiAi8JG4tiin8VLjZgsKB60Uds=/elo.txt
        if(autocvar_g_playerstats_playerbasic_uri != "")
        {
                string uri = autocvar_g_playerstats_playerbasic_uri;
                if (joiningplayer.crypto_idfp == "") {
-                       PlayerScore_Add(joiningplayer, SP_ELO, -1);
+                       GameRules_scoring_add(joiningplayer, ELO, -1);
                } else {
                        // create the database if it doesn't already exist
                        if(PS_B_IN_DB < 0)
@@ -472,7 +472,7 @@ void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
        else
        {
                // server has this disabled, kill the DB and set status to idle
-               PlayerScore_Add(joiningplayer, SP_ELO, -1);
+               GameRules_scoring_add(joiningplayer, ELO, -1);
                if(PS_B_IN_DB >= 0)
                {
                        db_close(PS_B_IN_DB);
@@ -573,7 +573,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                         if (gt == PlayerStats_GetGametype()) {
                             handled = true;
                             float e = stof(data);
-                            PlayerScore_Add(p, SP_ELO, +1 + e);
+                            GameRules_scoring_add(p, ELO, +1 + e);
                         }
                         if (gt == "") {
                             // PlayerInfo_AddItem(p, value, data);
@@ -590,18 +590,18 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
-                       LOG_INFO("Player stats synchronized with server\n");
+                       LOG_INFO("Player stats synchronized with server");
                        return;
                }
 
                case URL_READY_ERROR:
                default:
                {
-                       LOG_INFO("Receiving player stats failed: ", ftos(status), "\n");
+                       LOG_INFO("Receiving player stats failed: ", ftos(status));
                        break;
                }
        }
-       PlayerScore_Add(p, SP_ELO, -1);
+       GameRules_scoring_add(p, ELO, -1);
 }
 #endif // SVQC
 
@@ -613,7 +613,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
        float i = 0;
        for(e = PS_D_IN_EVL; (en = db_get(PS_D_IN_DB, e)) != ""; e = en)
        {
-               LOG_INFO(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
+               LOG_INFOF("%d:%s:%s", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e)));
                ++i;
        }
 #endif
@@ -679,7 +679,7 @@ void PlayerStats_PlayerDetail_CheckUpdate()
        float gamecount = cvar("cl_matchcount");
 
        #if 0
-       LOG_INFOF("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d\n",
+       LOG_INFOF("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d",
                time,
                PS_D_NEXTUPDATETIME,
                PS_D_LASTGAMECOUNT,
@@ -782,7 +782,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                                        "PlayerStats_PlayerDetail_Handler(): ERROR: "
                                                        "Key went unhandled? Is our version outdated?\n"
                                                        "PlayerStats_PlayerDetail_Handler(): "
-                                                       "Key '%s', Event '%s', Data '%s'\n",
+                                                       "Key '%s', Event '%s', Data '%s'",
                                                        key,
                                                        event,
                                                        data
@@ -792,13 +792,13 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                }
 
                                #if 0
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "PlayerStats_PlayerDetail_Handler(): "
-                                       "Key '%s', Event '%s', Data '%s'\n",
+                                       "Key '%s', Event '%s', Data '%s'",
                                        key,
                                        event,
                                        data
-                               ));
+                               );
                                #endif
                        }
                        //print("PlayerStats_PlayerDetail_Handler(): End of response.\n");
@@ -811,14 +811,14 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
-                       LOG_INFO("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.\n");
+                       LOG_INFO("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.");
                        break;
                }
 
                case URL_READY_ERROR:
                default:
                {
-                       LOG_INFO("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status), "\n");
+                       LOG_INFO("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status));
                        PlayerStats_PlayerDetail_Status = PS_D_STATUS_ERROR;
                        if(PS_D_IN_DB >= 0)
                        {
index 3bd6c60ae0aec624d079ffa8557d3eded634fc28..ea936185b95ee2b1227a58be5664a7e2ecfda30c 100644 (file)
@@ -25,7 +25,7 @@ void PlayerState_detach(entity this)
     Inventory_delete(this);
 }
 
-void GetCvars(entity this, int);
+void GetCvars(entity this, entity store, int);
 void DecodeLevelParms(entity this);
 void PlayerScore_Attach(entity this);
 void ClientData_Attach(entity this);
@@ -40,7 +40,7 @@ void ClientState_attach(entity this)
 {
        this._cs = NEW(ClientState, this);
 
-    GetCvars(this, 0);  // get other cvars from player
+    GetCvars(this, CS(this), 0);  // get other cvars from player
 
        // TODO: fold all of these into ClientState
 
@@ -69,7 +69,7 @@ void PlayerScore_Detach(entity this);
 
 void ClientState_detach(entity this)
 {
-    GetCvars(this, -1);  // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
+    GetCvars(this, CS(this), -1);  // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
     accuracy_free(this); // TODO: needs to be before CS() is deleted!
     PlayerScore_Detach(this); // what ^they^ said
     W_HitPlotClose(this);
index f5b3b2c19f7122bc0cfbe45cf10b1dfa8e9e0f22..6a6ce3fafdccd004a36a7c438b820b8423414040 100644 (file)
@@ -631,12 +631,46 @@ void Item_ScheduleRespawnIn(entity e, float t)
        }
 }
 
+AUTOCVAR(g_pickup_respawntime_scaling_reciprocal, float, 0.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*");
+AUTOCVAR(g_pickup_respawntime_scaling_offset, float, 0.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening");
+AUTOCVAR(g_pickup_respawntime_scaling_linear, float, 1.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly");
+
+float adjust_respawntime(float normal_respawntime) {
+       float r = autocvar_g_pickup_respawntime_scaling_reciprocal;
+       float o = autocvar_g_pickup_respawntime_scaling_offset;
+       float l = autocvar_g_pickup_respawntime_scaling_linear;
+
+       if (r == 0 && l == 1) {
+               return normal_respawntime;
+       }
+
+       CheckAllowedTeams(NULL);
+       GetTeamCounts(NULL);
+       int players = 0;
+       if (c1 != -1) players += c1;
+       if (c2 != -1) players += c2;
+       if (c3 != -1) players += c3;
+       if (c4 != -1) players += c4;
+
+       if (players >= 2) {
+               return normal_respawntime * (r / (players + o) + l);
+       } else {
+               return normal_respawntime;
+       }
+}
+
 void Item_ScheduleRespawn(entity e)
 {
        if(e.respawntime > 0)
        {
                Item_Show(e, 0);
-               Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e));
+
+               float adjusted_respawntime = adjust_respawntime(e.respawntime);
+               //LOG_INFOF("item %s will respawn in %f", e.classname, adjusted_respawntime);
+
+               // range: adjusted_respawntime - respawntimejitter .. adjusted_respawntime + respawntimejitter
+               float actual_time = adjusted_respawntime + crandom() * e.respawntimejitter;
+               Item_ScheduleRespawnIn(e, actual_time);
        }
        else // if respawntime is -1, this item does not respawn
                Item_Show(e, -1);
@@ -648,7 +682,119 @@ void Item_ScheduleInitialRespawn(entity e)
        Item_ScheduleRespawnIn(e, max(0, game_starttime - time) + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e)));
 }
 
-float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
+void GivePlayerResource(entity player, .float resource_type, float amount)
+{
+       if (amount == 0)
+       {
+               return;
+       }
+       switch (resource_type)
+       {
+               case health:
+               {
+                       // Ugly hack. We do not check if health goes beyond hard limit since
+                       // currently it is done in player_regen. We need to bring back this
+                       // check when other code is ported to this function.
+                       player.health = bound(player.health, player.health + amount,
+                               autocvar_g_balance_health_limit);
+                       // Correct code:
+                       //player.health = bound(player.health, player.health + amount,
+                       //      min(autocvar_g_balance_health_limit,
+                       //      RESOURCE_AMOUNT_HARD_LIMIT));
+                       player.pauserothealth_finished = max(player.pauserothealth_finished,
+                               time + autocvar_g_balance_pause_health_rot);
+                       return;
+               }
+               case armorvalue:
+               {
+                       // Ugly hack. We do not check if armor goes beyond hard limit since
+                       // currently it is done in player_regen. We need to bring back this
+                       // check when other code is ported to this function.
+                       player.armorvalue = bound(player.armorvalue, player.armorvalue +
+                               amount, autocvar_g_balance_armor_limit);
+                       // Correct code:
+                       //player.armorvalue = bound(player.armorvalue, player.armorvalue +
+                       //      amount, min(autocvar_g_balance_armor_limit,
+                       //      RESOURCE_AMOUNT_HARD_LIMIT));
+                       player.pauserotarmor_finished = max(player.pauserotarmor_finished,
+                               time + autocvar_g_balance_pause_armor_rot);
+                       return;
+               }
+               case ammo_shells:
+               case ammo_nails:
+               case ammo_rockets:
+               case ammo_cells:
+               case ammo_plasma:
+               {
+                       GivePlayerAmmo(player, resource_type, amount);
+                       return;
+               }
+               case ammo_fuel:
+               {
+                       player.ammo_fuel = bound(player.ammo_fuel, player.ammo_fuel +
+                               amount, min(g_pickup_fuel_max, RESOURCE_AMOUNT_HARD_LIMIT));
+                       player.pauserotfuel_finished = max(player.pauserotfuel_finished,
+                               time + autocvar_g_balance_pause_fuel_rot);
+                       return;
+               }
+       }
+}
+
+void GivePlayerHealth(entity player, float amount)
+{
+       GivePlayerResource(player, health, amount);
+}
+
+void GivePlayerArmor(entity player, float amount)
+{
+       GivePlayerResource(player, armorvalue, amount);
+}
+
+void GivePlayerAmmo(entity player, .float ammotype, float amount)
+{
+       if (amount == 0)
+       {
+               return;
+       }
+       float maxvalue = RESOURCE_AMOUNT_HARD_LIMIT;
+       switch (ammotype)
+       {
+               case ammo_shells:
+               {
+                       maxvalue = g_pickup_shells_max;
+                       break;
+               }
+               case ammo_cells:
+               {
+                       maxvalue = g_pickup_cells_max;
+                       break;
+               }
+               case ammo_rockets:
+               {
+                       maxvalue = g_pickup_rockets_max;
+                       break;
+               }
+               case ammo_plasma:
+               {
+                       maxvalue = g_pickup_plasma_max;
+                       break;
+               }
+               case ammo_nails:
+               {
+                       maxvalue = g_pickup_nails_max;
+                       break;
+               }
+       }
+       player.(ammotype) = min(player.(ammotype) + amount,
+               min(maxvalue, RESOURCE_AMOUNT_HARD_LIMIT));
+}
+
+void GivePlayerFuel(entity player, float amount)
+{
+       GivePlayerResource(player, ammo_fuel, amount);
+}
+
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax)
 {
        if (!item.(ammotype))
                return false;
@@ -657,8 +803,13 @@ float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax
        {
                if ((player.(ammotype) < ammomax) || item.pickup_anyway > 0)
                {
-                       player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype));
-                       goto YEAH;
+                       float amount = item.(ammotype);
+                       if ((player.(ammotype) + amount) > ammomax)
+                       {
+                               amount = ammomax - player.(ammotype);
+                       }
+                       GivePlayerResource(player, ammotype, amount);
+                       return true;
                }
        }
        else if(g_weapon_stay == 2)
@@ -666,29 +817,11 @@ float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax
                float mi = min(item.(ammotype), ammomax);
                if (player.(ammotype) < mi)
                {
-                       player.(ammotype) = mi;
-                       goto YEAH;
+                       GivePlayerResource(player, ammotype, mi - player.(ammotype));
                }
+               return true;
        }
-
        return false;
-
-LABEL(YEAH)
-       switch(mode)
-       {
-               case ITEM_MODE_FUEL:
-                       player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
-                       break;
-               case ITEM_MODE_HEALTH:
-                       player.pauserothealth_finished = max(player.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
-                       break;
-               case ITEM_MODE_ARMOR:
-                       player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + autocvar_g_balance_pause_armor_rot);
-                       break;
-               default:
-                       break;
-       }
-       return true;
 }
 
 float Item_GiveTo(entity item, entity player)
@@ -717,16 +850,14 @@ float Item_GiveTo(entity item, entity player)
                        }
                }
        }
-
-       pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
-       pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max, ITEM_MODE_NONE);
-       pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max, ITEM_MODE_NONE);
-       pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max, ITEM_MODE_NONE);
-       pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max, ITEM_MODE_NONE);
-       pickedup |= Item_GiveAmmoTo(item, player, ammo_plasma, g_pickup_plasma_max, ITEM_MODE_NONE);
-       pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
-       pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
-
+       pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health);
+       pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_plasma, g_pickup_plasma_max);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max);
        if (item.itemdef.instanceOfWeaponPickup)
        {
                WepSet w;
index e52604d994e97c1bf970394d083e1357550f31e6..f557e10308cc0d961df222bcb9a021dc4fd33399 100644 (file)
@@ -4,6 +4,9 @@
 #include <server/defs.qh>
 #endif
 
+/// \brief Unconditional maximum amount of resources the player can have.
+const int RESOURCE_AMOUNT_HARD_LIMIT = 999;
+
 const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
 
 // item networking
@@ -67,8 +70,6 @@ bool have_pickup_item(entity this);
 
 const float ITEM_RESPAWN_TICKS = 10;
 
-#define ITEM_RESPAWNTIME(i)         ((i).respawntime + crandom() * (i).respawntimejitter)
-       // range: respawntime - respawntimejitter .. respawntime + respawntimejitter
 #define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS))
        // range: 10 .. respawntime + respawntimejitter
 
@@ -85,11 +86,40 @@ void Item_ScheduleRespawnIn(entity e, float t);
 void Item_ScheduleRespawn(entity e);
 
 void Item_ScheduleInitialRespawn(entity e);
-float ITEM_MODE_NONE = 0;
-float ITEM_MODE_HEALTH = 1;
-float ITEM_MODE_ARMOR = 2;
-float ITEM_MODE_FUEL = 3;
-float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode);
+
+/// \brief Gives player a resource such as health, armor or ammo.
+/// \param[in,out] player Player to give resource to.
+/// \param[in] resource_type Type of the resource.
+/// \param[in] amount Amount of resource to give.
+/// \return No return.
+void GivePlayerResource(entity player, .float resource_type, float amount);
+
+/// \brief Gives health to the player.
+/// \param[in,out] player Player to give health to.
+/// \param[in] amount Amount of health to give.
+/// \return No return.
+void GivePlayerHealth(entity player, float amount);
+
+/// \brief Gives armor to the player.
+/// \param[in,out] player Player to give armor to.
+/// \param[in] amount Amount of armor to give.
+/// \return No return.
+void GivePlayerArmor(entity player, float amount);
+
+/// \brief Gives ammo of the specified type to the player.
+/// \param[in,out] player Player to give ammo to.
+/// \param[in] type Ammo type property.
+/// \param[in] amount Amount of ammo to give.
+/// \return No return.
+void GivePlayerAmmo(entity player, .float ammotype, float amount);
+
+/// \brief Gives fuel to the player.
+/// \param[in,out] player Player to give fuel to.
+/// \param[in] amount Amount of fuel to give.
+/// \return No return.
+void GivePlayerFuel(entity player, float amount);
+
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax);
 
 float Item_GiveTo(entity item, entity player);
 
index 3c7d47fea4e005962ef0012199a09c0ead36701b..8ded50d16b2da0d88a35c68eb333006786a15636 100644 (file)
@@ -8,8 +8,11 @@ void button_return(entity this);
 void button_wait(entity this)
 {
        this.state = STATE_TOP;
-       this.nextthink = this.ltime + this.wait;
-       setthink(this, button_return);
+       if(this.wait >= 0)
+       {
+               this.nextthink = this.ltime + this.wait;
+               setthink(this, button_return);
+       }
        SUB_UseTargets(this, this.enemy, NULL);
        this.frame = 1;                 // use alternate textures
 }
@@ -56,6 +59,9 @@ void button_reset(entity this)
        setorigin(this, this.pos1);
        this.frame = 0;                 // use normal textures
        this.state = STATE_BOTTOM;
+       this.velocity = '0 0 0';
+       setthink(this, func_null);
+       this.nextthink = 0;
        if (this.health)
                this.takedamage = DAMAGE_YES;   // can be shot again
 }
@@ -150,6 +156,8 @@ spawnfunc(func_button)
        this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
     this.flags |= FL_NOTARGET;
 
+    this.reset = button_reset;
+
        button_reset(this);
 }
 #endif
index 9715c25452dcaef75849c5700f6b37c5a09b6b05..6268dcfeb86ea6f5fc7d9b981b7e22dd34240bc9 100644 (file)
@@ -1,5 +1,7 @@
 #include "rotating.qh"
 #ifdef SVQC
+const int FUNC_ROTATING_STARTOFF = BIT(4);
+
 void func_rotating_setactive(entity this, int astate)
 {
        if (astate == ACTIVE_TOGGLE)
@@ -18,6 +20,22 @@ void func_rotating_setactive(entity this, int astate)
                this.avelocity = this.pos1;
 }
 
+void func_rotating_reset(entity this)
+{
+       // TODO: reset angles as well?
+
+       if(this.spawnflags & FUNC_ROTATING_STARTOFF)
+       {
+               this.avelocity = '0 0 0';
+               this.active = ACTIVE_NOT;
+       }
+       else
+       {
+               this.avelocity = this.pos1;
+               this.active = ACTIVE_ACTIVE;
+       }
+}
+
 /*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
 Brush model that spins in place on one axis (default Z).
 speed   : speed to rotate (in degrees per second)
@@ -34,16 +52,15 @@ spawnfunc(func_rotating)
                ambientsound(this.origin, this.noise, VOL_BASE, ATTEN_IDLE);
        }
 
-       this.active = ACTIVE_ACTIVE;
        this.setactive = func_rotating_setactive;
 
        if (!this.speed)
                this.speed = 100;
        // FIXME: test if this turns the right way, then remove this comment (negate as needed)
-       if (this.spawnflags & 4) // X (untested)
+       if (this.spawnflags & BIT(2)) // X (untested)
                this.avelocity = '0 0 1' * this.speed;
        // FIXME: test if this turns the right way, then remove this comment (negate as needed)
-       else if (this.spawnflags & 8) // Y (untested)
+       else if (this.spawnflags & BIT(3)) // Y (untested)
                this.avelocity = '1 0 0' * this.speed;
        // FIXME: test if this turns the right way, then remove this comment (negate as needed)
        else // Z
@@ -51,6 +68,15 @@ spawnfunc(func_rotating)
 
        this.pos1 = this.avelocity;
 
+       // do this after setting pos1, so we can safely reactivate the func_rotating
+       if(this.spawnflags & FUNC_ROTATING_STARTOFF)
+       {
+               this.avelocity = '0 0 0';
+               this.active = ACTIVE_NOT;
+       }
+       else
+               this.active = ACTIVE_ACTIVE;
+
     if(this.dmg && (this.message == ""))
         this.message = " was squished";
     if(this.dmg && (this.message2 == ""))
@@ -72,6 +98,6 @@ spawnfunc(func_rotating)
        this.nextthink = this.ltime + 999999999;
        setthink(this, SUB_NullThink); // for PushMove
 
-       // TODO make a reset function for this one
+       this.reset = func_rotating_reset;
 }
 #endif
index 4eed8ef345872f3726bcb03fd4904fdcb63a871e..1464da95511260b8ce4592e705b50bf9a62e7c2d 100644 (file)
@@ -55,7 +55,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                        data = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", key)));
                        if(data.y == 0) // undefined field, i.e., invalid type
                        {
-                               LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
+                               LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!");
                                continue;
                        }
                }
@@ -150,7 +150,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                }
                                else
                                {
-                                       LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
+                                       LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!");
                                        continue;
                                }
 
@@ -163,13 +163,13 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                {
                                        if(value != "")
                                        {
-                                               LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!\n");
+                                               LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!");
                                                continue;
                                        }
                                        data2 = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", valuefield)));
                                        if(data2_y == 0) // undefined field, i.e., invalid type
                                        {
-                                               LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
+                                               LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!");
                                                continue;
                                        }
                                        value = getentityfieldstring(data2_x, valueent);
@@ -189,7 +189,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                                        value = vtos(stov(value) + stov(valueoffset));
                                                        break;
                                                default:
-                                                       LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
+                                                       LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!");
                                                        break;
                                        }
                                }
@@ -206,7 +206,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                                        value = vtos(stov(value) + random() * data2_x * '1 0 0' + random() * data2_y * '0 1 0' + random() * data2_z * '0 0 1');
                                                        break;
                                                default:
-                                                       LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
+                                                       LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!");
                                                        break;
                                        }
                                }
index 451afa95b4a3d4d0500064d55e219ca94cc822a5..8e9936b2ea2980586e44844ccb66b27f92801670 100644 (file)
@@ -206,7 +206,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
 #ifdef SVQC
        if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
 #elif defined(CSQC)
-       if(!e) { LOG_INFO("Teleport destination could not be found from CSQC.\n"); }
+       if(!e) { LOG_INFO("Teleport destination could not be found from CSQC."); }
 #endif
 
        makevectors(e.mangle);
@@ -237,7 +237,7 @@ void teleport_findtarget(entity this)
                if(e.move_movetype == MOVETYPE_NONE)
                        waypoint_spawnforteleporter(this, e.origin, 0);
                if(e.classname != "info_teleport_destination")
-                       LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
+                       LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.");
 #endif
        }
 
@@ -292,7 +292,7 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl)
        #elif defined(CSQC)
                if(!(pl.flags & BIT(15))) // FL_PROJECTILE
        #endif
-                       LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
+                       LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".");
                pl.owner = NULL;
        }
        if(IS_PLAYER(pl))
index 6154f6bf0aa073e67c3aa522bb7a96501c541f6a..eee61c993535f063b5ba30eeccdd6db3550b0273 100644 (file)
@@ -19,7 +19,7 @@ void trigger_disablerelay_use(entity this, entity actor, entity trigger)
        }
 
        if((!a) == (!b))
-               LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!\n");
+               LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!");
 }
 
 spawnfunc(trigger_disablerelay)
index a600263542afab2266461d91a2f350489b4344b9..ffc04a0782bf8d0a5b59c00876adf0b8319dc078 100644 (file)
@@ -72,7 +72,7 @@ void viewloc_init(entity this)
                        break;
                }
 
-       if(!this.enemy) { LOG_INFO("^1FAIL!\n"); delete(this); return; }
+       if(!this.enemy) { LOG_INFO("^1FAIL!"); delete(this); return; }
 
        if(!this.goalentity)
                this.goalentity = this.enemy; // make them match so CSQC knows what to do
@@ -86,7 +86,7 @@ void viewloc_init(entity this)
 spawnfunc(trigger_viewlocation)
 {
        // we won't check target2 here yet, as it may not even need to exist
-       if(this.target == "") { LOG_INFO("^1FAIL!\n"); delete(this); return; }
+       if(this.target == "") { LOG_INFO("^1FAIL!"); delete(this); return; }
 
        EXACTTRIGGER_INIT;
        InitializeEntity(this, viewloc_init, INITPRIO_FINDTARGET);
diff --git a/qcsrc/common/turrets/_all.inc b/qcsrc/common/turrets/_all.inc
deleted file mode 100644 (file)
index 8bc63f7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "_all.qh"
-#include "_mod.inc"
diff --git a/qcsrc/common/turrets/_all.qh b/qcsrc/common/turrets/_all.qh
deleted file mode 100644 (file)
index 947026d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma once
-#include "_mod.qh"
index 8fff9535c5ce40ca345d9175a859b509dd053218..f8eb32263b30eb48f6d5b7329354a8f5f1a8a605 100644 (file)
@@ -11,3 +11,5 @@
     #include <common/turrets/sv_turrets.qc>
 #endif
 #include <common/turrets/util.qc>
+
+#include <common/turrets/turret/_mod.inc>
index 06978f1d41e23fa375a94ab19463287553d0736c..427ec4049a807e70bc659edfcd0ddfc9c414d51d 100644 (file)
@@ -11,3 +11,5 @@
     #include <common/turrets/sv_turrets.qh>
 #endif
 #include <common/turrets/util.qh>
+
+#include <common/turrets/turret/_mod.qh>
index 469a64c9274b240758ebd40eeeb8d4f19576d767..54e63748c3d2360d7e34be08ac20aaf4f6b419e0 100644 (file)
@@ -1,23 +1,3 @@
 #include "all.qh"
 
 REGISTER_NET_LINKED(ENT_CLIENT_TURRET)
-
-#ifdef SVQC
-#include "sv_turrets.qh"
-#endif
-
-#define IMPLEMENTATION
-#include "turret/_mod.inc"
-#undef IMPLEMENTATION
-
-#ifdef CSQC
-#include "cl_turrets.qc"
-#endif
-
-#ifdef SVQC
-#include "sv_turrets.qc"
-#include "config.qc"
-#include "util.qc"
-#include "checkpoint.qc"
-#include "targettrigger.qc"
-#endif
index 1a77e989121b0cade1ab49e584f93e6e575b29d4..e63a931a67361df15b0d7b15f71fbc16e484c862 100644 (file)
@@ -38,17 +38,17 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
             if(tur_config_file >= 0)
             {
                 Dump_Turret_Settings();
-                LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
+                LOG_INFOF("Dumping turrets... File located in ^2data/data/%s^7.", filename);
                 fclose(tur_config_file);
                 tur_config_file = -1;
                 tur_config_alsoprint = -1;
             }
             else
             {
-                LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
             }
             #else
-            LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
+            LOG_INFO(_("Turrets dump command only works with sv_cmd."));
             #endif
             return;
         }
@@ -56,10 +56,10 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
         default:
         case CMD_REQUEST_USAGE:
         {
-            LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
-            LOG_INFO("  Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
-            LOG_INFO("  if supplied with '-' output to console as well as default,\n");
-            LOG_INFO("  if left blank, it will only write to default.\n");
+            LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]");
+            LOG_INFO("  Where 'filename' is the file to write (default is turrets_dump.cfg),");
+            LOG_INFO("  if supplied with '-' output to console as well as default,");
+            LOG_INFO("  if left blank, it will only write to default.");
             return;
         }
     }
@@ -73,4 +73,4 @@ const int TUR_FIRST = 1;
 
 REGISTER_TURRET(Null, NEW(Turret));
 
-#include "turret/_mod.inc"
+#include "turret/_mod.qh"
index d9a20dc97c81d52104604e612e0d59c1b27ded74..f5ba71477982d4ec6b727d1312aaf36633269a1c 100644 (file)
@@ -1,4 +1,7 @@
 #include "checkpoint.qh"
+
+#ifdef SVQC
+
 /**
     turret_checkpoint
 **/
@@ -75,3 +78,5 @@ spawnfunc(walker_checkpoint)
     this.classname = "turret_checkpoint";
     spawnfunc_turret_checkpoint(this);
 }
+
+#endif
index 11d5e5d7202de6b76901498463bd58938edc8708..d75e4a925ce0bf30c781a40f825cdc5b4ffa82f0 100644 (file)
@@ -112,7 +112,7 @@ void turret_draw2d(entity this)
        if(rgb == '0 0 0')
        {
                this.teamradar_color = '1 0 1';
-               LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+               LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage);
        }
 
        txt = this.netname;
index 7d1a81d490b1be213ad7d12faa20ca3d6e2d6355..effabeac275ded29fed4b17d370f6e56e7cd5fb2 100644 (file)
@@ -3,6 +3,8 @@
 //  Turret Config Generator
 // ==========================
 
+#ifdef SVQC
+
 void T_Config_Queue_Swap(float root, float child, entity pass)
 {
        string oldroot = config_queue[root];
@@ -48,7 +50,7 @@ void Dump_Turret_Settings()
                TUR_CONFIG_WRITETOFILE("// }}}\n")
 
                // step 5: debug info
-               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.turret_name, TUR_CONFIG_COUNT));
+               LOG_INFOF("#%d: %s: %d settings...", i, it.turret_name, TUR_CONFIG_COUNT);
                totalsettings += TUR_CONFIG_COUNT;
        });
 
@@ -58,5 +60,7 @@ void Dump_Turret_Settings()
                config_queue[j] = string_null;
 
        // extra information
-       LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
+       LOG_INFOF("Totals: %d turrets, %d settings", (Turrets_COUNT - 1), totalsettings);
 }
+
+#endif
index 152a7d6a2715e362fde40fca3be8f20497ccc511..d64616f50354ca6ad092c4a0b1dae10a6ef8881b 100644 (file)
@@ -1,4 +1,7 @@
 #include "targettrigger.qh"
+
+#ifdef SVQC
+
 spawnfunc(turret_targettrigger);
 void turret_targettrigger_touch(entity this, entity toucher);
 
@@ -24,3 +27,5 @@ spawnfunc(turret_targettrigger)
 
     settouch(this, turret_targettrigger_touch);
 }
+
+#endif
index 403a0ddf6c2bedcefa2a23b8e20d993710137786..5625d23fc935e8be8453afb9517ef40e333243a8 100644 (file)
@@ -1,7 +1,5 @@
 #include "ewheel.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_ewheel_speed_fast;
@@ -245,4 +243,3 @@ void ewheel_draw(entity this)
         }
 
 #endif // CSQC
-#endif
index e77b534022423e2ae72de04f2de5e4822c2de027..fc22c3086c861505e57b49baff564297a74a1b26 100644 (file)
@@ -1,7 +1,5 @@
 #include "ewheel_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 void turret_initparams(entity);
@@ -36,5 +34,3 @@ METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, .entity weapon
 }
 
 #endif
-
-#endif
index ab6e5f5cb67afe9bec1f43fb0adf6a88df0a309f..6a81bc2c9919d28d04c8fea015593803a51b27cd 100644 (file)
@@ -1,7 +1,5 @@
 #include "flac.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_flac) { if (!turret_initialize(this, TUR_FLAC)) delete(this); }
@@ -15,5 +13,3 @@ METHOD(Flac, tr_setup, void(Flac this, entity it))
 }
 
 #endif
-
-#endif
index 357bba975d853cfcd6cb50af66692cb16165a099..10d53aa08f527e64dd53ce05d92a0329d54d8465 100644 (file)
@@ -1,7 +1,5 @@
 #include "flac_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 void turret_flac_projectile_think_explode(entity this);
@@ -53,5 +51,3 @@ void turret_flac_projectile_think_explode(entity this)
 }
 
 #endif
-
-#endif
index 3c468535c86f87962ef5894662f8243e3793b540..32ac81d586cc7ecc9035d7accddf5aada188bbdb 100644 (file)
@@ -1,6 +1,5 @@
 #include "fusionreactor.qh"
 
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 bool turret_fusionreactor_firecheck(entity this)
 {
@@ -53,4 +52,3 @@ METHOD(FusionReactor, tr_setup, void(FusionReactor this, entity it))
 }
 
 #endif
-#endif
index 88a0170ea67d4d556f7dd8a72c483615d0af8016..15dc36b3d7eadeb107446c3d257bd9c5a5a08eb9 100644 (file)
@@ -1,7 +1,5 @@
 #include "hellion.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_hellion) { if (!turret_initialize(this, TUR_HELLION)) delete(this); }
@@ -23,4 +21,3 @@ METHOD(Hellion, tr_setup, void(Hellion this, entity it))
 }
 
 #endif
-#endif
index ea392ec4ed9540f94fde30c999c5ae8aed3c1841..a1065dec1b12033916dc30437a2a9a92c9be62bd 100644 (file)
@@ -1,7 +1,5 @@
 #include "hellion_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_hellion_shot_speed_gain;
@@ -103,5 +101,3 @@ void turret_hellion_missile_think(entity this)
 }
 
 #endif
-
-#endif
index 255821e1c368209aa8d229703f6c5dedcc8ec7ba..811e386f5b4e38bc85cb90f8f0ade95e0e3b3e8c 100644 (file)
@@ -1,7 +1,5 @@
 #include "hk.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 #ifdef TURRET_DEBUG_HK
@@ -47,4 +45,3 @@ bool turret_hk_addtarget(entity this, entity e_target,entity e_sender)
 }
 
 #endif // SVQC
-#endif
index 5a2f05a4832219fdc3ed9c51a3238c79de625f49..9a243adaa73c6903cad83ea22e1eb9155bb84d44 100644 (file)
@@ -1,7 +1,5 @@
 #include "hk_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_hk_shot_speed;
@@ -278,5 +276,3 @@ bool hk_is_valid_target(entity this, entity proj, entity targ)
 }
 
 #endif
-
-#endif
index db3cb47bf2fbb6cc3d173ccce2edba39f3ea6072..a2ee1def6b8a68bb65671c545f33dc5871574718 100644 (file)
@@ -1,7 +1,5 @@
 #include "machinegun.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_machinegun) { if (!turret_initialize(this, TUR_MACHINEGUN)) delete(this); }
@@ -16,4 +14,3 @@ METHOD(MachineGunTurret, tr_setup, void(MachineGunTurret this, entity it))
 }
 
 #endif // SVQC
-#endif
index c60cd3b37e11ff245e3877dd76c638585079ce3c..846b5234376a0c7bcaf50c1e85224e49846d1eff 100644 (file)
@@ -1,7 +1,5 @@
 #include "machinegun_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 void W_MachineGun_MuzzleFlash(entity actor, .entity weaponentity);
@@ -26,5 +24,3 @@ METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, .ent
 }
 
 #endif
-
-#endif
index 472a0cb09a5c410ad5ae5a7060e410799189ccd4..2315012b11379bed39838e697795a6345569dbf5 100644 (file)
@@ -1,7 +1,5 @@
 #include "mlrs.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_mlrs) { if (!turret_initialize(this, TUR_MLRS)) delete(this); }
@@ -27,4 +25,3 @@ METHOD(MLRSTurret, tr_setup, void(MLRSTurret this, entity it))
 }
 
 #endif // SVQC
-#endif
index cfd51c732076b2686fc9ae12e96adae33db462ea..ccf309aaf7c31ef8015b788b17d3a112551f49f6 100644 (file)
@@ -1,7 +1,5 @@
 #include "mlrs_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 SOUND(MLRSTurretAttack_FIRE, W_Sound("electro_fire"));
 METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
@@ -27,5 +25,3 @@ METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity we
 }
 
 #endif
-
-#endif
index 31ece9cb2b8b86d7946d9c0eaf45634910e09036..9c93a6e89a742313b097ba23fd1a03a3267a16df 100644 (file)
@@ -1,7 +1,5 @@
 #include "phaser.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_phaser) { if (!turret_initialize(this, TUR_PHASER)) delete(this); }
@@ -45,4 +43,3 @@ bool turret_phaser_firecheck(entity this)
 }
 
 #endif
-#endif
index bf901d886a77e407292d8d208d20f37819f5b8cc..3fb34fb14c2b9b1d97f7c0a6ad3008ba3e6011af 100644 (file)
@@ -1,7 +1,5 @@
 #include "phaser_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 void beam_think(entity this);
 
@@ -90,5 +88,3 @@ void beam_think(entity this)
 }
 
 #endif
-
-#endif
index 7317930c9005001578140ceb2233352393215ee4..96fa81f8eee98cdbbf72ce9761e2f5eaf2c1c717 100644 (file)
@@ -1,7 +1,5 @@
 #include "plasma.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_plasma) { if (!turret_initialize(this, TUR_PLASMA)) delete(this); }
@@ -46,4 +44,3 @@ METHOD(PlasmaTurret, tr_setup, void(PlasmaTurret this, entity it))
 }
 
 #endif
-#endif
index 3efe969f31afe79d73702e014c770032ac59bc86..2a6f997cf3f009f533858d9099c0fb3492e2b7c3 100644 (file)
@@ -1,7 +1,5 @@
 #include "plasma_dual.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_plasma_dual) { if (!turret_initialize(this, TUR_PLASMA_DUAL)) delete(this); }
@@ -34,4 +32,3 @@ METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
 }
 
 #endif
-#endif
index f6f717f85ff6b612974ec854de8888913199aa20..7de7406e2da1fe195f38bf1b06caf70cbcfb54aa 100644 (file)
@@ -1,7 +1,5 @@
 #include "plasma_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 SOUND(PlasmaAttack_FIRE, W_Sound("electro_fire"));
 METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
@@ -23,5 +21,3 @@ METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weapon
 }
 
 #endif
-
-#endif
index 249fe18eb92042465d499a947929c672aee49fa3..4c27bc9acce8cd112e0426e0062a0cceee1e115e 100644 (file)
@@ -1,7 +1,5 @@
 #include "tesla.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 spawnfunc(turret_tesla) { if (!turret_initialize(this, TUR_TESLA)) delete(this); }
@@ -88,4 +86,3 @@ bool turret_tesla_firecheck(entity this)
 }
 
 #endif
-#endif
index 7e6fda78ab8df41381679ad98b159fd1d6c24f98..88ca4db9702f491d237edd4adade82a526b0c9af 100644 (file)
@@ -1,7 +1,5 @@
 #include "tesla_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 entity toast(entity actor, entity from, float range, float damage);
@@ -84,5 +82,3 @@ entity toast(entity actor, entity from, float range, float damage)
 }
 
 #endif
-
-#endif
index 2f651589d76728a611f7325ddaf3f683345a0f30..415d5dfeef16fd315cd5c08d7dc269be2c199bd9 100644 (file)
@@ -1,7 +1,5 @@
 #include "walker.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_walker_melee_damage;
@@ -643,4 +641,3 @@ void walker_draw(entity this)
         }
 
 #endif // CSQC
-#endif
index 9bcf902902f2b43f07efe0cba526d08b086f3a64..b418ce40d32240445a75560a8e35bbbd521f89ff 100644 (file)
@@ -1,7 +1,5 @@
 #include "walker_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 SOUND(WalkerTurretAttack_FIRE, W_Sound("electro_fire"));
@@ -24,5 +22,3 @@ METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
 }
 
 #endif
-
-#endif
index 5fef364580860b256d624eb552b32a13c55fc098..d4cbb4fb1da280665f62c00f00dc3b340f251909 100644 (file)
@@ -1,4 +1,7 @@
 #include "util.qh"
+
+#ifdef SVQC
+
 /*
 * Update this.tur_shotorg by getting up2date bone info
 * NOTICE this func overwrites the global v_forward, v_right and v_up vectors.
@@ -210,3 +213,5 @@ void paint_target3(vector where, float f_size, vector v_color, float f_time)
        SUB_SetFade(e,time,f_time);
 }
 #endif
+
+#endif
index be207b711e85748328723a6d31e2919bf5cc6403..4c84f268d3024679102f158cf5e017bf229ff28a 100644 (file)
@@ -1,4 +1,8 @@
 #pragma once
 
+#ifdef SVQC
+
 float turret_tag_fire_update(entity this);
 void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float f_velfactor, float deathtype);
+
+#endif
index 6340c007ad19cc3c62d947f61233859bb0026036..deba86c289dc8f4966407fa6dd6f7c4f9e308ed8 100644 (file)
@@ -336,17 +336,19 @@ STATIC_INIT(compressShortVector)
 
        if(cvar("developer"))
        {
-               LOG_INFO("Verifying vector compression table...\n");
+               LOG_INFO("Verifying vector compression table...");
                for(i = 0x0F00; i < 0xFFFF; ++i)
                        if(i != compressShortVector(decompressShortVector(i)))
                        {
-                               LOG_INFO("BROKEN vector compression: ", ftos(i));
-                               LOG_INFO(" -> ", vtos(decompressShortVector(i)));
-                               LOG_INFO(" -> ", ftos(compressShortVector(decompressShortVector(i))));
-                               LOG_INFO("\n");
+                               LOG_INFOF(
+                                   "BROKEN vector compression: %s -> %s -> %s",
+                                   ftos(i),
+                                   vtos(decompressShortVector(i)),
+                                   ftos(compressShortVector(decompressShortVector(i)))
+                );
                                error("b0rk");
                        }
-               LOG_INFO("Done.\n");
+               LOG_INFO("Done.");
        }
 }
 
@@ -596,7 +598,7 @@ float cvar_settemp(string tmp_cvar, string tmp_value)
 
        if(!cvar_type(tmp_cvar))
        {
-               LOG_INFOF("Error: cvar %s doesn't exist!\n", tmp_cvar);
+               LOG_INFOF("Error: cvar %s doesn't exist!", tmp_cvar);
                return 0;
        }
 
@@ -638,7 +640,7 @@ int cvar_settemp_restore()
                        ++j;
                }
                else
-                       LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", it.netname);
+                       LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", it.netname);
        });
 
 #else
@@ -652,7 +654,7 @@ int cvar_settemp_restore()
                        ++j;
                }
                else
-                       print(sprintf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname));
+                       print(sprintf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", e.netname));
        }
 #endif
 
@@ -1362,7 +1364,7 @@ void m_shutdown()
 {
        if(shutdown_running)
        {
-               LOG_INFO("Recursive shutdown detected! Only restoring cvars...\n");
+               LOG_INFO("Recursive shutdown detected! Only restoring cvars...");
        }
        else
        {
diff --git a/qcsrc/common/vehicles/_all.inc b/qcsrc/common/vehicles/_all.inc
deleted file mode 100644 (file)
index 8bc63f7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "_all.qh"
-#include "_mod.inc"
diff --git a/qcsrc/common/vehicles/_all.qh b/qcsrc/common/vehicles/_all.qh
deleted file mode 100644 (file)
index 947026d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma once
-#include "_mod.qh"
index ed26659daa5c9ed37cbb384c8d9a2823e73d6c05..b358830dfe12d0df70392ff8ac25870bfe4821e0 100644 (file)
@@ -7,3 +7,5 @@
 #ifdef SVQC
     #include <common/vehicles/sv_vehicles.qc>
 #endif
+
+#include <common/vehicles/vehicle/_mod.inc>
index 4892b0f317baad43e5bc15d6e8fef0d91931f2ff..755a9a049f7e82c79dc229ec6338301805980cd2 100644 (file)
@@ -7,3 +7,5 @@
 #ifdef SVQC
     #include <common/vehicles/sv_vehicles.qh>
 #endif
+
+#include <common/vehicles/vehicle/_mod.qh>
index 4aef11cad56ed35fc49ca0b037842aceb861a74b..eed249b978d6d5fbd11f5187321853d94af8d64e 100644 (file)
@@ -1,17 +1,3 @@
 #include "all.qh"
-#ifndef VEHICLES_ALL_C
-#define VEHICLES_ALL_C
 
 REGISTER_NET_LINKED(ENT_CLIENT_AUXILIARYXHAIR)
-
-#if defined(SVQC)
-       #include "sv_vehicles.qc"
-#elif defined(CSQC)
-       #include "cl_vehicles.qc"
-#endif
-
-#define IMPLEMENTATION
-#include "vehicle/_mod.inc"
-#undef IMPLEMENTATION
-
-#endif
index 158492f661e7e1326cc248283c3b4841bb64c76a..ed44be777bf369acd3cc2ad697b89cb03b5bfd11 100644 (file)
@@ -20,4 +20,4 @@ const int VEH_FIRST = 1;
 
 REGISTER_VEHICLE(Null, NEW(Vehicle));
 
-#include "vehicle/_mod.inc"
+#include "vehicle/_mod.qh"
index d3f802791eb578c3d6a6c26a26096f95bbde3cda..018e1a17db9cf3ee0277d7097ec8188bcb7ce2f0 100644 (file)
@@ -1,7 +1,5 @@
 #include "bumblebee.qh"
 
-#ifdef IMPLEMENTATION
-
 const float BRG_SETUP = 2;
 const float BRG_START = 4;
 const float BRG_END = 8;
@@ -968,4 +966,3 @@ METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
 }
 
 #endif
-#endif
index 889ca471593f4930741e4816a2267d07e6b7231e..fa05c6a6f12dbd46343c941148c46b4c14db0366 100644 (file)
@@ -1,7 +1,5 @@
 #include "bumblebee_weapons.qh"
 
-#ifdef IMPLEMENTATION
-
 REGISTER_NET_LINKED(ENT_CLIENT_BUMBLE_RAYGUN)
 
 #ifdef SVQC
@@ -132,5 +130,3 @@ void bumble_raygun_draw(entity this)
 }
 
 #endif
-
-#endif
index a648a005e4892994fa6a9177fd744c3fdeb59730..8dbfae4677221eb70a7d63feb206b3f9724f3f4a 100644 (file)
@@ -1,7 +1,5 @@
 #include "racer.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 #include <common/triggers/trigger/impulse.qh>
 
@@ -637,5 +635,3 @@ METHOD(Racer, vr_setup, void(Racer thisveh, entity instance))
     AuxiliaryXhair[0].axh_image = vCROSS_LOCK; // Rocket
 #endif
 }
-
-#endif
index 838f0cf42773b81469326c48d17dfe88e32c9268..02015eb8daba23c239bee5794c9734b206b2decc 100644 (file)
@@ -1,7 +1,5 @@
 #include "racer_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
@@ -169,5 +167,3 @@ void racer_rocket_groundhugger(entity this)
 }
 
 #endif
-
-#endif
index e48600c47a0ae38c653a8513cadee7e28fdb0c00..d7ef38abcad18d731ee7337e5f7a17bcc9f4c7f4 100644 (file)
@@ -1,7 +1,5 @@
 #include "raptor.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 bool autocvar_g_vehicle_raptor = true;
@@ -833,4 +831,3 @@ METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance))
 }
 
 #endif
-#endif
index 5cb0f271c52fec0effb514dff201983fa2069c02..514d67c0e6cd5b31c0ea805c39d0200c26fd2c2b 100644 (file)
@@ -1,7 +1,5 @@
 #include "raptor_weapons.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
@@ -259,5 +257,3 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
 }
 
 #endif
-
-#endif
index 93f479b14f3efb1f7e46f5cd7a5738d211fcfd4b..57486a2f38bf22987abcdb403db3a68086c51214 100644 (file)
@@ -1,7 +1,5 @@
 #include "spiderbot.qh"
 
-#ifdef IMPLEMENTATION
-
 const int SBRM_FIRST = 1;
 const int SBRM_VOLLY = 1;
 const int SBRM_GUIDE = 2;
@@ -639,4 +637,3 @@ METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
 }
 
 #endif
-#endif
index 1fde99b3fcc48e87014fa84f57e1d1a0d11bd9b2..7887781ed7a74f3b5c3850dfad0cfdd64a48e398 100644 (file)
@@ -1,7 +1,5 @@
 #include "spiderbot_weapons.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 void spiderbot_rocket_artillery(entity this)
@@ -248,5 +246,3 @@ void spiderbot_rocket_do(entity this)
 }
 
 #endif
-
-#endif
index 99c7225ac1a4402f475e907a820d07b6d97bfc3f..4da01579f19b55edbf4f22a89d609e4420263047 100644 (file)
@@ -3,25 +3,25 @@
 // IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
 
 // core weapons
-#include "weapon/blaster.qc"
-#include "weapon/shotgun.qc"
-#include "weapon/machinegun.qc"
-#include "weapon/mortar.qc"
-#include "weapon/minelayer.qc"
-#include "weapon/electro.qc"
-#include "weapon/crylink.qc"
-#include "weapon/vortex.qc"
-#include "weapon/hagar.qc"
-#include "weapon/devastator.qc"
+#include "weapon/blaster.qh"
+#include "weapon/shotgun.qh"
+#include "weapon/machinegun.qh"
+#include "weapon/mortar.qh"
+#include "weapon/minelayer.qh"
+#include "weapon/electro.qh"
+#include "weapon/crylink.qh"
+#include "weapon/vortex.qh"
+#include "weapon/hagar.qh"
+#include "weapon/devastator.qh"
 
 // other weapons
-#include "weapon/porto.qc"
-#include "weapon/vaporizer.qc"
-#include "weapon/hook.qc"
-#include "weapon/hlac.qc"
-#include "weapon/tuba.qc"
-#include "weapon/rifle.qc"
-#include "weapon/fireball.qc"
-#include "weapon/seeker.qc"
-#include "weapon/shockwave.qc"
-#include "weapon/arc.qc"
+#include "weapon/porto.qh"
+#include "weapon/vaporizer.qh"
+#include "weapon/hook.qh"
+#include "weapon/hlac.qh"
+#include "weapon/tuba.qh"
+#include "weapon/rifle.qh"
+#include "weapon/fireball.qh"
+#include "weapon/seeker.qh"
+#include "weapon/shockwave.qh"
+#include "weapon/arc.qh"
index 9efbb29a2615aab18f98eaddd1a0359620455086..afbf79eb54777d0e2852366e9d44956ff69c3966 100644 (file)
@@ -50,9 +50,9 @@
 #ifdef SVQC
        #include "config.qc"
 #endif
-#define IMPLEMENTATION
-#include "all.inc"
-#undef IMPLEMENTATION
+
+#include "weapon/_mod.inc"
+
 
 // WEAPON PLUGIN SYSTEM
 
@@ -639,12 +639,12 @@ CLIENT_COMMAND(weapon_find, "Show spawn locations of a weapon")
                }
                default:
                {
-                       LOG_INFOF("Incorrect parameters for ^2%s^7\n", "weapon_find");
+                       LOG_INFOF("Incorrect parameters for ^2%s^7", "weapon_find");
                }
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 cl_cmd weapon_find weapon\n");
-                       LOG_INFO("  Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.\n");
+                       LOG_INFO("Usage:^3 cl_cmd weapon_find weapon");
+                       LOG_INFO("  Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.");
                        return;
                }
        }
index c88e3a70421b239a3468af98adb79d17c1460aeb..beaa6cb48a3773e2555b4817177696242b7b7e43 100644 (file)
@@ -64,17 +64,17 @@ GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPON
             if(wep_config_file >= 0)
             {
                 Dump_Weapon_Settings();
-                LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
+                LOG_INFOF("Dumping weapons... File located in ^2data/data/%s^7.", filename);
                 fclose(wep_config_file);
                 wep_config_file = -1;
                 wep_config_alsoprint = -1;
             }
             else
             {
-                LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
             }
             #else
-            LOG_INFO(_("Weapons dump command only works with sv_cmd.\n"));
+            LOG_INFO(_("Weapons dump command only works with sv_cmd."));
             #endif
             return;
         }
@@ -82,10 +82,10 @@ GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPON
         default:
         case CMD_REQUEST_USAGE:
         {
-            LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
-            LOG_INFO("  Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
-            LOG_INFO("  if supplied with '-' output to console as well as default,\n");
-            LOG_INFO("  if left blank, it will only write to default.\n");
+            LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]");
+            LOG_INFO("  Where 'filename' is the file to write (default is weapons_dump.cfg),");
+            LOG_INFO("  if supplied with '-' output to console as well as default,");
+            LOG_INFO("  if left blank, it will only write to default.");
             return;
         }
     }
index 513af5209d670cac485f046342922c5e003c0bf3..3323d8e36a5372eb6041e2348010a735b5f6e251 100644 (file)
@@ -57,7 +57,7 @@ vector damage_explosion_calcpush(vector explosion_f, vector target_v, float spee
        v = explosion_calcpush(explosion_f * speedfactor, m, target_v, 1, 0);
        // the factor we then get is:
        //   1
-       LOG_INFOF("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
+       LOG_INFOF("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f",
                m,
                target_v, target_v + v,
                target_v * target_v, m * explosion_f * speedfactor * explosion_f * speedfactor, target_v * target_v + m * explosion_f * speedfactor * explosion_f * speedfactor,
index a8194772cc69fad609edcd5e7cd1a299f69a49e8..d2443f1670d360767cbc6721f6a2722d2764997c 100644 (file)
@@ -48,7 +48,7 @@ void Dump_Weapon_Settings()
                WEP_CONFIG_WRITETOFILE("// }}}\n");
 
                // step 5: debug info
-               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.m_name, WEP_CONFIG_COUNT));
+               LOG_INFOF("#%d: %s: %d settings...", i, it.m_name, WEP_CONFIG_COUNT);
                totalweapons += 1;
                totalsettings += WEP_CONFIG_COUNT;
        });
@@ -59,5 +59,5 @@ void Dump_Weapon_Settings()
                config_queue[x] = string_null;
 
        // extra information
-       LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", totalweapons, totalsettings));
+       LOG_INFOF("Totals: %d weapons, %d settings", totalweapons, totalsettings);
 }
index ab24ec4a87d894c6c924ebde154b2df753e88516..4be22446bf9dae2f8a314138be4e4b4fd4909426 100644 (file)
@@ -4,7 +4,7 @@
 #include <common/stats.qh>
 
 #ifdef SVQC
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
 #endif
 
 USING(WepSet, vector);
@@ -198,6 +198,7 @@ const int WEP_TYPE_MELEE_PRI      = 0x400; // primary attack is melee swing (for
 const int WEP_TYPE_MELEE_SEC      = 0x800; // secondary attack is melee swing (for animation)
 const int WEP_FLAG_DUALWIELD      = 0x1000; // weapon can be dual wielded
 const int WEP_FLAG_NODUAL         = 0x2000; // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything
+const int WEP_FLAG_PENETRATEWALLS = 0x4000; // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO)
 
 // variables:
 string weaponorder_byid;
index ed5c966f1b17609b5817dcc3a01455e3a63ae996..47b92cc9f3a3819f27b6fff8bbb9be1f5496d664 100644 (file)
@@ -1,149 +1,5 @@
 #include "arc.qh"
-#ifndef IMPLEMENTATION
-CLASS(Arc, Weapon)
-/* ammotype  */ ATTRIB(Arc, ammo_field, .int, ammo_cells);
-/* impulse   */ ATTRIB(Arc, impulse, int, 3);
-/* flags     */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
-/* rating    */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
-/* color     */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
-/* modelname */ ATTRIB(Arc, mdl, string, "arc");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
-#endif
-/* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
-/* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
-/* wepimg    */ ATTRIB(Arc, model2, string, "weaponarc");
-/* refname   */ ATTRIB(Arc, netname, string, "arc");
-/* wepname   */ ATTRIB(Arc, m_name, string, _("Arc"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, bolt, float, NONE) \
-               P(class, prefix, bolt_ammo, float, NONE) \
-        P(class, prefix, bolt_damageforcescale, float, NONE) \
-        P(class, prefix, bolt_damage, float, NONE) \
-        P(class, prefix, bolt_edgedamage, float, NONE) \
-        P(class, prefix, bolt_force, float, NONE) \
-        P(class, prefix, bolt_health, float, NONE) \
-        P(class, prefix, bolt_lifetime, float, NONE) \
-        P(class, prefix, bolt_radius, float, NONE) \
-        P(class, prefix, bolt_refire, float, NONE) \
-        P(class, prefix, bolt_speed, float, NONE) \
-        P(class, prefix, bolt_spread, float, NONE) \
-               P(class, prefix, beam_ammo, float, NONE) \
-        P(class, prefix, beam_animtime, float, NONE) \
-        P(class, prefix, beam_botaimlifetime, float, NONE) \
-        P(class, prefix, beam_botaimspeed, float, NONE) \
-        P(class, prefix, beam_damage, float, NONE) \
-        P(class, prefix, beam_degreespersegment, float, NONE) \
-        P(class, prefix, beam_distancepersegment, float, NONE) \
-        P(class, prefix, beam_falloff_halflifedist, float, NONE) \
-        P(class, prefix, beam_falloff_maxdist, float, NONE) \
-        P(class, prefix, beam_falloff_mindist, float, NONE) \
-        P(class, prefix, beam_force, float, NONE) \
-        P(class, prefix, beam_healing_amax, float, NONE) \
-        P(class, prefix, beam_healing_aps, float, NONE) \
-        P(class, prefix, beam_healing_hmax, float, NONE) \
-        P(class, prefix, beam_healing_hps, float, NONE) \
-        P(class, prefix, beam_heat, float, NONE) /* heat increase per second (primary) */ \
-        P(class, prefix, beam_maxangle, float, NONE) \
-        P(class, prefix, beam_nonplayerdamage, float, NONE) \
-        P(class, prefix, beam_range, float, NONE) \
-        P(class, prefix, beam_refire, float, NONE) \
-        P(class, prefix, beam_returnspeed, float, NONE) \
-        P(class, prefix, beam_tightness, float, NONE) \
-        P(class, prefix, burst_ammo, float, NONE) \
-        P(class, prefix, burst_damage, float, NONE) \
-        P(class, prefix, burst_healing_aps, float, NONE) \
-        P(class, prefix, burst_healing_hps, float, NONE) \
-        P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
-        P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
-        P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
-        P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
-        P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-    END()
-    W_PROPS(X, Arc, arc)
-#undef X
-
-ENDCLASS(Arc)
-REGISTER_WEAPON(ARC, arc, NEW(Arc));
-
-
-#ifdef GAMEQC
-const float ARC_MAX_SEGMENTS = 20;
-vector arc_shotorigin[4];
-.vector beam_start;
-.vector beam_dir;
-.vector beam_wantdir;
-.int beam_type;
-
-const int ARC_BT_MISS =        0x00;
-const int ARC_BT_WALL =        0x01;
-const int ARC_BT_HEAL =        0x02;
-const int ARC_BT_HIT =         0x03;
-const int ARC_BT_BURST_MISS =  0x10;
-const int ARC_BT_BURST_WALL =  0x11;
-const int ARC_BT_BURST_HEAL =  0x12;
-const int ARC_BT_BURST_HIT =   0x13;
-const int ARC_BT_BURSTMASK =   0x10;
-
-const int ARC_SF_SETTINGS =    BIT(0);
-const int ARC_SF_START =       BIT(1);
-const int ARC_SF_WANTDIR =     BIT(2);
-const int ARC_SF_BEAMDIR =     BIT(3);
-const int ARC_SF_BEAMTYPE =    BIT(4);
-const int ARC_SF_LOCALMASK =   ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
-#endif
-#ifdef SVQC
-.entity arc_beam;
-.bool arc_BUTTON_ATCK_prev; // for better animation control
-.float beam_prev;
-.float beam_initialized;
-.float beam_bursting;
-.float beam_teleporttime;
-.float beam_heat; // (beam) amount of heat produced
-.float arc_overheat; // (dropped arc/player) time during which it's too hot
-.float arc_cooldown; // (dropped arc/player) cooling speed
-.float arc_heat_percent = _STAT(ARC_HEAT);
-.float arc_smoke_sound;
-#endif
-#ifdef CSQC
 
-.vector beam_color;
-.float beam_alpha;
-.float beam_thickness;
-.entity beam_traileffect;
-.entity beam_hiteffect;
-.float beam_hitlight[4]; // 0: radius, 123: rgb
-.entity beam_muzzleeffect;
-.float beam_muzzlelight[4]; // 0: radius, 123: rgb
-.string beam_image;
-
-.entity beam_muzzleentity;
-
-.float beam_degreespersegment;
-.float beam_distancepersegment;
-.float beam_usevieworigin;
-.float beam_initialized;
-.float beam_maxangle;
-.float beam_range;
-.float beam_returnspeed;
-.float beam_tightness;
-.vector beam_shotorigin;
-
-entity Draw_ArcBeam_callback_entity;
-float Draw_ArcBeam_callback_last_thickness;
-vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player.
-vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player.
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_arc) { weapon_defaultspawnfunc(this, WEP_ARC); }
 
@@ -1656,4 +1512,3 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..01c4f2f6a3cf7b8a71c5a5fbdd50e0ded97fe9df 100644 (file)
@@ -1 +1,144 @@
 #pragma once
+
+CLASS(Arc, Weapon)
+/* ammotype  */ ATTRIB(Arc, ammo_field, .int, ammo_cells);
+/* impulse   */ ATTRIB(Arc, impulse, int, 3);
+/* flags     */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
+/* rating    */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
+/* color     */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
+/* modelname */ ATTRIB(Arc, mdl, string, "arc");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
+#endif
+/* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
+/* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
+/* wepimg    */ ATTRIB(Arc, model2, string, "weaponarc");
+/* refname   */ ATTRIB(Arc, netname, string, "arc");
+/* wepname   */ ATTRIB(Arc, m_name, string, _("Arc"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, bolt, float, NONE) \
+               P(class, prefix, bolt_ammo, float, NONE) \
+        P(class, prefix, bolt_damageforcescale, float, NONE) \
+        P(class, prefix, bolt_damage, float, NONE) \
+        P(class, prefix, bolt_edgedamage, float, NONE) \
+        P(class, prefix, bolt_force, float, NONE) \
+        P(class, prefix, bolt_health, float, NONE) \
+        P(class, prefix, bolt_lifetime, float, NONE) \
+        P(class, prefix, bolt_radius, float, NONE) \
+        P(class, prefix, bolt_refire, float, NONE) \
+        P(class, prefix, bolt_speed, float, NONE) \
+        P(class, prefix, bolt_spread, float, NONE) \
+               P(class, prefix, beam_ammo, float, NONE) \
+        P(class, prefix, beam_animtime, float, NONE) \
+        P(class, prefix, beam_botaimlifetime, float, NONE) \
+        P(class, prefix, beam_botaimspeed, float, NONE) \
+        P(class, prefix, beam_damage, float, NONE) \
+        P(class, prefix, beam_degreespersegment, float, NONE) \
+        P(class, prefix, beam_distancepersegment, float, NONE) \
+        P(class, prefix, beam_falloff_halflifedist, float, NONE) \
+        P(class, prefix, beam_falloff_maxdist, float, NONE) \
+        P(class, prefix, beam_falloff_mindist, float, NONE) \
+        P(class, prefix, beam_force, float, NONE) \
+        P(class, prefix, beam_healing_amax, float, NONE) \
+        P(class, prefix, beam_healing_aps, float, NONE) \
+        P(class, prefix, beam_healing_hmax, float, NONE) \
+        P(class, prefix, beam_healing_hps, float, NONE) \
+        P(class, prefix, beam_heat, float, NONE) /* heat increase per second (primary) */ \
+        P(class, prefix, beam_maxangle, float, NONE) \
+        P(class, prefix, beam_nonplayerdamage, float, NONE) \
+        P(class, prefix, beam_range, float, NONE) \
+        P(class, prefix, beam_refire, float, NONE) \
+        P(class, prefix, beam_returnspeed, float, NONE) \
+        P(class, prefix, beam_tightness, float, NONE) \
+        P(class, prefix, burst_ammo, float, NONE) \
+        P(class, prefix, burst_damage, float, NONE) \
+        P(class, prefix, burst_healing_aps, float, NONE) \
+        P(class, prefix, burst_healing_hps, float, NONE) \
+        P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
+        P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
+        P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
+        P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
+        P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+    END()
+    W_PROPS(X, Arc, arc)
+#undef X
+
+ENDCLASS(Arc)
+REGISTER_WEAPON(ARC, arc, NEW(Arc));
+
+
+#ifdef GAMEQC
+const float ARC_MAX_SEGMENTS = 20;
+vector arc_shotorigin[4];
+.vector beam_start;
+.vector beam_dir;
+.vector beam_wantdir;
+.int beam_type;
+
+const int ARC_BT_MISS =        0x00;
+const int ARC_BT_WALL =        0x01;
+const int ARC_BT_HEAL =        0x02;
+const int ARC_BT_HIT =         0x03;
+const int ARC_BT_BURST_MISS =  0x10;
+const int ARC_BT_BURST_WALL =  0x11;
+const int ARC_BT_BURST_HEAL =  0x12;
+const int ARC_BT_BURST_HIT =   0x13;
+const int ARC_BT_BURSTMASK =   0x10;
+
+const int ARC_SF_SETTINGS =    BIT(0);
+const int ARC_SF_START =       BIT(1);
+const int ARC_SF_WANTDIR =     BIT(2);
+const int ARC_SF_BEAMDIR =     BIT(3);
+const int ARC_SF_BEAMTYPE =    BIT(4);
+const int ARC_SF_LOCALMASK =   ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
+#endif
+#ifdef SVQC
+.entity arc_beam;
+.bool arc_BUTTON_ATCK_prev; // for better animation control
+.float beam_prev;
+.float beam_initialized;
+.float beam_bursting;
+.float beam_teleporttime;
+.float beam_heat; // (beam) amount of heat produced
+.float arc_overheat; // (dropped arc/player) time during which it's too hot
+.float arc_cooldown; // (dropped arc/player) cooling speed
+.float arc_heat_percent = _STAT(ARC_HEAT);
+.float arc_smoke_sound;
+#endif
+#ifdef CSQC
+
+.vector beam_color;
+.float beam_alpha;
+.float beam_thickness;
+.entity beam_traileffect;
+.entity beam_hiteffect;
+.float beam_hitlight[4]; // 0: radius, 123: rgb
+.entity beam_muzzleeffect;
+.float beam_muzzlelight[4]; // 0: radius, 123: rgb
+.string beam_image;
+
+.entity beam_muzzleentity;
+
+.float beam_degreespersegment;
+.float beam_distancepersegment;
+.float beam_usevieworigin;
+.float beam_initialized;
+.float beam_maxangle;
+.float beam_range;
+.float beam_returnspeed;
+.float beam_tightness;
+.vector beam_shotorigin;
+
+entity Draw_ArcBeam_callback_entity;
+float Draw_ArcBeam_callback_last_thickness;
+vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player.
+vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player.
+#endif
index cc2fedccfe84e21be7ccedc038aa9e12985eba1f..ac1540cd51fc860038f1f04072b55c75a40e5656 100644 (file)
@@ -1,58 +1,5 @@
 #include "blaster.qh"
-#ifndef IMPLEMENTATION
-CLASS(Blaster, Weapon)
-/* ammotype  */ //ATTRIB(Blaster, ammo_field, .int, ammo_none);
-/* impulse   */ ATTRIB(Blaster, impulse, int, 1);
-/* flags     */ ATTRIB(Blaster, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0);
-/* color     */ ATTRIB(Blaster, wpcolor, vector, '1 0.5 0.5');
-/* modelname */ ATTRIB(Blaster, mdl, string, "laser");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM);
-#endif
-/* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
-/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
-/* wepimg    */ ATTRIB(Blaster, model2, string, "weaponlaser");
-/* refname   */ ATTRIB(Blaster, netname, string, "blaster");
-/* wepname   */ ATTRIB(Blaster, m_name, string, _("Blaster"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, delay, float, BOTH) \
-               P(class, prefix, edgedamage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, force_zscale, float, BOTH) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, radius, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, shotangle, float, BOTH) \
-               P(class, prefix, speed, float, BOTH) \
-               P(class, prefix, spread, float, BOTH) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-       W_PROPS(X, Blaster, blaster)
-#undef X
-
-ENDCLASS(Blaster)
-REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
 
-#ifdef SVQC
-.float blaster_damage;
-.float blaster_edgedamage;
-.float blaster_radius;
-.float blaster_force;
-.float blaster_lifetime;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_blaster) { weapon_defaultspawnfunc(this, WEP_BLASTER); }
 spawnfunc(weapon_laser) { spawnfunc_weapon_blaster(this); }
@@ -260,4 +207,3 @@ METHOD(Blaster, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..990add96bd8f271fe30571b524b148ba38536245 100644 (file)
@@ -1 +1,53 @@
 #pragma once
+
+CLASS(Blaster, Weapon)
+/* ammotype  */ //ATTRIB(Blaster, ammo_field, .int, ammo_none);
+/* impulse   */ ATTRIB(Blaster, impulse, int, 1);
+/* flags     */ ATTRIB(Blaster, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0);
+/* color     */ ATTRIB(Blaster, wpcolor, vector, '1 0.5 0.5');
+/* modelname */ ATTRIB(Blaster, mdl, string, "laser");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM);
+#endif
+/* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
+/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
+/* wepimg    */ ATTRIB(Blaster, model2, string, "weaponlaser");
+/* refname   */ ATTRIB(Blaster, netname, string, "blaster");
+/* wepname   */ ATTRIB(Blaster, m_name, string, _("Blaster"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, delay, float, BOTH) \
+               P(class, prefix, edgedamage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, force_zscale, float, BOTH) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, radius, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, secondary, float, NONE) \
+               P(class, prefix, shotangle, float, BOTH) \
+               P(class, prefix, speed, float, BOTH) \
+               P(class, prefix, spread, float, BOTH) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+       W_PROPS(X, Blaster, blaster)
+#undef X
+
+ENDCLASS(Blaster)
+REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
+
+#ifdef SVQC
+.float blaster_damage;
+.float blaster_edgedamage;
+.float blaster_radius;
+.float blaster_force;
+.float blaster_lifetime;
+#endif
index b3381fbc2fbbae4f41ccda9cb1e6e5453089872e..82b47037615e1d51cf6808e5ba55cf9fcb7a9493 100644 (file)
@@ -1,76 +1,5 @@
 #include "crylink.qh"
-#ifndef IMPLEMENTATION
-CLASS(Crylink, Weapon)
-/* ammotype  */ ATTRIB(Crylink, ammo_field, .int, ammo_cells);
-/* impulse   */ ATTRIB(Crylink, impulse, int, 6);
-/* flags     */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000);
-/* color     */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
-/* modelname */ ATTRIB(Crylink, mdl, string, "crylink");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM);
-#endif
-/* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink");
-/* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
-/* wepimg    */ ATTRIB(Crylink, model2, string, "weaponcrylink");
-/* refname   */ ATTRIB(Crylink, netname, string, "crylink");
-/* wepname   */ ATTRIB(Crylink, m_name, string, _("Crylink"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-        P(class, prefix, animtime, float, BOTH) \
-        P(class, prefix, bouncedamagefactor, float, BOTH) \
-        P(class, prefix, bounces, float, BOTH) \
-        P(class, prefix, damage, float, BOTH) \
-        P(class, prefix, edgedamage, float, BOTH) \
-        P(class, prefix, force, float, BOTH) \
-        P(class, prefix, joindelay, float, BOTH) \
-        P(class, prefix, joinexplode, float, BOTH) \
-        P(class, prefix, joinexplode_damage, float, BOTH) \
-        P(class, prefix, joinexplode_edgedamage, float, BOTH) \
-        P(class, prefix, joinexplode_force, float, BOTH) \
-        P(class, prefix, joinexplode_radius, float, BOTH) \
-        P(class, prefix, joinspread, float, BOTH) \
-        P(class, prefix, linkexplode, float, BOTH) \
-        P(class, prefix, middle_fadetime, float, BOTH) \
-        P(class, prefix, middle_lifetime, float, BOTH) \
-        P(class, prefix, other_fadetime, float, BOTH) \
-        P(class, prefix, other_lifetime, float, BOTH) \
-        P(class, prefix, radius, float, BOTH) \
-        P(class, prefix, refire, float, BOTH) \
-        P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, secondary, float, NONE) \
-        P(class, prefix, shots, float, BOTH) \
-        P(class, prefix, speed, float, BOTH) \
-        P(class, prefix, spreadtype, float, SEC) \
-        P(class, prefix, spread, float, BOTH) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-       W_PROPS(X, Crylink, crylink)
-#undef X
-
-ENDCLASS(Crylink)
-REGISTER_WEAPON(CRYLINK, crylink, NEW(Crylink));
 
-#ifdef SVQC
-.float gravity;
-.float crylink_waitrelease;
-.entity crylink_lastgroup;
-
-.entity crylink_owner; // we can't use realowner, as that's subject to change
-
-.entity queuenext;
-.entity queueprev;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_crylink) { weapon_defaultspawnfunc(this, WEP_CRYLINK); }
 
@@ -699,4 +628,3 @@ METHOD(Crylink, wr_impacteffect, void(entity thiswep, entity actor))
     }
 }
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..326fdf15bec0aa4d970b2b4f3264776868a23845 100644 (file)
@@ -1 +1,71 @@
 #pragma once
+
+CLASS(Crylink, Weapon)
+/* ammotype  */ ATTRIB(Crylink, ammo_field, .int, ammo_cells);
+/* impulse   */ ATTRIB(Crylink, impulse, int, 6);
+/* flags     */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000);
+/* color     */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
+/* modelname */ ATTRIB(Crylink, mdl, string, "crylink");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM);
+#endif
+/* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink");
+/* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
+/* wepimg    */ ATTRIB(Crylink, model2, string, "weaponcrylink");
+/* refname   */ ATTRIB(Crylink, netname, string, "crylink");
+/* wepname   */ ATTRIB(Crylink, m_name, string, _("Crylink"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+        P(class, prefix, animtime, float, BOTH) \
+        P(class, prefix, bouncedamagefactor, float, BOTH) \
+        P(class, prefix, bounces, float, BOTH) \
+        P(class, prefix, damage, float, BOTH) \
+        P(class, prefix, edgedamage, float, BOTH) \
+        P(class, prefix, force, float, BOTH) \
+        P(class, prefix, joindelay, float, BOTH) \
+        P(class, prefix, joinexplode, float, BOTH) \
+        P(class, prefix, joinexplode_damage, float, BOTH) \
+        P(class, prefix, joinexplode_edgedamage, float, BOTH) \
+        P(class, prefix, joinexplode_force, float, BOTH) \
+        P(class, prefix, joinexplode_radius, float, BOTH) \
+        P(class, prefix, joinspread, float, BOTH) \
+        P(class, prefix, linkexplode, float, BOTH) \
+        P(class, prefix, middle_fadetime, float, BOTH) \
+        P(class, prefix, middle_lifetime, float, BOTH) \
+        P(class, prefix, other_fadetime, float, BOTH) \
+        P(class, prefix, other_lifetime, float, BOTH) \
+        P(class, prefix, radius, float, BOTH) \
+        P(class, prefix, refire, float, BOTH) \
+        P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+        P(class, prefix, secondary, float, NONE) \
+        P(class, prefix, shots, float, BOTH) \
+        P(class, prefix, speed, float, BOTH) \
+        P(class, prefix, spreadtype, float, SEC) \
+        P(class, prefix, spread, float, BOTH) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+       W_PROPS(X, Crylink, crylink)
+#undef X
+
+ENDCLASS(Crylink)
+REGISTER_WEAPON(CRYLINK, crylink, NEW(Crylink));
+
+#ifdef SVQC
+.float gravity;
+.float crylink_waitrelease;
+.entity crylink_lastgroup;
+
+.entity crylink_owner; // we can't use realowner, as that's subject to change
+
+.entity queuenext;
+.entity queueprev;
+#endif
index dbdb7374b0244c3a26849680c5b21ac103ded86e..88d50f80a021eb01dadb77cb867a4bd7a85611fa 100644 (file)
@@ -1,73 +1,5 @@
 #include "devastator.qh"
-#ifndef IMPLEMENTATION
-CLASS(Devastator, Weapon)
-/* ammotype  */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets);
-/* impulse   */ ATTRIB(Devastator, impulse, int, 9);
-/* flags     */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
-/* color     */ ATTRIB(Devastator, wpcolor, vector, '1 1 0');
-/* modelname */ ATTRIB(Devastator, mdl, string, "rl");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM);
-#endif
-/* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher");
-/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
-/* wepimg    */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
-/* refname   */ ATTRIB(Devastator, netname, string, "devastator");
-/* wepname   */ ATTRIB(Devastator, m_name, string, _("Devastator"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, NONE) \
-        P(class, prefix, animtime, float, NONE) \
-        P(class, prefix, damageforcescale, float, NONE) \
-        P(class, prefix, damage, float, NONE) \
-        P(class, prefix, detonatedelay, float, NONE) \
-        P(class, prefix, edgedamage, float, NONE) \
-        P(class, prefix, force, float, NONE) \
-        P(class, prefix, guidedelay, float, NONE) \
-        P(class, prefix, guidegoal, float, NONE) \
-        P(class, prefix, guideratedelay, float, NONE) \
-        P(class, prefix, guiderate, float, NONE) \
-        P(class, prefix, guidestop, float, NONE) \
-        P(class, prefix, health, float, NONE) \
-        P(class, prefix, lifetime, float, NONE) \
-        P(class, prefix, radius, float, NONE) \
-        P(class, prefix, refire, float, NONE) \
-               P(class, prefix, reload_ammo, float, NONE) \
-               P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, remote_damage, float, NONE) \
-        P(class, prefix, remote_edgedamage, float, NONE) \
-        P(class, prefix, remote_force, float, NONE) \
-        P(class, prefix, remote_jump_damage, float, NONE) \
-        P(class, prefix, remote_jump_force, float, NONE) \
-        P(class, prefix, remote_jump_radius, float, NONE) \
-        P(class, prefix, remote_jump_velocity_z_add, float, NONE) \
-        P(class, prefix, remote_jump_velocity_z_max, float, NONE) \
-        P(class, prefix, remote_jump_velocity_z_min, float, NONE) \
-        P(class, prefix, remote_radius, float, NONE) \
-        P(class, prefix, speedaccel, float, NONE) \
-        P(class, prefix, speedstart, float, NONE) \
-        P(class, prefix, speed, float, NONE) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, weaponreplace, string,NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-       W_PROPS(X, Devastator, devastator)
-#undef X
-
-ENDCLASS(Devastator)
-REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
 
-#ifdef SVQC
-.float rl_release;
-.float rl_detonate_later;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_devastator) { weapon_defaultspawnfunc(this, WEP_DEVASTATOR); }
 spawnfunc(weapon_rocketlauncher) { spawnfunc_weapon_devastator(this); }
@@ -557,14 +489,14 @@ METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor, .entity wea
     #if 0
     if(actor.rl_release == 0)
     {
-        LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo));
+        LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo));
         return true;
     }
     else
     {
         ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(devastator, ammo);
         ammo_amount += actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
-        LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
+        LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
         return ammo_amount;
     }
     #else
@@ -615,4 +547,3 @@ METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..dd68ccf58e3f6ad223ecc4b68a79366cebd98c3e 100644 (file)
@@ -1 +1,68 @@
 #pragma once
+
+CLASS(Devastator, Weapon)
+/* ammotype  */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets);
+/* impulse   */ ATTRIB(Devastator, impulse, int, 9);
+/* flags     */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
+/* color     */ ATTRIB(Devastator, wpcolor, vector, '1 1 0');
+/* modelname */ ATTRIB(Devastator, mdl, string, "rl");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM);
+#endif
+/* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher");
+/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
+/* wepimg    */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
+/* refname   */ ATTRIB(Devastator, netname, string, "devastator");
+/* wepname   */ ATTRIB(Devastator, m_name, string, _("Devastator"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, NONE) \
+        P(class, prefix, animtime, float, NONE) \
+        P(class, prefix, damageforcescale, float, NONE) \
+        P(class, prefix, damage, float, NONE) \
+        P(class, prefix, detonatedelay, float, NONE) \
+        P(class, prefix, edgedamage, float, NONE) \
+        P(class, prefix, force, float, NONE) \
+        P(class, prefix, guidedelay, float, NONE) \
+        P(class, prefix, guidegoal, float, NONE) \
+        P(class, prefix, guideratedelay, float, NONE) \
+        P(class, prefix, guiderate, float, NONE) \
+        P(class, prefix, guidestop, float, NONE) \
+        P(class, prefix, health, float, NONE) \
+        P(class, prefix, lifetime, float, NONE) \
+        P(class, prefix, radius, float, NONE) \
+        P(class, prefix, refire, float, NONE) \
+               P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+        P(class, prefix, remote_damage, float, NONE) \
+        P(class, prefix, remote_edgedamage, float, NONE) \
+        P(class, prefix, remote_force, float, NONE) \
+        P(class, prefix, remote_jump_damage, float, NONE) \
+        P(class, prefix, remote_jump_force, float, NONE) \
+        P(class, prefix, remote_jump_radius, float, NONE) \
+        P(class, prefix, remote_jump_velocity_z_add, float, NONE) \
+        P(class, prefix, remote_jump_velocity_z_max, float, NONE) \
+        P(class, prefix, remote_jump_velocity_z_min, float, NONE) \
+        P(class, prefix, remote_radius, float, NONE) \
+        P(class, prefix, speedaccel, float, NONE) \
+        P(class, prefix, speedstart, float, NONE) \
+        P(class, prefix, speed, float, NONE) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, weaponreplace, string,NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+       W_PROPS(X, Devastator, devastator)
+#undef X
+
+ENDCLASS(Devastator)
+REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
+
+#ifdef SVQC
+.float rl_release;
+.float rl_detonate_later;
+#endif
index 9d01d1c329c46ecc6fb1de8e07f7631e9269ece7..f2fb14614004e9ef2982d5656753514ad7ecf016 100644 (file)
@@ -1,79 +1,5 @@
 #include "electro.qh"
-#ifndef IMPLEMENTATION
-CLASS(Electro, Weapon)
-/* ammotype  */ ATTRIB(Electro, ammo_field, .int, ammo_cells);
-/* impulse   */ ATTRIB(Electro, impulse, int, 5);
-/* flags     */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000);
-/* color     */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1');
-/* modelname */ ATTRIB(Electro, mdl, string, "electro");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM);
-#endif
-/* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro");
-/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
-/* wepimg    */ ATTRIB(Electro, model2, string, "weaponelectro");
-/* refname   */ ATTRIB(Electro, netname, string, "electro");
-/* wepname   */ ATTRIB(Electro, m_name, string, _("Electro"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, bouncefactor, float, SEC) \
-               P(class, prefix, bouncestop, float, SEC) \
-               P(class, prefix, comboradius, float, PRI) \
-               P(class, prefix, combo_comboradius, float, NONE) \
-               P(class, prefix, combo_comboradius_thruwall, float, NONE) \
-               P(class, prefix, combo_damage, float, NONE) \
-               P(class, prefix, combo_edgedamage, float, NONE) \
-               P(class, prefix, combo_force, float, NONE) \
-               P(class, prefix, combo_radius, float, NONE) \
-               P(class, prefix, combo_safeammocheck, float, NONE) \
-               P(class, prefix, combo_speed, float, NONE) \
-               P(class, prefix, count, float, SEC) \
-               P(class, prefix, damagedbycontents, float, SEC) \
-               P(class, prefix, damageforcescale, float, SEC) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, edgedamage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, health, float, SEC) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, midaircombo_explode, float, PRI) \
-               P(class, prefix, midaircombo_interval, float, PRI) \
-               P(class, prefix, midaircombo_radius, float, PRI) \
-               P(class, prefix, radius, float, BOTH) \
-               P(class, prefix, refire2, float, SEC) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, reload_ammo, float, NONE) \
-               P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, speed, float, BOTH) \
-               P(class, prefix, speed_up, float, SEC) \
-               P(class, prefix, speed_z, float, SEC) \
-               P(class, prefix, spread, float, BOTH) \
-               P(class, prefix, stick, float, SEC) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, touchexplode, float, SEC) \
-               P(class, prefix, weaponreplace, string,NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-       W_PROPS(X, Electro, electro)
-#undef X
-
-ENDCLASS(Electro)
-REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
-
 
-#ifdef SVQC
-.float electro_count;
-.float electro_secondarytime;
-void W_Electro_ExplodeCombo(entity this);
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_electro) { weapon_defaultspawnfunc(this, WEP_ELECTRO); }
 
@@ -643,4 +569,3 @@ METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..32b45c6928f2bb7faf1fe94919ef03260f7ce5fe 100644 (file)
@@ -1 +1,74 @@
 #pragma once
+
+CLASS(Electro, Weapon)
+/* ammotype  */ ATTRIB(Electro, ammo_field, .int, ammo_cells);
+/* impulse   */ ATTRIB(Electro, impulse, int, 5);
+/* flags     */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000);
+/* color     */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1');
+/* modelname */ ATTRIB(Electro, mdl, string, "electro");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM);
+#endif
+/* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro");
+/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
+/* wepimg    */ ATTRIB(Electro, model2, string, "weaponelectro");
+/* refname   */ ATTRIB(Electro, netname, string, "electro");
+/* wepname   */ ATTRIB(Electro, m_name, string, _("Electro"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, bouncefactor, float, SEC) \
+               P(class, prefix, bouncestop, float, SEC) \
+               P(class, prefix, comboradius, float, PRI) \
+               P(class, prefix, combo_comboradius, float, NONE) \
+               P(class, prefix, combo_comboradius_thruwall, float, NONE) \
+               P(class, prefix, combo_damage, float, NONE) \
+               P(class, prefix, combo_edgedamage, float, NONE) \
+               P(class, prefix, combo_force, float, NONE) \
+               P(class, prefix, combo_radius, float, NONE) \
+               P(class, prefix, combo_safeammocheck, float, NONE) \
+               P(class, prefix, combo_speed, float, NONE) \
+               P(class, prefix, count, float, SEC) \
+               P(class, prefix, damagedbycontents, float, SEC) \
+               P(class, prefix, damageforcescale, float, SEC) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, edgedamage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, health, float, SEC) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, midaircombo_explode, float, PRI) \
+               P(class, prefix, midaircombo_interval, float, PRI) \
+               P(class, prefix, midaircombo_radius, float, PRI) \
+               P(class, prefix, radius, float, BOTH) \
+               P(class, prefix, refire2, float, SEC) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, speed, float, BOTH) \
+               P(class, prefix, speed_up, float, SEC) \
+               P(class, prefix, speed_z, float, SEC) \
+               P(class, prefix, spread, float, BOTH) \
+               P(class, prefix, stick, float, SEC) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, touchexplode, float, SEC) \
+               P(class, prefix, weaponreplace, string,NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+       W_PROPS(X, Electro, electro)
+#undef X
+
+ENDCLASS(Electro)
+REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
+
+
+#ifdef SVQC
+.float electro_count;
+.float electro_secondarytime;
+void W_Electro_ExplodeCombo(entity this);
+#endif
index e968f881f25f9c14012ae78ad6435a24a37980ae..3f9cd4c4e18f6d731d2d7db54764b983ceb8ec0e 100644 (file)
@@ -1,65 +1,5 @@
 #include "fireball.qh"
-#ifndef IMPLEMENTATION
-CLASS(Fireball, Weapon)
-/* ammotype  */ //ATTRIB(Fireball, ammo_field, .int, ammo_none);
-/* impulse   */ ATTRIB(Fireball, impulse, int, 9);
-/* flags     */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000);
-/* color     */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0');
-/* modelname */ ATTRIB(Fireball, mdl, string, "fireball");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM);
-#endif
-/* crosshair */ ATTRIB(Fireball, w_crosshair, string, "gfx/crosshairfireball");
-/* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65);
-/* wepimg    */ ATTRIB(Fireball, model2, string, "weaponfireball");
-/* refname   */ ATTRIB(Fireball, netname, string, "fireball");
-/* wepname   */ ATTRIB(Fireball, m_name, string, _("Fireball"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, bfgdamage, float, PRI) \
-               P(class, prefix, bfgforce, float, PRI) \
-               P(class, prefix, bfgradius, float, PRI) \
-               P(class, prefix, damageforcescale, float, BOTH) \
-               P(class, prefix, damagetime, float, SEC) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, edgedamage, float, PRI) \
-               P(class, prefix, force, float, PRI) \
-               P(class, prefix, health, float, PRI) \
-               P(class, prefix, laserburntime, float, BOTH) \
-               P(class, prefix, laserdamage, float, BOTH) \
-               P(class, prefix, laseredgedamage, float, BOTH) \
-               P(class, prefix, laserradius, float, BOTH) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, radius, float, PRI) \
-               P(class, prefix, refire2, float, PRI) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, speed, float, BOTH) \
-               P(class, prefix, speed_up, float, SEC) \
-               P(class, prefix, speed_z, float, SEC) \
-               P(class, prefix, spread, float, BOTH) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, weaponreplace, string,NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-       W_PROPS(X, Fireball, fireball)
-#undef X
-
-ENDCLASS(Fireball)
-REGISTER_WEAPON(FIREBALL, fireball, NEW(Fireball));
 
-#ifdef SVQC
-.float bot_primary_fireballmooth; // whatever a mooth is
-.vector fireball_impactvec;
-.float fireball_primarytime;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_fireball) { weapon_defaultspawnfunc(this, WEP_FIREBALL); }
 
@@ -456,4 +396,3 @@ METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..d6d8f017edc9c0027726200f00a89b689f895321 100644 (file)
@@ -1 +1,60 @@
 #pragma once
+
+CLASS(Fireball, Weapon)
+/* ammotype  */ //ATTRIB(Fireball, ammo_field, .int, ammo_none);
+/* impulse   */ ATTRIB(Fireball, impulse, int, 9);
+/* flags     */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000);
+/* color     */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0');
+/* modelname */ ATTRIB(Fireball, mdl, string, "fireball");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM);
+#endif
+/* crosshair */ ATTRIB(Fireball, w_crosshair, string, "gfx/crosshairfireball");
+/* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65);
+/* wepimg    */ ATTRIB(Fireball, model2, string, "weaponfireball");
+/* refname   */ ATTRIB(Fireball, netname, string, "fireball");
+/* wepname   */ ATTRIB(Fireball, m_name, string, _("Fireball"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, bfgdamage, float, PRI) \
+               P(class, prefix, bfgforce, float, PRI) \
+               P(class, prefix, bfgradius, float, PRI) \
+               P(class, prefix, damageforcescale, float, BOTH) \
+               P(class, prefix, damagetime, float, SEC) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, edgedamage, float, PRI) \
+               P(class, prefix, force, float, PRI) \
+               P(class, prefix, health, float, PRI) \
+               P(class, prefix, laserburntime, float, BOTH) \
+               P(class, prefix, laserdamage, float, BOTH) \
+               P(class, prefix, laseredgedamage, float, BOTH) \
+               P(class, prefix, laserradius, float, BOTH) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, radius, float, PRI) \
+               P(class, prefix, refire2, float, PRI) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, speed, float, BOTH) \
+               P(class, prefix, speed_up, float, SEC) \
+               P(class, prefix, speed_z, float, SEC) \
+               P(class, prefix, spread, float, BOTH) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, weaponreplace, string,NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+       W_PROPS(X, Fireball, fireball)
+#undef X
+
+ENDCLASS(Fireball)
+REGISTER_WEAPON(FIREBALL, fireball, NEW(Fireball));
+
+#ifdef SVQC
+.float bot_primary_fireballmooth; // whatever a mooth is
+.vector fireball_impactvec;
+.float fireball_primarytime;
+#endif
index f7b289278608a7a0591abb74481d2d0878965302..5272e6060a8fdab0c417ab986c96898fe2097f07 100644 (file)
@@ -1,64 +1,5 @@
 #include "hagar.qh"
-#ifndef IMPLEMENTATION
-CLASS(Hagar, Weapon)
-/* ammotype  */ ATTRIB(Hagar, ammo_field, .int, ammo_rockets);
-/* impulse   */ ATTRIB(Hagar, impulse, int, 8);
-/* flags     */ ATTRIB(Hagar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Hagar, bot_pickupbasevalue, float, 6000);
-/* color     */ ATTRIB(Hagar, wpcolor, vector, '1 1 0.5');
-/* modelname */ ATTRIB(Hagar, mdl, string, "hagar");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Hagar, m_model, Model, MDL_HAGAR_ITEM);
-#endif
-/* crosshair */ ATTRIB(Hagar, w_crosshair, string, "gfx/crosshairhagar");
-/* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8);
-/* wepimg    */ ATTRIB(Hagar, model2, string, "weaponhagar");
-/* refname   */ ATTRIB(Hagar, netname, string, "hagar");
-/* wepname   */ ATTRIB(Hagar, m_name, string, _("Hagar"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-        P(class, prefix, damageforcescale, float, BOTH) \
-        P(class, prefix, damage, float, BOTH) \
-        P(class, prefix, edgedamage, float, BOTH) \
-        P(class, prefix, force, float, BOTH) \
-        P(class, prefix, health, float, BOTH) \
-        P(class, prefix, lifetime, float, PRI) \
-        P(class, prefix, lifetime_min, float, SEC) \
-        P(class, prefix, lifetime_rand, float, SEC) \
-        P(class, prefix, load, float, SEC) \
-        P(class, prefix, load_abort, float, SEC) \
-        P(class, prefix, load_animtime, float, SEC) \
-        P(class, prefix, load_hold, float, SEC) \
-        P(class, prefix, load_linkexplode, float, SEC) \
-        P(class, prefix, load_max, float, SEC) \
-        P(class, prefix, load_releasedeath, float, SEC) \
-        P(class, prefix, load_speed, float, SEC) \
-        P(class, prefix, load_spread, float, SEC) \
-        P(class, prefix, load_spread_bias, float, SEC) \
-        P(class, prefix, radius, float, BOTH) \
-        P(class, prefix, refire, float, BOTH) \
-        P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, secondary, float, NONE) \
-        P(class, prefix, speed, float, BOTH) \
-        P(class, prefix, spread, float, BOTH) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string,NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Hagar, hagar)
-#undef X
-
-ENDCLASS(Hagar)
-REGISTER_WEAPON(HAGAR, hagar, NEW(Hagar));
 
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_hagar) { weapon_defaultspawnfunc(this, WEP_HAGAR); }
 
@@ -569,4 +510,3 @@ METHOD(Hagar, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..7dfd3c6312541e47f4534f3af1cb756a3a5abbc6 100644 (file)
@@ -1 +1,58 @@
 #pragma once
+
+CLASS(Hagar, Weapon)
+/* ammotype  */ ATTRIB(Hagar, ammo_field, .int, ammo_rockets);
+/* impulse   */ ATTRIB(Hagar, impulse, int, 8);
+/* flags     */ ATTRIB(Hagar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(Hagar, bot_pickupbasevalue, float, 6000);
+/* color     */ ATTRIB(Hagar, wpcolor, vector, '1 1 0.5');
+/* modelname */ ATTRIB(Hagar, mdl, string, "hagar");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Hagar, m_model, Model, MDL_HAGAR_ITEM);
+#endif
+/* crosshair */ ATTRIB(Hagar, w_crosshair, string, "gfx/crosshairhagar");
+/* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8);
+/* wepimg    */ ATTRIB(Hagar, model2, string, "weaponhagar");
+/* refname   */ ATTRIB(Hagar, netname, string, "hagar");
+/* wepname   */ ATTRIB(Hagar, m_name, string, _("Hagar"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+        P(class, prefix, damageforcescale, float, BOTH) \
+        P(class, prefix, damage, float, BOTH) \
+        P(class, prefix, edgedamage, float, BOTH) \
+        P(class, prefix, force, float, BOTH) \
+        P(class, prefix, health, float, BOTH) \
+        P(class, prefix, lifetime, float, PRI) \
+        P(class, prefix, lifetime_min, float, SEC) \
+        P(class, prefix, lifetime_rand, float, SEC) \
+        P(class, prefix, load, float, SEC) \
+        P(class, prefix, load_abort, float, SEC) \
+        P(class, prefix, load_animtime, float, SEC) \
+        P(class, prefix, load_hold, float, SEC) \
+        P(class, prefix, load_linkexplode, float, SEC) \
+        P(class, prefix, load_max, float, SEC) \
+        P(class, prefix, load_releasedeath, float, SEC) \
+        P(class, prefix, load_speed, float, SEC) \
+        P(class, prefix, load_spread, float, SEC) \
+        P(class, prefix, load_spread_bias, float, SEC) \
+        P(class, prefix, radius, float, BOTH) \
+        P(class, prefix, refire, float, BOTH) \
+        P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+        P(class, prefix, secondary, float, NONE) \
+        P(class, prefix, speed, float, BOTH) \
+        P(class, prefix, spread, float, BOTH) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string,NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Hagar, hagar)
+#undef X
+
+ENDCLASS(Hagar)
+REGISTER_WEAPON(HAGAR, hagar, NEW(Hagar));
index 6e03b1041406233b5c0130f08be7c8782c79c25f..0193270a61e592108213e723afccba610d636e92 100644 (file)
@@ -1,57 +1,5 @@
 #include "hlac.qh"
-#ifndef IMPLEMENTATION
-CLASS(HLAC, Weapon)
-/* ammotype  */ ATTRIB(HLAC, ammo_field, .int, ammo_cells);
-/* impulse   */ ATTRIB(HLAC, impulse, int, 6);
-/* flags     */ ATTRIB(HLAC, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(HLAC, bot_pickupbasevalue, float, 4000);
-/* color     */ ATTRIB(HLAC, wpcolor, vector, '0 1 0');
-/* modelname */ ATTRIB(HLAC, mdl, string, "hlac");
-#ifdef GAMEQC
-/* model     */ ATTRIB(HLAC, m_model, Model, MDL_HLAC_ITEM);
-#endif
-/* crosshair */ ATTRIB(HLAC, w_crosshair, string, "gfx/crosshairhlac");
-/* crosshair */ ATTRIB(HLAC, w_crosshair_size, float, 0.6);
-/* wepimg    */ ATTRIB(HLAC, model2, string, "weaponhlac");
-/* refname   */ ATTRIB(HLAC, netname, string, "hlac");
-/* wepname   */ ATTRIB(HLAC, m_name, string, _("Heavy Laser Assault Cannon"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, edgedamage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, radius, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, reload_ammo, float, NONE) \
-               P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, shots, float, SEC) \
-               P(class, prefix, speed, float, BOTH) \
-               P(class, prefix, spread, float, SEC) \
-               P(class, prefix, spread_add, float, PRI) \
-               P(class, prefix, spread_crouchmod, float, BOTH) \
-               P(class, prefix, spread_max, float, PRI) \
-               P(class, prefix, spread_min, float, PRI) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, weaponreplace, string,NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, HLAC, hlac)
-#undef X
-
-ENDCLASS(HLAC)
-REGISTER_WEAPON(HLAC, hlac, NEW(HLAC));
-
 
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_hlac) { weapon_defaultspawnfunc(this, WEP_HLAC); }
 
@@ -277,4 +225,3 @@ METHOD(HLAC, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..f965abcbf79e62fac163c5f2c52dec2e98fb476e 100644 (file)
@@ -1 +1,50 @@
 #pragma once
+
+CLASS(HLAC, Weapon)
+/* ammotype  */ ATTRIB(HLAC, ammo_field, .int, ammo_cells);
+/* impulse   */ ATTRIB(HLAC, impulse, int, 6);
+/* flags     */ ATTRIB(HLAC, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(HLAC, bot_pickupbasevalue, float, 4000);
+/* color     */ ATTRIB(HLAC, wpcolor, vector, '0 1 0');
+/* modelname */ ATTRIB(HLAC, mdl, string, "hlac");
+#ifdef GAMEQC
+/* model     */ ATTRIB(HLAC, m_model, Model, MDL_HLAC_ITEM);
+#endif
+/* crosshair */ ATTRIB(HLAC, w_crosshair, string, "gfx/crosshairhlac");
+/* crosshair */ ATTRIB(HLAC, w_crosshair_size, float, 0.6);
+/* wepimg    */ ATTRIB(HLAC, model2, string, "weaponhlac");
+/* refname   */ ATTRIB(HLAC, netname, string, "hlac");
+/* wepname   */ ATTRIB(HLAC, m_name, string, _("Heavy Laser Assault Cannon"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, edgedamage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, radius, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, secondary, float, NONE) \
+               P(class, prefix, shots, float, SEC) \
+               P(class, prefix, speed, float, BOTH) \
+               P(class, prefix, spread, float, SEC) \
+               P(class, prefix, spread_add, float, PRI) \
+               P(class, prefix, spread_crouchmod, float, BOTH) \
+               P(class, prefix, spread_max, float, PRI) \
+               P(class, prefix, spread_min, float, PRI) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, weaponreplace, string,NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, HLAC, hlac)
+#undef X
+
+ENDCLASS(HLAC)
+REGISTER_WEAPON(HLAC, hlac, NEW(HLAC));
index 26c04ad4fa200f536252a5389b5dea089137932b..d92e0caa8538b4c9ec4ccc5c0bc79a3fef41e7f4 100644 (file)
@@ -1,83 +1,7 @@
 #include "hook.qh"
-#ifndef IMPLEMENTATION
-CLASS(Hook, Weapon)
-/* ammotype  */ ATTRIB(Hook, ammo_field, .int, ammo_fuel);
-/* impulse   */ ATTRIB(Hook, impulse, int, 0);
-/* flags     */ ATTRIB(Hook, spawnflags, int, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
-/* color     */ ATTRIB(Hook, wpcolor, vector, '0 0.5 0');
-/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
-#endif
-/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
-/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
-/* wepimg    */ ATTRIB(Hook, model2, string, "weaponhook");
-/* refname   */ ATTRIB(Hook, netname, string, "hook");
-/* wepname   */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
-       ATTRIB(Hook, ammo_factor, float, 1);
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, PRI) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, damageforcescale, float, SEC) \
-               P(class, prefix, damage, float, SEC) \
-               P(class, prefix, duration, float, SEC) \
-               P(class, prefix, edgedamage, float, SEC) \
-               P(class, prefix, force, float, SEC) \
-               P(class, prefix, gravity, float, SEC) \
-               P(class, prefix, health, float, SEC) \
-               P(class, prefix, hooked_ammo, float, PRI) \
-               P(class, prefix, hooked_time_free, float, PRI) \
-               P(class, prefix, hooked_time_max, float, PRI) \
-               P(class, prefix, lifetime, float, SEC) \
-               P(class, prefix, power, float, SEC) \
-               P(class, prefix, radius, float, SEC) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, speed, float, SEC) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Hook, hook)
-#undef X
-
-ENDCLASS(Hook)
-REGISTER_WEAPON(HOOK, hook, NEW(Hook));
-
-CLASS(OffhandHook, OffhandWeapon)
-#ifdef SVQC
-    METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
-    {
-       Weapon wep = WEP_HOOK;
-       .entity weaponentity = weaponentities[1];
-       wep.wr_think(wep, actor, weaponentity, key_pressed ? 1 : 0);
-    }
-#endif
-ENDCLASS(OffhandHook)
-OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
 
 #ifdef SVQC
 
-.float dmg;
-.float dmg_edge;
-.float dmg_radius;
-.float dmg_force;
-.float dmg_power;
-.float dmg_duration;
-.float dmg_last;
-.float hook_refire;
-.float hook_time_hooked;
-.float hook_time_fueldecrease;
-#endif
-#endif
-#ifdef IMPLEMENTATION
-#ifdef SVQC
-
 spawnfunc(weapon_hook) { weapon_defaultspawnfunc(this, WEP_HOOK); }
 
 void W_Hook_ExplodeThink(entity this)
@@ -583,5 +507,3 @@ NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
 
 // TODO: hook: temporarily transform this.origin for drawing the model along warpzones!
 #endif
-
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..f67db3d00d462ac141c52be86adc2d6879b49bdb 100644 (file)
@@ -1 +1,76 @@
 #pragma once
+
+CLASS(Hook, Weapon)
+/* ammotype  */ ATTRIB(Hook, ammo_field, .int, ammo_fuel);
+/* impulse   */ ATTRIB(Hook, impulse, int, 0);
+/* flags     */ ATTRIB(Hook, spawnflags, int, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
+/* color     */ ATTRIB(Hook, wpcolor, vector, '0 0.5 0');
+/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
+#endif
+/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
+/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
+/* wepimg    */ ATTRIB(Hook, model2, string, "weaponhook");
+/* refname   */ ATTRIB(Hook, netname, string, "hook");
+/* wepname   */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
+       ATTRIB(Hook, ammo_factor, float, 1);
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, PRI) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, damageforcescale, float, SEC) \
+               P(class, prefix, damage, float, SEC) \
+               P(class, prefix, duration, float, SEC) \
+               P(class, prefix, edgedamage, float, SEC) \
+               P(class, prefix, force, float, SEC) \
+               P(class, prefix, gravity, float, SEC) \
+               P(class, prefix, health, float, SEC) \
+               P(class, prefix, hooked_ammo, float, PRI) \
+               P(class, prefix, hooked_time_free, float, PRI) \
+               P(class, prefix, hooked_time_max, float, PRI) \
+               P(class, prefix, lifetime, float, SEC) \
+               P(class, prefix, power, float, SEC) \
+               P(class, prefix, radius, float, SEC) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, speed, float, SEC) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Hook, hook)
+#undef X
+
+ENDCLASS(Hook)
+REGISTER_WEAPON(HOOK, hook, NEW(Hook));
+
+CLASS(OffhandHook, OffhandWeapon)
+#ifdef SVQC
+    METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
+    {
+       Weapon wep = WEP_HOOK;
+       .entity weaponentity = weaponentities[1];
+       wep.wr_think(wep, actor, weaponentity, key_pressed ? 1 : 0);
+    }
+#endif
+ENDCLASS(OffhandHook)
+OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
+
+#ifdef SVQC
+
+.float dmg;
+.float dmg_edge;
+.float dmg_radius;
+.float dmg_force;
+.float dmg_power;
+.float dmg_duration;
+.float dmg_last;
+.float hook_refire;
+.float hook_time_hooked;
+.float hook_time_fueldecrease;
+#endif
index 163b81ca117398056acefca567c42d3b636e7611..c4f3b9bb3b29183bbcd25d0243eefdde0f5bec76 100644 (file)
@@ -1,63 +1,5 @@
 #include "machinegun.qh"
-#ifndef IMPLEMENTATION
-CLASS(MachineGun, Weapon)
-/* ammotype  */ ATTRIB(MachineGun, ammo_field, .int, ammo_nails);
-/* impulse   */ ATTRIB(MachineGun, impulse, int, 3);
-/* flags     */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN);
-/* rating    */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000);
-/* color     */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0');
-/* modelname */ ATTRIB(MachineGun, mdl, string, "uzi");
-#ifdef GAMEQC
-/* model     */ ATTRIB(MachineGun, m_model, Model, MDL_MACHINEGUN_ITEM);
-#endif
-/* crosshair */ ATTRIB(MachineGun, w_crosshair, string, "gfx/crosshairuzi");
-/* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6);
-/* wepimg    */ ATTRIB(MachineGun, model2, string, "weaponuzi");
-/* refname   */ ATTRIB(MachineGun, netname, string, "machinegun");
-/* wepname   */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, burst, float, NONE) \
-               P(class, prefix, burst_ammo, float, NONE) \
-               P(class, prefix, burst_animtime, float, NONE) \
-               P(class, prefix, burst_refire2, float, NONE) \
-               P(class, prefix, burst_refire, float, NONE) \
-               P(class, prefix, burst_speed, float, NONE) \
-               P(class, prefix, first, float, NONE) \
-               P(class, prefix, first_ammo, float, NONE) \
-               P(class, prefix, first_damage, float, NONE) \
-               P(class, prefix, first_force, float, NONE) \
-               P(class, prefix, first_refire, float, NONE) \
-               P(class, prefix, first_spread, float, NONE) \
-               P(class, prefix, mode, float, NONE) \
-               P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, solidpenetration, float, NONE) \
-               P(class, prefix, spread_add, float, NONE) \
-               P(class, prefix, spread_max, float, NONE) \
-               P(class, prefix, spread_min, float, NONE) \
-               P(class, prefix, sustained_ammo, float, NONE) \
-               P(class, prefix, sustained_damage, float, NONE) \
-               P(class, prefix, sustained_force, float, NONE) \
-               P(class, prefix, sustained_refire, float, NONE) \
-               P(class, prefix, sustained_spread, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string,NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, MachineGun, machinegun)
-#undef X
-
-ENDCLASS(MachineGun)
-REGISTER_WEAPON(MACHINEGUN, machinegun, NEW(MachineGun));
-
 
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 
 spawnfunc(weapon_machinegun)
@@ -375,4 +317,3 @@ METHOD(MachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..5cd912a2aef278f800a2c86cc2b578ef36037ef6 100644 (file)
@@ -1 +1,56 @@
 #pragma once
+
+CLASS(MachineGun, Weapon)
+/* ammotype  */ ATTRIB(MachineGun, ammo_field, .int, ammo_nails);
+/* impulse   */ ATTRIB(MachineGun, impulse, int, 3);
+/* flags     */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
+/* rating    */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000);
+/* color     */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0');
+/* modelname */ ATTRIB(MachineGun, mdl, string, "uzi");
+#ifdef GAMEQC
+/* model     */ ATTRIB(MachineGun, m_model, Model, MDL_MACHINEGUN_ITEM);
+#endif
+/* crosshair */ ATTRIB(MachineGun, w_crosshair, string, "gfx/crosshairuzi");
+/* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6);
+/* wepimg    */ ATTRIB(MachineGun, model2, string, "weaponuzi");
+/* refname   */ ATTRIB(MachineGun, netname, string, "machinegun");
+/* wepname   */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, burst, float, NONE) \
+               P(class, prefix, burst_ammo, float, NONE) \
+               P(class, prefix, burst_animtime, float, NONE) \
+               P(class, prefix, burst_refire2, float, NONE) \
+               P(class, prefix, burst_refire, float, NONE) \
+               P(class, prefix, burst_speed, float, NONE) \
+               P(class, prefix, first, float, NONE) \
+               P(class, prefix, first_ammo, float, NONE) \
+               P(class, prefix, first_damage, float, NONE) \
+               P(class, prefix, first_force, float, NONE) \
+               P(class, prefix, first_refire, float, NONE) \
+               P(class, prefix, first_spread, float, NONE) \
+               P(class, prefix, mode, float, NONE) \
+               P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, solidpenetration, float, NONE) \
+               P(class, prefix, spread_add, float, NONE) \
+               P(class, prefix, spread_max, float, NONE) \
+               P(class, prefix, spread_min, float, NONE) \
+               P(class, prefix, sustained_ammo, float, NONE) \
+               P(class, prefix, sustained_damage, float, NONE) \
+               P(class, prefix, sustained_force, float, NONE) \
+               P(class, prefix, sustained_refire, float, NONE) \
+               P(class, prefix, sustained_spread, float, NONE) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string,NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, MachineGun, machinegun)
+#undef X
+
+ENDCLASS(MachineGun)
+REGISTER_WEAPON(MACHINEGUN, machinegun, NEW(MachineGun));
index 73b29a48de6a97a252843512bd7c480abad539f4..463f5109b918187ed45bfe6b41e66f1eb440af76 100644 (file)
@@ -1,66 +1,5 @@
 #include "minelayer.qh"
-#ifndef IMPLEMENTATION
-CLASS(MineLayer, Weapon)
-/* ammotype  */ ATTRIB(MineLayer, ammo_field, .int, ammo_rockets);
-/* impulse   */ ATTRIB(MineLayer, impulse, int, 4);
-/* flags     */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(MineLayer, bot_pickupbasevalue, float, 7000);
-/* color     */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0');
-/* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer");
-#ifdef GAMEQC
-/* model     */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM);
-#endif
-/* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer");
-/* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
-/* wepimg    */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
-/* refname   */ ATTRIB(MineLayer, netname, string, "minelayer");
-/* wepname   */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, NONE) \
-               P(class, prefix, animtime, float, NONE) \
-               P(class, prefix, damageforcescale, float, NONE) \
-               P(class, prefix, damage, float, NONE) \
-               P(class, prefix, detonatedelay, float, NONE) \
-               P(class, prefix, edgedamage, float, NONE) \
-               P(class, prefix, force, float, NONE) \
-               P(class, prefix, health, float, NONE) \
-               P(class, prefix, lifetime, float, NONE) \
-               P(class, prefix, lifetime_countdown, float, NONE) \
-               P(class, prefix, limit, float, NONE) \
-               P(class, prefix, protection, float, NONE) \
-               P(class, prefix, proximityradius, float, NONE) \
-               P(class, prefix, radius, float, NONE) \
-               P(class, prefix, refire, float, NONE) \
-               P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, remote_damage, float, NONE) \
-               P(class, prefix, remote_edgedamage, float, NONE) \
-               P(class, prefix, remote_force, float, NONE) \
-               P(class, prefix, remote_radius, float, NONE) \
-               P(class, prefix, speed, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, time, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, MineLayer, minelayer)
-#undef X
-ENDCLASS(MineLayer)
-REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
 
-#ifdef SVQC
-void W_MineLayer_Think(entity this);
-.float minelayer_detonate, mine_explodeanyway;
-.float mine_time;
-.vector mine_orientation;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_minelayer) { weapon_defaultspawnfunc(this, WEP_MINE_LAYER); }
 
@@ -587,4 +526,3 @@ METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..e867db8d31634764f5f459f8df028f346535b478 100644 (file)
@@ -1 +1,61 @@
 #pragma once
+
+CLASS(MineLayer, Weapon)
+/* ammotype  */ ATTRIB(MineLayer, ammo_field, .int, ammo_rockets);
+/* impulse   */ ATTRIB(MineLayer, impulse, int, 4);
+/* flags     */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(MineLayer, bot_pickupbasevalue, float, 7000);
+/* color     */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0');
+/* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer");
+#ifdef GAMEQC
+/* model     */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM);
+#endif
+/* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer");
+/* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
+/* wepimg    */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
+/* refname   */ ATTRIB(MineLayer, netname, string, "minelayer");
+/* wepname   */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, NONE) \
+               P(class, prefix, animtime, float, NONE) \
+               P(class, prefix, damageforcescale, float, NONE) \
+               P(class, prefix, damage, float, NONE) \
+               P(class, prefix, detonatedelay, float, NONE) \
+               P(class, prefix, edgedamage, float, NONE) \
+               P(class, prefix, force, float, NONE) \
+               P(class, prefix, health, float, NONE) \
+               P(class, prefix, lifetime, float, NONE) \
+               P(class, prefix, lifetime_countdown, float, NONE) \
+               P(class, prefix, limit, float, NONE) \
+               P(class, prefix, protection, float, NONE) \
+               P(class, prefix, proximityradius, float, NONE) \
+               P(class, prefix, radius, float, NONE) \
+               P(class, prefix, refire, float, NONE) \
+               P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, remote_damage, float, NONE) \
+               P(class, prefix, remote_edgedamage, float, NONE) \
+               P(class, prefix, remote_force, float, NONE) \
+               P(class, prefix, remote_radius, float, NONE) \
+               P(class, prefix, speed, float, NONE) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, time, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, MineLayer, minelayer)
+#undef X
+ENDCLASS(MineLayer)
+REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
+
+#ifdef SVQC
+void W_MineLayer_Think(entity this);
+.float minelayer_detonate, mine_explodeanyway;
+.float mine_time;
+.vector mine_orientation;
+#endif
index f6b498a8bcd0fb690d18c0772552d9e9cb448d54..186d1f139d3f52de758e69e0bdd5360c5e4fc7e3 100644 (file)
@@ -1,65 +1,5 @@
 #include "mortar.qh"
-#ifndef IMPLEMENTATION
-CLASS(Mortar, Weapon)
-/* ammotype  */ ATTRIB(Mortar, ammo_field, .int, ammo_rockets);
-/* impulse   */ ATTRIB(Mortar, impulse, int, 4);
-/* flags     */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000);
-/* color     */ ATTRIB(Mortar, wpcolor, vector, '1 0 0');
-/* modelname */ ATTRIB(Mortar, mdl, string, "gl");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Mortar, m_model, Model, MDL_MORTAR_ITEM);
-#endif
-/* crosshair */ ATTRIB(Mortar, w_crosshair, string, "gfx/crosshairgrenadelauncher");
-/* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7);
-/* wepimg    */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
-/* refname   */ ATTRIB(Mortar, netname, string, "mortar");
-/* wepname   */ ATTRIB(Mortar, m_name, string, _("Mortar"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, bouncefactor, float, NONE) \
-               P(class, prefix, bouncestop, float, NONE) \
-               P(class, prefix, damageforcescale, float, BOTH) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, edgedamage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, health, float, BOTH) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, lifetime_bounce, float, SEC) \
-               P(class, prefix, lifetime_stick, float, BOTH) \
-               P(class, prefix, radius, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, reload_ammo, float, NONE) \
-               P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, remote_detonateprimary, float, SEC) \
-               P(class, prefix, remote_minbouncecnt, float, PRI) \
-               P(class, prefix, speed, float, BOTH) \
-               P(class, prefix, speed_up, float, BOTH) \
-               P(class, prefix, speed_z, float, BOTH) \
-               P(class, prefix, spread, float, BOTH) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, type, float, BOTH) \
-               P(class, prefix, weaponreplace, string, NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Mortar, mortar)
-#undef X
-ENDCLASS(Mortar)
-REGISTER_WEAPON(MORTAR, mortar, NEW(Mortar));
-
 
-#ifdef SVQC
-.float gl_detonate_later;
-.float gl_bouncecnt;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 
 spawnfunc(weapon_mortar) { weapon_defaultspawnfunc(this, WEP_MORTAR); }
@@ -427,4 +367,3 @@ METHOD(Mortar, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..58b526b8ec4eddf58e3804ceb4dd5277c9978688 100644 (file)
@@ -1 +1,60 @@
 #pragma once
+
+CLASS(Mortar, Weapon)
+/* ammotype  */ ATTRIB(Mortar, ammo_field, .int, ammo_rockets);
+/* impulse   */ ATTRIB(Mortar, impulse, int, 4);
+/* flags     */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000);
+/* color     */ ATTRIB(Mortar, wpcolor, vector, '1 0 0');
+/* modelname */ ATTRIB(Mortar, mdl, string, "gl");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Mortar, m_model, Model, MDL_MORTAR_ITEM);
+#endif
+/* crosshair */ ATTRIB(Mortar, w_crosshair, string, "gfx/crosshairgrenadelauncher");
+/* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7);
+/* wepimg    */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
+/* refname   */ ATTRIB(Mortar, netname, string, "mortar");
+/* wepname   */ ATTRIB(Mortar, m_name, string, _("Mortar"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, bouncefactor, float, NONE) \
+               P(class, prefix, bouncestop, float, NONE) \
+               P(class, prefix, damageforcescale, float, BOTH) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, edgedamage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, health, float, BOTH) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, lifetime_bounce, float, SEC) \
+               P(class, prefix, lifetime_stick, float, BOTH) \
+               P(class, prefix, radius, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, remote_detonateprimary, float, SEC) \
+               P(class, prefix, remote_minbouncecnt, float, PRI) \
+               P(class, prefix, speed, float, BOTH) \
+               P(class, prefix, speed_up, float, BOTH) \
+               P(class, prefix, speed_z, float, BOTH) \
+               P(class, prefix, spread, float, BOTH) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, type, float, BOTH) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Mortar, mortar)
+#undef X
+ENDCLASS(Mortar)
+REGISTER_WEAPON(MORTAR, mortar, NEW(Mortar));
+
+
+#ifdef SVQC
+.float gl_detonate_later;
+.float gl_bouncecnt;
+#endif
index f5a19b2c776e98f78748d9e6d2748273929a0215..b4dab73cc951c2d8e93ba90c3024da215b799e00 100644 (file)
@@ -1,49 +1,5 @@
 #include "porto.qh"
-#ifndef IMPLEMENTATION
-CLASS(PortoLaunch, Weapon)
-/* ammotype  */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none);
-/* impulse   */ ATTRIB(PortoLaunch, impulse, int, 0);
-/* flags     */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0);
-/* color     */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5');
-/* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto");
-#ifdef GAMEQC
-/* model     */ ATTRIB(PortoLaunch, m_model, Model, MDL_PORTO_ITEM);
-#endif
-/* crosshair */ ATTRIB(PortoLaunch, w_crosshair, string, "gfx/crosshairporto");
-/* crosshair */ ATTRIB(PortoLaunch, w_crosshair_size, float, 0.6);
-/* wepimg    */ ATTRIB(PortoLaunch, model2, string, "weaponporto");
-/* refname   */ ATTRIB(PortoLaunch, netname, string, "porto");
-/* wepname   */ ATTRIB(PortoLaunch, m_name, string, _("Port-O-Launch"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, lifetime, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, speed, float, BOTH) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string,NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, PortoLaunch, porto)
-#undef X
-ENDCLASS(PortoLaunch)
-REGISTER_WEAPON(PORTO, porto, NEW(PortoLaunch));
 
-#ifdef SVQC
-.entity porto_current;
-.vector porto_v_angle; // holds "held" view angles
-.float porto_v_angle_held;
-.vector right_vector;
-.float porto_forbidden;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 #include <common/triggers/trigger/jumppads.qh>
 
@@ -377,4 +333,3 @@ METHOD(PortoLaunch, wr_impacteffect, void(entity this, entity actor)) {
     LOG_WARN("Since when does Porto send DamageInfo?");
 }
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..94c6e165c587f0f095740339c3e8e30d90e23bfe 100644 (file)
@@ -1 +1,44 @@
 #pragma once
+
+CLASS(PortoLaunch, Weapon)
+/* ammotype  */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none);
+/* impulse   */ ATTRIB(PortoLaunch, impulse, int, 0);
+/* flags     */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0);
+/* color     */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5');
+/* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto");
+#ifdef GAMEQC
+/* model     */ ATTRIB(PortoLaunch, m_model, Model, MDL_PORTO_ITEM);
+#endif
+/* crosshair */ ATTRIB(PortoLaunch, w_crosshair, string, "gfx/crosshairporto");
+/* crosshair */ ATTRIB(PortoLaunch, w_crosshair_size, float, 0.6);
+/* wepimg    */ ATTRIB(PortoLaunch, model2, string, "weaponporto");
+/* refname   */ ATTRIB(PortoLaunch, netname, string, "porto");
+/* wepname   */ ATTRIB(PortoLaunch, m_name, string, _("Port-O-Launch"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, secondary, float, NONE) \
+               P(class, prefix, speed, float, BOTH) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string,NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, PortoLaunch, porto)
+#undef X
+ENDCLASS(PortoLaunch)
+REGISTER_WEAPON(PORTO, porto, NEW(PortoLaunch));
+
+#ifdef SVQC
+.entity porto_current;
+.vector porto_v_angle; // holds "held" view angles
+.float porto_v_angle_held;
+.vector right_vector;
+.float porto_forbidden;
+#endif
index 771f384361c7b6fbdbff0860452c0d48fb9ee9e9..92694e2e2248570b9bcc8ebd878bd8569c23aa83 100644 (file)
@@ -1,58 +1,5 @@
 #include "rifle.qh"
-#ifndef IMPLEMENTATION
-CLASS(Rifle, Weapon)
-/* ammotype  */ ATTRIB(Rifle, ammo_field, .int, ammo_nails);
-/* impulse   */ ATTRIB(Rifle, impulse, int, 7);
-/* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN);
-/* rating    */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
-/* color     */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
-/* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
-#endif
-/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
-/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
-/* reticle   */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
-/* wepimg    */ ATTRIB(Rifle, model2, string, "weaponrifle");
-/* refname   */ ATTRIB(Rifle, netname, string, "rifle");
-/* wepname   */ ATTRIB(Rifle, m_name, string, _("Rifle"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, bullethail, float, BOTH) \
-               P(class, prefix, burstcost, float, BOTH) \
-               P(class, prefix, bursttime, float, NONE) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, reload, float, SEC) \
-               P(class, prefix, reload_ammo, float, NONE) \
-       P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, shots, float, BOTH) \
-               P(class, prefix, solidpenetration, float, BOTH) \
-               P(class, prefix, spread, float, BOTH) \
-       P(class, prefix, switchdelay_drop, float, NONE) \
-       P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, tracer, float, BOTH) \
-       P(class, prefix, weaponreplace, string, NONE) \
-       P(class, prefix, weaponstartoverride, float, NONE) \
-       P(class, prefix, weaponstart, float, NONE) \
-       P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Rifle, rifle)
-#undef X
-ENDCLASS(Rifle)
-REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
-
 
-#ifdef SVQC
-.float rifle_accumulator;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_rifle) { weapon_defaultspawnfunc(this, WEP_RIFLE); }
 spawnfunc(weapon_campingrifle) { spawnfunc_weapon_rifle(this); }
@@ -281,4 +228,3 @@ METHOD(Rifle, wr_zoom, bool(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..ed5496f050f28cb841949a0937ebd4a279c589d6 100644 (file)
@@ -1 +1,53 @@
 #pragma once
+
+CLASS(Rifle, Weapon)
+/* ammotype  */ ATTRIB(Rifle, ammo_field, .int, ammo_nails);
+/* impulse   */ ATTRIB(Rifle, impulse, int, 7);
+/* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
+/* rating    */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
+/* color     */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
+/* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
+#endif
+/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
+/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
+/* reticle   */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
+/* wepimg    */ ATTRIB(Rifle, model2, string, "weaponrifle");
+/* refname   */ ATTRIB(Rifle, netname, string, "rifle");
+/* wepname   */ ATTRIB(Rifle, m_name, string, _("Rifle"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, bullethail, float, BOTH) \
+               P(class, prefix, burstcost, float, BOTH) \
+               P(class, prefix, bursttime, float, NONE) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, reload, float, SEC) \
+               P(class, prefix, reload_ammo, float, NONE) \
+       P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, secondary, float, NONE) \
+               P(class, prefix, shots, float, BOTH) \
+               P(class, prefix, solidpenetration, float, BOTH) \
+               P(class, prefix, spread, float, BOTH) \
+       P(class, prefix, switchdelay_drop, float, NONE) \
+       P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, tracer, float, BOTH) \
+       P(class, prefix, weaponreplace, string, NONE) \
+       P(class, prefix, weaponstartoverride, float, NONE) \
+       P(class, prefix, weaponstart, float, NONE) \
+       P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Rifle, rifle)
+#undef X
+ENDCLASS(Rifle)
+REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
+
+
+#ifdef SVQC
+.float rifle_accumulator;
+#endif
index 4b5ccab4a55a5f371c8475ecf032c7321c834cab..35b48b8ea03159e9a40b448bda4be2103e794a2c 100644 (file)
@@ -1,94 +1,5 @@
 #include "seeker.qh"
-#ifndef IMPLEMENTATION
-CLASS(Seeker, Weapon)
-/* ammotype  */ ATTRIB(Seeker, ammo_field, .int, ammo_rockets);
-/* impulse   */ ATTRIB(Seeker, impulse, int, 8);
-/* flags     */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Seeker, bot_pickupbasevalue, float, 5000);
-/* color     */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0');
-/* modelname */ ATTRIB(Seeker, mdl, string, "seeker");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM);
-#endif
-/* crosshair */ ATTRIB(Seeker, w_crosshair, string, "gfx/crosshairseeker");
-/* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8);
-/* wepimg    */ ATTRIB(Seeker, model2, string, "weaponseeker");
-/* refname   */ ATTRIB(Seeker, netname, string, "seeker");
-/* wepname   */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-       P(class, prefix, flac_ammo, float, NONE) \
-       P(class, prefix, flac_animtime, float, NONE) \
-       P(class, prefix, flac_damage, float, NONE) \
-       P(class, prefix, flac_edgedamage, float, NONE) \
-       P(class, prefix, flac_force, float, NONE) \
-       P(class, prefix, flac_lifetime, float, NONE) \
-       P(class, prefix, flac_lifetime_rand, float, NONE) \
-       P(class, prefix, flac_radius, float, NONE) \
-       P(class, prefix, flac_refire, float, NONE) \
-       P(class, prefix, flac_speed, float, NONE) \
-       P(class, prefix, flac_speed_up, float, NONE) \
-       P(class, prefix, flac_speed_z, float, NONE) \
-       P(class, prefix, flac_spread, float, NONE) \
-       P(class, prefix, missile_accel, float, NONE) \
-       P(class, prefix, missile_ammo, float, NONE) \
-       P(class, prefix, missile_animtime, float, NONE) \
-       P(class, prefix, missile_count, float, NONE) \
-       P(class, prefix, missile_damageforcescale, float, NONE) \
-       P(class, prefix, missile_damage, float, NONE) \
-       P(class, prefix, missile_decel, float, NONE) \
-       P(class, prefix, missile_delay, float, NONE) \
-       P(class, prefix, missile_edgedamage, float, NONE) \
-       P(class, prefix, missile_force, float, NONE) \
-       P(class, prefix, missile_health, float, NONE) \
-       P(class, prefix, missile_lifetime, float, NONE) \
-       P(class, prefix, missile_proxy, float, NONE) \
-       P(class, prefix, missile_proxy_delay, float, NONE) \
-       P(class, prefix, missile_proxy_maxrange, float, NONE) \
-       P(class, prefix, missile_radius, float, NONE) \
-       P(class, prefix, missile_refire, float, NONE) \
-       P(class, prefix, missile_smart, float, NONE) \
-       P(class, prefix, missile_smart_mindist, float, NONE) \
-       P(class, prefix, missile_smart_trace_max, float, NONE) \
-       P(class, prefix, missile_smart_trace_min, float, NONE) \
-       P(class, prefix, missile_speed, float, NONE) \
-       P(class, prefix, missile_speed_max, float, NONE) \
-       P(class, prefix, missile_speed_up, float, NONE) \
-       P(class, prefix, missile_speed_z, float, NONE) \
-       P(class, prefix, missile_spread, float, NONE) \
-       P(class, prefix, missile_turnrate, float, NONE) \
-       P(class, prefix, reload_ammo, float, NONE) \
-               P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-       P(class, prefix, tag_ammo, float, NONE) \
-       P(class, prefix, tag_animtime, float, NONE) \
-       P(class, prefix, tag_damageforcescale, float, NONE) \
-       P(class, prefix, tag_health, float, NONE) \
-       P(class, prefix, tag_lifetime, float, NONE) \
-       P(class, prefix, tag_refire, float, NONE) \
-       P(class, prefix, tag_speed, float, NONE) \
-       P(class, prefix, tag_spread, float, NONE) \
-       P(class, prefix, tag_tracker_lifetime, float, NONE) \
-               P(class, prefix, type, float, NONE) \
-               P(class, prefix, weaponreplace, string, NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-       W_PROPS(X, Seeker, seeker)
-#undef X
-ENDCLASS(Seeker)
-REGISTER_WEAPON(SEEKER, seeker, NEW(Seeker));
-
 
-#ifdef SVQC
-.entity tag_target, wps_tag_tracker;
-.float tag_time;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_seeker) { weapon_defaultspawnfunc(this, WEP_SEEKER); }
 
@@ -763,4 +674,3 @@ METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 5a1a73f824d5c60b2902f503bdef9dd30fb4740d..04567d1b9a583083e5cfa3dec19a804eaef7adcb 100644 (file)
@@ -1,6 +1,91 @@
 #pragma once
 
+CLASS(Seeker, Weapon)
+/* ammotype  */ ATTRIB(Seeker, ammo_field, .int, ammo_rockets);
+/* impulse   */ ATTRIB(Seeker, impulse, int, 8);
+/* flags     */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
+/* rating    */ ATTRIB(Seeker, bot_pickupbasevalue, float, 5000);
+/* color     */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0');
+/* modelname */ ATTRIB(Seeker, mdl, string, "seeker");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM);
+#endif
+/* crosshair */ ATTRIB(Seeker, w_crosshair, string, "gfx/crosshairseeker");
+/* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8);
+/* wepimg    */ ATTRIB(Seeker, model2, string, "weaponseeker");
+/* refname   */ ATTRIB(Seeker, netname, string, "seeker");
+/* wepname   */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+       P(class, prefix, flac_ammo, float, NONE) \
+       P(class, prefix, flac_animtime, float, NONE) \
+       P(class, prefix, flac_damage, float, NONE) \
+       P(class, prefix, flac_edgedamage, float, NONE) \
+       P(class, prefix, flac_force, float, NONE) \
+       P(class, prefix, flac_lifetime, float, NONE) \
+       P(class, prefix, flac_lifetime_rand, float, NONE) \
+       P(class, prefix, flac_radius, float, NONE) \
+       P(class, prefix, flac_refire, float, NONE) \
+       P(class, prefix, flac_speed, float, NONE) \
+       P(class, prefix, flac_speed_up, float, NONE) \
+       P(class, prefix, flac_speed_z, float, NONE) \
+       P(class, prefix, flac_spread, float, NONE) \
+       P(class, prefix, missile_accel, float, NONE) \
+       P(class, prefix, missile_ammo, float, NONE) \
+       P(class, prefix, missile_animtime, float, NONE) \
+       P(class, prefix, missile_count, float, NONE) \
+       P(class, prefix, missile_damageforcescale, float, NONE) \
+       P(class, prefix, missile_damage, float, NONE) \
+       P(class, prefix, missile_decel, float, NONE) \
+       P(class, prefix, missile_delay, float, NONE) \
+       P(class, prefix, missile_edgedamage, float, NONE) \
+       P(class, prefix, missile_force, float, NONE) \
+       P(class, prefix, missile_health, float, NONE) \
+       P(class, prefix, missile_lifetime, float, NONE) \
+       P(class, prefix, missile_proxy, float, NONE) \
+       P(class, prefix, missile_proxy_delay, float, NONE) \
+       P(class, prefix, missile_proxy_maxrange, float, NONE) \
+       P(class, prefix, missile_radius, float, NONE) \
+       P(class, prefix, missile_refire, float, NONE) \
+       P(class, prefix, missile_smart, float, NONE) \
+       P(class, prefix, missile_smart_mindist, float, NONE) \
+       P(class, prefix, missile_smart_trace_max, float, NONE) \
+       P(class, prefix, missile_smart_trace_min, float, NONE) \
+       P(class, prefix, missile_speed, float, NONE) \
+       P(class, prefix, missile_speed_max, float, NONE) \
+       P(class, prefix, missile_speed_up, float, NONE) \
+       P(class, prefix, missile_speed_z, float, NONE) \
+       P(class, prefix, missile_spread, float, NONE) \
+       P(class, prefix, missile_turnrate, float, NONE) \
+       P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+       P(class, prefix, tag_ammo, float, NONE) \
+       P(class, prefix, tag_animtime, float, NONE) \
+       P(class, prefix, tag_damageforcescale, float, NONE) \
+       P(class, prefix, tag_health, float, NONE) \
+       P(class, prefix, tag_lifetime, float, NONE) \
+       P(class, prefix, tag_refire, float, NONE) \
+       P(class, prefix, tag_speed, float, NONE) \
+       P(class, prefix, tag_spread, float, NONE) \
+       P(class, prefix, tag_tracker_lifetime, float, NONE) \
+               P(class, prefix, type, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+       W_PROPS(X, Seeker, seeker)
+#undef X
+ENDCLASS(Seeker)
+REGISTER_WEAPON(SEEKER, seeker, NEW(Seeker));
+
 #ifdef SVQC
+.entity tag_target, wps_tag_tracker;
+.float tag_time;
+
 IntrusiveList g_seeker_trackers;
 STATIC_INIT(g_seeker_trackers) { g_seeker_trackers = IL_NEW(); }
 #endif
index 1fa0adc4dd58835002456f35ad0d0eded72d6072..bc9e94767a45177e35b3dd788f283f3beeeb7c00 100644 (file)
@@ -1,91 +1,4 @@
 #include "shockwave.qh"
-#ifndef IMPLEMENTATION
-CLASS(Shockwave, Weapon)
-/* ammotype  */ //ATTRIB(Shockwave, ammo_field, .int, ammo_none);
-/* impulse   */ ATTRIB(Shockwave, impulse, int, 2);
-/* flags     */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
-/* rating    */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000);
-/* color     */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0');
-/* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Shockwave, m_model, Model, MDL_SHOCKWAVE_ITEM);
-#endif
-/* crosshair */ ATTRIB(Shockwave, w_crosshair, string, "gfx/crosshairshotgun");
-/* crosshair */ ATTRIB(Shockwave, w_crosshair_size, float, 0.7);
-/* wepimg    */ ATTRIB(Shockwave, model2, string, "weaponshockwave");
-/* refname   */ ATTRIB(Shockwave, netname, string, "shockwave");
-/* wepname   */ ATTRIB(Shockwave, m_name, string, _("Shockwave"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, blast_animtime, float, NONE) \
-               P(class, prefix, blast_damage, float, NONE) \
-               P(class, prefix, blast_distance, float, NONE) \
-               P(class, prefix, blast_edgedamage, float, NONE) \
-               P(class, prefix, blast_force, float, NONE) \
-               P(class, prefix, blast_force_forwardbias, float, NONE) \
-               P(class, prefix, blast_force_zscale, float, NONE) \
-               P(class, prefix, blast_jump_damage, float, NONE) \
-               P(class, prefix, blast_jump_edgedamage, float, NONE) \
-               P(class, prefix, blast_jump_force, float, NONE) \
-               P(class, prefix, blast_jump_force_velocitybias, float, NONE) \
-               P(class, prefix, blast_jump_force_zscale, float, NONE) \
-               P(class, prefix, blast_jump_multiplier_accuracy, float, NONE) \
-               P(class, prefix, blast_jump_multiplier_distance, float, NONE) \
-               P(class, prefix, blast_jump_multiplier_min, float, NONE) \
-               P(class, prefix, blast_jump_radius, float, NONE) \
-               P(class, prefix, blast_multiplier_accuracy, float, NONE) \
-               P(class, prefix, blast_multiplier_distance, float, NONE) \
-               P(class, prefix, blast_multiplier_min, float, NONE) \
-               P(class, prefix, blast_refire, float, NONE) \
-               P(class, prefix, blast_splash_damage, float, NONE) \
-               P(class, prefix, blast_splash_edgedamage, float, NONE) \
-               P(class, prefix, blast_splash_force, float, NONE) \
-               P(class, prefix, blast_splash_force_forwardbias, float, NONE) \
-               P(class, prefix, blast_splash_multiplier_accuracy, float, NONE) \
-               P(class, prefix, blast_splash_multiplier_distance, float, NONE) \
-               P(class, prefix, blast_splash_multiplier_min, float, NONE) \
-               P(class, prefix, blast_splash_radius, float, NONE) \
-               P(class, prefix, blast_spread_max, float, NONE) \
-               P(class, prefix, blast_spread_min, float, NONE) \
-               P(class, prefix, melee_animtime, float, NONE) \
-               P(class, prefix, melee_damage, float, NONE) \
-               P(class, prefix, melee_delay, float, NONE) \
-               P(class, prefix, melee_force, float, NONE) \
-               P(class, prefix, melee_multihit, float, NONE) \
-               P(class, prefix, melee_no_doubleslap, float, NONE) \
-               P(class, prefix, melee_nonplayerdamage, float, NONE) \
-               P(class, prefix, melee_range, float, NONE) \
-               P(class, prefix, melee_refire, float, NONE) \
-               P(class, prefix, melee_swing_side, float, NONE) \
-               P(class, prefix, melee_swing_up, float, NONE) \
-               P(class, prefix, melee_time, float, NONE) \
-               P(class, prefix, melee_traces, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Shockwave, shockwave)
-#undef X
-
-ENDCLASS(Shockwave)
-REGISTER_WEAPON(SHOCKWAVE, shockwave, NEW(Shockwave));
-
-
-#ifdef CSQC
-void Net_ReadShockwaveParticle();
-.vector sw_shotorg;
-.vector sw_shotdir;
-.float sw_distance;
-.float sw_spread_max;
-.float sw_spread_min;
-.float sw_time;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 
 REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
 
@@ -197,14 +110,14 @@ void W_Shockwave_Melee_Think(entity this)
                                { accuracy_add(this.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
 
                        #ifdef DEBUG_SHOCKWAVE
-                       LOG_INFO(sprintf(
-                               "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
+                       LOG_INFOF(
+                               "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.",
                                this.realowner.netname,
                                target_victim.netname,
                                swing_damage,
                                swing_factor,
                                time
-                       ));
+                       );
                        #endif
 
                        // allow multiple hits with one swing, but not against the same player twice
@@ -484,15 +397,15 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                );
 
                                #ifdef DEBUG_SHOCKWAVE
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "SELF HIT: multiplier = %f, damage = %f, force = %f... "
-                                       "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+                                       "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
                                        multiplier,
                                        final_damage,
                                        vlen(final_force),
                                        multiplier_from_accuracy,
                                        multiplier_from_distance
-                               ));
+                               );
                                #endif
                        }
                        else if(distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
@@ -547,15 +460,15 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
 
                                #ifdef DEBUG_SHOCKWAVE
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
-                                       "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+                                       "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
                                        multiplier,
                                        final_damage,
                                        vlen(final_force),
                                        multiplier_from_accuracy,
                                        multiplier_from_distance
-                               ));
+                               );
                                #endif
                        }
                }
@@ -636,15 +549,15 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                                if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
 
                                #ifdef DEBUG_SHOCKWAVE
-                               LOG_INFO(sprintf(
+                               LOG_INFOF(
                                        "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
-                                       "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+                                       "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
                                        multiplier,
                                        final_damage,
                                        vlen(final_force),
                                        multiplier_from_accuracy,
                                        multiplier_from_distance
-                               ));
+                               );
                                #endif
                        }
                }
@@ -671,12 +584,12 @@ void W_Shockwave_Attack(entity actor, .entity weaponentity)
                        accuracy_add(actor, WEP_SHOCKWAVE.m_id, 0, final_damage);
 
                #ifdef DEBUG_SHOCKWAVE
-               LOG_INFO(sprintf(
-                       "SHOCKWAVE by %s: damage = %f, force = %f.\n",
+               LOG_INFOF(
+                       "SHOCKWAVE by %s: damage = %f, force = %f.",
                        actor.netname,
                        final_damage,
                        vlen(final_force)
-               ));
+               );
                #endif
 
                shockwave_hit[i-1] = NULL;
@@ -884,4 +797,3 @@ METHOD(Shockwave, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..f863094c00f54582d8cf7a088adb04f33c5e27a3 100644 (file)
@@ -1 +1,86 @@
 #pragma once
+
+CLASS(Shockwave, Weapon)
+/* ammotype  */ //ATTRIB(Shockwave, ammo_field, .int, ammo_none);
+/* impulse   */ ATTRIB(Shockwave, impulse, int, 2);
+/* flags     */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
+/* rating    */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000);
+/* color     */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0');
+/* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Shockwave, m_model, Model, MDL_SHOCKWAVE_ITEM);
+#endif
+/* crosshair */ ATTRIB(Shockwave, w_crosshair, string, "gfx/crosshairshotgun");
+/* crosshair */ ATTRIB(Shockwave, w_crosshair_size, float, 0.7);
+/* wepimg    */ ATTRIB(Shockwave, model2, string, "weaponshockwave");
+/* refname   */ ATTRIB(Shockwave, netname, string, "shockwave");
+/* wepname   */ ATTRIB(Shockwave, m_name, string, _("Shockwave"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, blast_animtime, float, NONE) \
+               P(class, prefix, blast_damage, float, NONE) \
+               P(class, prefix, blast_distance, float, NONE) \
+               P(class, prefix, blast_edgedamage, float, NONE) \
+               P(class, prefix, blast_force, float, NONE) \
+               P(class, prefix, blast_force_forwardbias, float, NONE) \
+               P(class, prefix, blast_force_zscale, float, NONE) \
+               P(class, prefix, blast_jump_damage, float, NONE) \
+               P(class, prefix, blast_jump_edgedamage, float, NONE) \
+               P(class, prefix, blast_jump_force, float, NONE) \
+               P(class, prefix, blast_jump_force_velocitybias, float, NONE) \
+               P(class, prefix, blast_jump_force_zscale, float, NONE) \
+               P(class, prefix, blast_jump_multiplier_accuracy, float, NONE) \
+               P(class, prefix, blast_jump_multiplier_distance, float, NONE) \
+               P(class, prefix, blast_jump_multiplier_min, float, NONE) \
+               P(class, prefix, blast_jump_radius, float, NONE) \
+               P(class, prefix, blast_multiplier_accuracy, float, NONE) \
+               P(class, prefix, blast_multiplier_distance, float, NONE) \
+               P(class, prefix, blast_multiplier_min, float, NONE) \
+               P(class, prefix, blast_refire, float, NONE) \
+               P(class, prefix, blast_splash_damage, float, NONE) \
+               P(class, prefix, blast_splash_edgedamage, float, NONE) \
+               P(class, prefix, blast_splash_force, float, NONE) \
+               P(class, prefix, blast_splash_force_forwardbias, float, NONE) \
+               P(class, prefix, blast_splash_multiplier_accuracy, float, NONE) \
+               P(class, prefix, blast_splash_multiplier_distance, float, NONE) \
+               P(class, prefix, blast_splash_multiplier_min, float, NONE) \
+               P(class, prefix, blast_splash_radius, float, NONE) \
+               P(class, prefix, blast_spread_max, float, NONE) \
+               P(class, prefix, blast_spread_min, float, NONE) \
+               P(class, prefix, melee_animtime, float, NONE) \
+               P(class, prefix, melee_damage, float, NONE) \
+               P(class, prefix, melee_delay, float, NONE) \
+               P(class, prefix, melee_force, float, NONE) \
+               P(class, prefix, melee_multihit, float, NONE) \
+               P(class, prefix, melee_no_doubleslap, float, NONE) \
+               P(class, prefix, melee_nonplayerdamage, float, NONE) \
+               P(class, prefix, melee_range, float, NONE) \
+               P(class, prefix, melee_refire, float, NONE) \
+               P(class, prefix, melee_swing_side, float, NONE) \
+               P(class, prefix, melee_swing_up, float, NONE) \
+               P(class, prefix, melee_time, float, NONE) \
+               P(class, prefix, melee_traces, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Shockwave, shockwave)
+#undef X
+
+ENDCLASS(Shockwave)
+REGISTER_WEAPON(SHOCKWAVE, shockwave, NEW(Shockwave));
+
+
+#ifdef CSQC
+void Net_ReadShockwaveParticle();
+.vector sw_shotorg;
+.vector sw_shotdir;
+.float sw_distance;
+.float sw_spread_max;
+.float sw_spread_min;
+.float sw_time;
+#endif
index 87a24d13a3a96a2d3985073f911f70212d13c956..3644c1357e3fa2517d7a6de28832c14f2de0c394 100644 (file)
@@ -1,61 +1,5 @@
 #include "shotgun.qh"
-#ifndef IMPLEMENTATION
-CLASS(Shotgun, Weapon)
-/* ammotype  */ ATTRIB(Shotgun, ammo_field, .int, ammo_shells);
-/* impulse   */ ATTRIB(Shotgun, impulse, int, 2);
-/* flags     */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC);
-/* rating    */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000);
-/* color     */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0');
-/* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Shotgun, m_model, Model, MDL_SHOTGUN_ITEM);
-#endif
-/* crosshair */ ATTRIB(Shotgun, w_crosshair, string, "gfx/crosshairshotgun");
-/* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65);
-/* wepimg    */ ATTRIB(Shotgun, model2, string, "weaponshotgun");
-/* refname   */ ATTRIB(Shotgun, netname, string, "shotgun");
-/* wepname   */ ATTRIB(Shotgun, m_name, string, _("Shotgun"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, alt_animtime, float, SEC) \
-               P(class, prefix, alt_refire, float, SEC) \
-               P(class, prefix, ammo, float, PRI) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, bullets, float, PRI) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, melee_delay, float, SEC) \
-               P(class, prefix, melee_multihit, float, SEC) \
-               P(class, prefix, melee_nonplayerdamage, float, SEC) \
-               P(class, prefix, melee_no_doubleslap, float, SEC) \
-               P(class, prefix, melee_range, float, SEC) \
-               P(class, prefix, melee_swing_side, float, SEC) \
-               P(class, prefix, melee_swing_up, float, SEC) \
-               P(class, prefix, melee_time, float, SEC) \
-               P(class, prefix, melee_traces, float, SEC) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, solidpenetration, float, PRI) \
-               P(class, prefix, spread, float, PRI) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, weaponreplace, string,NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Shotgun, shotgun)
-#undef X
-
-ENDCLASS(Shotgun)
-REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
-
 
-#endif
-#ifdef IMPLEMENTATION
 #ifdef SVQC
 spawnfunc(weapon_shotgun) { weapon_defaultspawnfunc(this, WEP_SHOTGUN); }
 
@@ -335,4 +279,3 @@ METHOD(Shotgun, wr_impacteffect, void(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..2fd734d554b2ddb6dc43aa11042e41abbd02ae20 100644 (file)
@@ -1 +1,54 @@
 #pragma once
+
+CLASS(Shotgun, Weapon)
+/* ammotype  */ ATTRIB(Shotgun, ammo_field, .int, ammo_shells);
+/* impulse   */ ATTRIB(Shotgun, impulse, int, 2);
+/* flags     */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC);
+/* rating    */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000);
+/* color     */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0');
+/* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Shotgun, m_model, Model, MDL_SHOTGUN_ITEM);
+#endif
+/* crosshair */ ATTRIB(Shotgun, w_crosshair, string, "gfx/crosshairshotgun");
+/* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65);
+/* wepimg    */ ATTRIB(Shotgun, model2, string, "weaponshotgun");
+/* refname   */ ATTRIB(Shotgun, netname, string, "shotgun");
+/* wepname   */ ATTRIB(Shotgun, m_name, string, _("Shotgun"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, alt_animtime, float, SEC) \
+               P(class, prefix, alt_refire, float, SEC) \
+               P(class, prefix, ammo, float, PRI) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, bullets, float, PRI) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, melee_delay, float, SEC) \
+               P(class, prefix, melee_multihit, float, SEC) \
+               P(class, prefix, melee_nonplayerdamage, float, SEC) \
+               P(class, prefix, melee_no_doubleslap, float, SEC) \
+               P(class, prefix, melee_range, float, SEC) \
+               P(class, prefix, melee_swing_side, float, SEC) \
+               P(class, prefix, melee_swing_up, float, SEC) \
+               P(class, prefix, melee_time, float, SEC) \
+               P(class, prefix, melee_traces, float, SEC) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, secondary, float, NONE) \
+               P(class, prefix, solidpenetration, float, PRI) \
+               P(class, prefix, spread, float, PRI) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, weaponreplace, string,NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Shotgun, shotgun)
+#undef X
+
+ENDCLASS(Shotgun)
+REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
index 0b43a24c15640c23b3b6e655b5c76b5c301db2bb..a5ae87c36b392256205cc47dd79aa879c628ae7a 100644 (file)
@@ -1,47 +1,4 @@
 #include "tuba.qh"
-#ifndef IMPLEMENTATION
-CLASS(Tuba, Weapon)
-/* impulse   */ ATTRIB(Tuba, impulse, int, 1);
-/* flags     */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
-/* color     */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
-/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM);
-#endif
-/* crosshair */ ATTRIB(Tuba, w_crosshair, string, "gfx/crosshairtuba");
-/* crosshair */ //ATTRIB(Tuba, w_crosshair_size, float, 0.65);
-/* wepimg    */ ATTRIB(Tuba, model2, string, "weapontuba");
-/* refname   */ ATTRIB(Tuba, netname, string, "tuba");
-/* xgettext:no-c-format */
-/* wepname   */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, animtime, float, NONE) \
-               P(class, prefix, attenuation, float, NONE) \
-               P(class, prefix, damage, float, NONE) \
-               P(class, prefix, edgedamage, float, NONE) \
-               P(class, prefix, fadetime, float, NONE) \
-               P(class, prefix, force, float, NONE) \
-               P(class, prefix, pitchstep, float, NONE) \
-               P(class, prefix, radius, float, NONE) \
-               P(class, prefix, refire, float, NONE) \
-               P(class, prefix, switchdelay_drop, float, NONE) \
-               P(class, prefix, switchdelay_raise, float, NONE) \
-               P(class, prefix, volume, float, NONE) \
-               P(class, prefix, weaponreplace, string, NONE) \
-               P(class, prefix, weaponstartoverride, float, NONE) \
-               P(class, prefix, weaponstart, float, NONE) \
-               P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Tuba, tuba)
-#undef X
-ENDCLASS(Tuba)
-REGISTER_WEAPON(TUBA, tuba, NEW(Tuba));
-#endif
-
-#ifdef IMPLEMENTATION
 
 #ifdef SVQC
 
@@ -634,4 +591,3 @@ PRECACHE(Tuba)
 }
 
 #endif
-#endif
index ce6b6ede739c76fd2dd2eed274912ffce10228a2..714a2b8b5853566a8175049433744f69dcdfc4c8 100644 (file)
@@ -1,5 +1,45 @@
 #pragma once
 
+CLASS(Tuba, Weapon)
+/* impulse   */ ATTRIB(Tuba, impulse, int, 1);
+/* flags     */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
+/* color     */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
+/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM);
+#endif
+/* crosshair */ ATTRIB(Tuba, w_crosshair, string, "gfx/crosshairtuba");
+/* crosshair */ //ATTRIB(Tuba, w_crosshair_size, float, 0.65);
+/* wepimg    */ ATTRIB(Tuba, model2, string, "weapontuba");
+/* refname   */ ATTRIB(Tuba, netname, string, "tuba");
+/* xgettext:no-c-format */
+/* wepname   */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, animtime, float, NONE) \
+               P(class, prefix, attenuation, float, NONE) \
+               P(class, prefix, damage, float, NONE) \
+               P(class, prefix, edgedamage, float, NONE) \
+               P(class, prefix, fadetime, float, NONE) \
+               P(class, prefix, force, float, NONE) \
+               P(class, prefix, pitchstep, float, NONE) \
+               P(class, prefix, radius, float, NONE) \
+               P(class, prefix, refire, float, NONE) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, volume, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Tuba, tuba)
+#undef X
+ENDCLASS(Tuba)
+REGISTER_WEAPON(TUBA, tuba, NEW(Tuba));
+
 #ifdef CSQC
 entityclass(Tuba);
 class(Tuba) .int note;
index 51ce8893d305c0bf262de7bfaedde8291fca12f5..e47f8fa909565a3734188c1f57d376cc1d1a5899 100644 (file)
@@ -1,67 +1,4 @@
 #include "vaporizer.qh"
-#ifndef IMPLEMENTATION
-CLASS(Vaporizer, Weapon)
-/* ammotype  */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells);
-/* impulse   */ ATTRIB(Vaporizer, impulse, int, 7);
-/* flags     */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000);
-/* color     */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1');
-/* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM);
-#endif
-/* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex");
-/* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6);
-/* reticle   */ ATTRIB(Vaporizer, w_reticle, string, "gfx/reticle_nex");
-/* wepimg    */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
-/* refname   */ ATTRIB(Vaporizer, netname, string, "vaporizer");
-/* wepname   */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, PRI) \
-       P(class, prefix, animtime, float, PRI) \
-       P(class, prefix, damage, float, PRI) \
-       P(class, prefix, refire, float, PRI) \
-       P(class, prefix, ammo, float, SEC) \
-       P(class, prefix, animtime, float, SEC) \
-       P(class, prefix, damage, float, SEC) \
-       P(class, prefix, delay, float, SEC) \
-       P(class, prefix, edgedamage, float, SEC) \
-       P(class, prefix, force, float, SEC) \
-       P(class, prefix, lifetime, float, SEC) \
-       P(class, prefix, radius, float, SEC) \
-       P(class, prefix, refire, float, SEC) \
-       P(class, prefix, shotangle, float, SEC) \
-       P(class, prefix, speed, float, SEC) \
-       P(class, prefix, spread, float, SEC) \
-       P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Vaporizer, vaporizer)
-#undef X
-
-ENDCLASS(Vaporizer)
-REGISTER_WEAPON(VAPORIZER, vaporizer, NEW(Vaporizer));
-
-
-#ifdef SVQC
-.float vaporizer_lasthit;
-.float jump_interval;
-.float jump_interval2;
-.bool held_down;
-.float rm_force;
-.float rm_damage;
-.float rm_edmg;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 
 REGISTER_NET_TEMP(TE_CSQC_VAPORBEAMPARTICLE)
 
@@ -515,4 +452,3 @@ METHOD(Vaporizer, wr_zoom, bool(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..f0b144341d538d1f24d39f47a43990b4e1be5e98 100644 (file)
@@ -1 +1,62 @@
 #pragma once
+
+CLASS(Vaporizer, Weapon)
+/* ammotype  */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells);
+/* impulse   */ ATTRIB(Vaporizer, impulse, int, 7);
+/* flags     */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000);
+/* color     */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1');
+/* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM);
+#endif
+/* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex");
+/* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6);
+/* reticle   */ ATTRIB(Vaporizer, w_reticle, string, "gfx/reticle_nex");
+/* wepimg    */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
+/* refname   */ ATTRIB(Vaporizer, netname, string, "vaporizer");
+/* wepname   */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, PRI) \
+       P(class, prefix, animtime, float, PRI) \
+       P(class, prefix, damage, float, PRI) \
+       P(class, prefix, refire, float, PRI) \
+       P(class, prefix, ammo, float, SEC) \
+       P(class, prefix, animtime, float, SEC) \
+       P(class, prefix, damage, float, SEC) \
+       P(class, prefix, delay, float, SEC) \
+       P(class, prefix, edgedamage, float, SEC) \
+       P(class, prefix, force, float, SEC) \
+       P(class, prefix, lifetime, float, SEC) \
+       P(class, prefix, radius, float, SEC) \
+       P(class, prefix, refire, float, SEC) \
+       P(class, prefix, shotangle, float, SEC) \
+       P(class, prefix, speed, float, SEC) \
+       P(class, prefix, spread, float, SEC) \
+       P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Vaporizer, vaporizer)
+#undef X
+
+ENDCLASS(Vaporizer)
+REGISTER_WEAPON(VAPORIZER, vaporizer, NEW(Vaporizer));
+
+
+#ifdef SVQC
+.float vaporizer_lasthit;
+.float jump_interval;
+.float jump_interval2;
+.bool held_down;
+.float rm_force;
+.float rm_damage;
+.float rm_edmg;
+#endif
index ee7bf22eadbc8b1e929b0a7bac29c9e340e1f43b..454cb8bfba1b3cb53d59bbb7ced9081fc265c5b5 100644 (file)
@@ -1,71 +1,4 @@
 #include "vortex.qh"
-#ifndef IMPLEMENTATION
-CLASS(Vortex, Weapon)
-/* ammotype  */ ATTRIB(Vortex, ammo_field, .int, ammo_cells);
-/* impulse   */ ATTRIB(Vortex, impulse, int, 7);
-/* flags     */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
-/* rating    */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000);
-/* color     */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1');
-/* modelname */ ATTRIB(Vortex, mdl, string, "nex");
-#ifdef GAMEQC
-/* model     */ ATTRIB(Vortex, m_model, Model, MDL_VORTEX_ITEM);
-#endif
-/* crosshair */ ATTRIB(Vortex, w_crosshair, string, "gfx/crosshairnex");
-/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
-/* reticle   */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex");
-/* wepimg    */ ATTRIB(Vortex, model2, string, "weaponnex");
-/* refname   */ ATTRIB(Vortex, netname, string, "vortex");
-/* wepname   */ ATTRIB(Vortex, m_name, string, _("Vortex"));
-
-#define X(BEGIN, P, END, class, prefix) \
-       BEGIN(class) \
-               P(class, prefix, ammo, float, BOTH) \
-               P(class, prefix, animtime, float, BOTH) \
-               P(class, prefix, chargepool, float, SEC) \
-               P(class, prefix, chargepool_pause_regen, float, SEC) \
-               P(class, prefix, chargepool_regen, float, SEC) \
-               P(class, prefix, charge, float, NONE) \
-               P(class, prefix, charge_animlimit, float, NONE) \
-               P(class, prefix, charge_limit, float, NONE) \
-               P(class, prefix, charge_maxspeed, float, NONE) \
-               P(class, prefix, charge_mindmg, float, NONE) \
-               P(class, prefix, charge_minspeed, float, NONE) \
-               P(class, prefix, charge_rate, float, NONE) \
-               P(class, prefix, charge_rot_pause, float, NONE) \
-               P(class, prefix, charge_rot_rate, float, NONE) \
-               P(class, prefix, charge_shot_multiplier, float, NONE) \
-               P(class, prefix, charge_start, float, NONE) \
-               P(class, prefix, charge_velocity_rate, float, NONE) \
-               P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
-               P(class, prefix, damagefalloff_halflife, float, BOTH) \
-               P(class, prefix, damagefalloff_maxdist, float, BOTH) \
-               P(class, prefix, damagefalloff_mindist, float, BOTH) \
-               P(class, prefix, damage, float, BOTH) \
-               P(class, prefix, force, float, BOTH) \
-               P(class, prefix, refire, float, BOTH) \
-               P(class, prefix, secondary, float, NONE) \
-               P(class, prefix, reload_ammo, float, NONE) \
-        P(class, prefix, reload_time, float, NONE) \
-        P(class, prefix, switchdelay_raise, float, NONE) \
-        P(class, prefix, switchdelay_drop, float, NONE) \
-        P(class, prefix, weaponreplace, string, NONE) \
-        P(class, prefix, weaponstart, float, NONE) \
-        P(class, prefix, weaponstartoverride, float, NONE) \
-        P(class, prefix, weaponthrowable, float, NONE) \
-       END()
-    W_PROPS(X, Vortex, vortex)
-#undef X
-
-ENDCLASS(Vortex)
-REGISTER_WEAPON(VORTEX, vortex, NEW(Vortex));
-
-
-#ifdef SVQC
-
-.float vortex_lasthit;
-#endif
-#endif
-#ifdef IMPLEMENTATION
 
 //REGISTER_STAT(WEP_CVAR_vortex_charge, bool, WEP_CVAR(vortex, charge))
 //REGISTER_STAT(WEP_CVAR_vortex_charge_animlimit, float, WEP_CVAR(vortex, charge_animlimit))
@@ -429,4 +362,3 @@ METHOD(Vortex, wr_zoom, bool(entity thiswep, entity actor))
 }
 
 #endif
-#endif
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..81ab7e6209d4389d9f8eac7765866623ab51e7c6 100644 (file)
@@ -1 +1,66 @@
 #pragma once
+
+CLASS(Vortex, Weapon)
+/* ammotype  */ ATTRIB(Vortex, ammo_field, .int, ammo_cells);
+/* impulse   */ ATTRIB(Vortex, impulse, int, 7);
+/* flags     */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000);
+/* color     */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1');
+/* modelname */ ATTRIB(Vortex, mdl, string, "nex");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Vortex, m_model, Model, MDL_VORTEX_ITEM);
+#endif
+/* crosshair */ ATTRIB(Vortex, w_crosshair, string, "gfx/crosshairnex");
+/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
+/* reticle   */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex");
+/* wepimg    */ ATTRIB(Vortex, model2, string, "weaponnex");
+/* refname   */ ATTRIB(Vortex, netname, string, "vortex");
+/* wepname   */ ATTRIB(Vortex, m_name, string, _("Vortex"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, chargepool, float, SEC) \
+               P(class, prefix, chargepool_pause_regen, float, SEC) \
+               P(class, prefix, chargepool_regen, float, SEC) \
+               P(class, prefix, charge, float, NONE) \
+               P(class, prefix, charge_animlimit, float, NONE) \
+               P(class, prefix, charge_limit, float, NONE) \
+               P(class, prefix, charge_maxspeed, float, NONE) \
+               P(class, prefix, charge_mindmg, float, NONE) \
+               P(class, prefix, charge_minspeed, float, NONE) \
+               P(class, prefix, charge_rate, float, NONE) \
+               P(class, prefix, charge_rot_pause, float, NONE) \
+               P(class, prefix, charge_rot_rate, float, NONE) \
+               P(class, prefix, charge_shot_multiplier, float, NONE) \
+               P(class, prefix, charge_start, float, NONE) \
+               P(class, prefix, charge_velocity_rate, float, NONE) \
+               P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
+               P(class, prefix, damagefalloff_halflife, float, BOTH) \
+               P(class, prefix, damagefalloff_maxdist, float, BOTH) \
+               P(class, prefix, damagefalloff_mindist, float, BOTH) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, secondary, float, NONE) \
+               P(class, prefix, reload_ammo, float, NONE) \
+        P(class, prefix, reload_time, float, NONE) \
+        P(class, prefix, switchdelay_raise, float, NONE) \
+        P(class, prefix, switchdelay_drop, float, NONE) \
+        P(class, prefix, weaponreplace, string, NONE) \
+        P(class, prefix, weaponstart, float, NONE) \
+        P(class, prefix, weaponstartoverride, float, NONE) \
+        P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Vortex, vortex)
+#undef X
+
+ENDCLASS(Vortex)
+REGISTER_WEAPON(VORTEX, vortex, NEW(Vortex));
+
+
+#ifdef SVQC
+
+.float vortex_lasthit;
+#endif
index e2e7ae628b8099682c5434216707aa55bfc81567..1757c55b812a184c7f00f0e26c82eeb8704c303a 100644 (file)
@@ -1,4 +1,9 @@
 .vector origin;
+
+// angles of the player's model (as opposed to their view which uses `.vector v_angle;`) in degrees
+// x is pitch: positive means up (unlike .v_angle), usually is 0
+// y is yaw: between -180 and 180, increases when turning left
+// z is roll: positive means tilted clockwise, usually is 0
 .vector angles;
 
 /*
index faefdcad4316b6dc4a034432aba9e811eebf9526..225c7307ded6c60a192056eafde3078912c4ae52 100644 (file)
@@ -168,7 +168,7 @@ void CSQCPlayer_PredictTo(entity this, float endframe, bool apply_error)
        {
                csqcplayer_moveframe = clientcommandframe;
                getinputstate(csqcplayer_moveframe-1);
-               LOG_INFO("the Weird code path got hit\n");
+               LOG_INFO("the Weird code path got hit");
                return;
        }
 #endif
index 3ea385cbcd8b5e4918c1f88ed8b3c6eaed9508d4..94af8634003d471dc5529a860db91449c38d0c7a 100644 (file)
@@ -45,6 +45,3 @@ void InterpolateOrigin_Reset(entity this);
 
 // call this BEFORE drawing
 void InterpolateOrigin_Do(entity this);
-
-// in case we interpolate that:
-.vector v_angle;
index 7f5bc720412348f2dcc8df053027f4de84f3e1b1..7491818b24ad309e7f0564efd5fb228326aa032c 100644 (file)
@@ -69,7 +69,10 @@ string(string, string...) strcat1n = #115;
 #define _LOG_INFO(s) \
        MACRO_BEGIN { \
                dprint(_LOG_HEADER("^5INFO")); \
-               print("\n^7", s); \
+               string __s = s; \
+               print("\n^7", __s); \
+               /* TODO: unconditionally add a newline when possible */ \
+               if (str2chr(__s, strlen(__s) - 1) != '\n') { print("\n"); } \
        } MACRO_END
 
 #define  LOG_TRACE(...) _LOG_TRACE(strcat1n(__VA_ARGS__))
index 8ba31516dda7fecffca459d112cbb4affaa92a76..f20b1c66e5bf120be7748737dabe8b9e8dec9f88 100644 (file)
@@ -322,3 +322,25 @@ vector solve_quadratic(float a, float b, float c)
        }
        return v;
 }
+
+/// Maps values between the src and dest range: src_min to dest_min, src_max to dest_max, values between them
+/// to the curresponding values between and extrapolates for values outside the range.
+///
+/// src_min and src_max must not be the same or division by zero accurs.
+///
+/// dest_max can be smaller than dest_min if you want the resulting range to be inverted, all values can be negative.
+ERASEABLE
+float map_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
+       float src_diff = src_max - src_min;
+       float dest_diff = dest_max - dest_min;
+       float ratio = (value - src_min) / src_diff;
+       return dest_min + dest_diff * ratio;
+}
+
+/// Same as `map_ranges` except that values outside the source range are clamped to min or max.
+ERASEABLE
+float map_bound_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
+       if (value <= src_min) return dest_min;
+       if (value >= src_max) return dest_max;
+       return map_ranges(value, src_min, src_max, dest_min, dest_max);
+}
index 0997e53a4964fe1657c045ce01f4f698f1a7259b..86b0e6187010fde8175bb4040e70c60c819a0f0c 100644 (file)
@@ -6,19 +6,19 @@ bool RUN_ALL_TESTS()
        int f = TEST_RunAll_accumulated(0);
        if (f)
        {
-               LOG_INFOF("%d tests failed\n", f);
+               LOG_INFOF("%d tests failed", f);
                return true;
        }
        else
        {
-               LOG_INFO("All tests OK\n");
+               LOG_INFO("All tests OK");
                return false;
        }
 }
 
 bool TEST_Run(string s)
 {
-       LOG_INFOF("%s: testing...\n", s);
+       LOG_INFOF("%s: testing...", s);
        TEST_failed = 0;
        TEST_fatal = 0;
        TEST_ok = false;
@@ -26,12 +26,12 @@ bool TEST_Run(string s)
        if (isfunction(fn)) callfunction(fn);
        if (TEST_failed > 0)
        {
-               LOG_INFOF("%s: %d items failed.\n", s, TEST_failed);
+               LOG_INFOF("%s: %d items failed.", s, TEST_failed);
                return false;
        }
        else if (!TEST_ok)
        {
-               LOG_INFOF("%s: did not complete.\n", s);
+               LOG_INFOF("%s: did not complete.", s);
                return false;
        }
        return true;
index fd8b16d881d7177db5a8f623cb2051f9260ca8ea..1572fec07cb2d1962870f63d7a3e3021db220841 100644 (file)
@@ -35,7 +35,7 @@ float url_URI_Get_Callback(int id, float status, string data)
        if (!e) return 0;
        if (e.url_rbuf >= 0 || e.url_wbuf >= 0)
        {
-               LOG_INFOF("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
+               LOG_INFOF("WARNING: handle %d (%s) has already received data?!?", id + NUM_URL_ID, e.url_url);
                return 0;
        }
 
@@ -53,7 +53,7 @@ float url_URI_Get_Callback(int id, float status, string data)
                e.url_rbuf = buf_create();
                if (e.url_rbuf < 0)
                {
-                       LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
+                       LOG_INFO("url_URI_Get_Callback: out of memory in buf_create");
                        e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                        strunzone(e.url_url);
                        delete(e);
@@ -62,7 +62,7 @@ float url_URI_Get_Callback(int id, float status, string data)
                e.url_rbufpos = 0;
                if (e.url_rbuf < 0)
                {
-                       LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
+                       LOG_INFO("url_URI_Get_Callback: out of memory in buf_create");
                        e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                        strunzone(e.url_url);
                        delete(e);
@@ -106,7 +106,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                e.url_wbuf = buf_create();
                                if (e.url_wbuf < 0)
                                {
-                                       LOG_INFO("url_single_fopen: out of memory in buf_create\n");
+                                       LOG_INFO("url_single_fopen: out of memory in buf_create");
                                        rdy(e, pass, URL_READY_ERROR);
                                        strunzone(e.url_url);
                                        delete(e);
@@ -131,7 +131,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                                if (url_fromid[i] == NULL) break;
                                        if (i >= autocvar__urllib_nextslot)
                                        {
-                                               LOG_INFO("url_single_fopen: too many concurrent requests\n");
+                                               LOG_INFO("url_single_fopen: too many concurrent requests");
                                                rdy(NULL, pass, URL_READY_ERROR);
                                                return;
                                        }
@@ -140,7 +140,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                // GET the data
                                if (!crypto_uri_postbuf(url, i + MIN_URL_ID, string_null, string_null, -1, 0))
                                {
-                                       LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf\n");
+                                       LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf");
                                        rdy(NULL, pass, URL_READY_ERROR);
                                        return;
                                }
@@ -176,7 +176,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
                                rdy(e, pass, URL_READY_CANWRITE);
                                break;
                        case FILE_READ:
-                               LOG_INFO("url_single_fopen: cannot open '-' for reading\n");
+                               LOG_INFO("url_single_fopen: cannot open '-' for reading");
                                rdy(NULL, pass, URL_READY_ERROR);
                                break;
                }
@@ -228,7 +228,7 @@ void url_fclose(entity e)
                                        if (url_fromid[i] == NULL) break;
                                if (i >= autocvar__urllib_nextslot)
                                {
-                                       LOG_INFO("url_fclose: too many concurrent requests\n");
+                                       LOG_INFO("url_fclose: too many concurrent requests");
                                        e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                                        buf_del(e.url_wbuf);
                                        strunzone(e.url_url);
@@ -240,7 +240,7 @@ void url_fclose(entity e)
                        // POST the data
                        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");
+                               LOG_INFO("url_fclose: failure in crypto_uri_postbuf");
                                e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
                                buf_del(e.url_wbuf);
                                strunzone(e.url_url);
@@ -339,7 +339,7 @@ void url_multi_ready(entity fh, entity me, float status)
        {
                if (status == -422)  // Unprocessable Entity
                {
-                       LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
+                       LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing");
                        me.url_ready(fh, me.url_ready_pass, status);
                        strunzone(me.url_url);
                        delete(me);
@@ -367,7 +367,7 @@ void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass)
        n = tokenize_console(url);
        if (n <= 0)
        {
-               LOG_INFO("url_multi_fopen: need at least one URL\n");
+               LOG_INFO("url_multi_fopen: need at least one URL");
                rdy(NULL, pass, URL_READY_ERROR);
                return;
        }
index fa247896756ca68e8527c5d4a1290b048665b7c7..6db6122352511d9640ac75baf603103a4e96ce65 100644 (file)
@@ -114,7 +114,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
                }
                else
                {
-                       LOG_INFO("would have to put player in solid, won't do that\n");
+                       LOG_INFO("would have to put player in solid, won't do that");
                        setorigin(player, o0 - player.view_ofs);
                        return 0;
                }
@@ -348,13 +348,13 @@ float WarpZone_CheckProjectileImpact(entity player)
                return 0;
 
 #ifdef WARPZONELIB_REMOVEHACK
-       LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now\n");
+       LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now");
 #else
-       LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
+       LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again");
 #endif
-       LOG_INFO("Entity type: ", player.classname, "\n");
-       LOG_INFO("Origin: ", vtos(player.origin), "\n");
-       LOG_INFO("Velocity: ", vtos(player.velocity), "\n");
+       LOG_INFO("Entity type: ", player.classname);
+       LOG_INFO("Origin: ", vtos(player.origin));
+       LOG_INFO("Velocity: ", vtos(player.velocity));
 
 #ifdef WARPZONELIB_REMOVEHACK
        return 0;
@@ -583,7 +583,7 @@ void WarpZone_InitStep_UpdateTransform(entity this)
                point = point * (1 / (3 * area));
                if(vdist(norm, <, 0.99))
                {
-                       LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE.\n");
+                       LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE.");
                        area = 0; // no autofixing in this case
                }
                norm = normalize(norm);
@@ -600,15 +600,15 @@ void WarpZone_InitStep_UpdateTransform(entity this)
                        makevectors(ang);
                        if(norm * v_forward < 0)
                        {
-                               LOG_INFO("Position target of trigger_warpzone near ", vtos(this.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.");
                                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(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang), "\n");
+                               LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang));
                        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");
+                               LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been moved to match the plane (", vtos(this.aiment.origin), " -> ", vtos(org), ").");
                }
        }
        else if(area > 0)
index 72aadf6247bac401778744fe630ea81443979fba..18e5ae08123ff999f479c896f2eadc79de4972d6 100644 (file)
@@ -16,15 +16,15 @@ void _dumptree_open(entity pass, entity me)
        s = me.toString(me);
        if (s == "") s = me.classname;
        else s = strcat(me.classname, ": ", s);
-       LOG_INFO(_dumptree_space, etos(me), " (", s, ")");
+       print(_dumptree_space, etos(me), " (", s, ")");
        if (me.firstChild)
        {
-               LOG_INFO(" {\n");
+               print(" {\n");
                _dumptree_space = strcat(_dumptree_space, "  ");
        }
        else
        {
-               LOG_INFO("\n");
+               print("\n");
        }
 }
 void _dumptree_close(entity pass, entity me)
@@ -32,7 +32,7 @@ void _dumptree_close(entity pass, entity me)
        if (me.firstChild)
        {
                _dumptree_space = substring(_dumptree_space, 0, strlen(_dumptree_space) - 2);
-               LOG_INFO(_dumptree_space, "}\n");
+               print(_dumptree_space, "}\n");
        }
 }
 
@@ -45,11 +45,11 @@ void GameCommand(string theCommand)
 
        if (argv(0) == "help" || argc == 0)
        {
-               LOG_INFO(_("Usage: menu_cmd command..., where possible commands are:\n"));
-               LOG_INFO(_("  sync - reloads all cvars on the current menu page\n"));
-               LOG_INFO(_("  directmenu ITEM - select a menu item as main item\n"));
+               LOG_INFO(_("Usage: menu_cmd command..., where possible commands are:"));
+               LOG_INFO(_("  sync - reloads all cvars on the current menu page"));
+               LOG_INFO(_("  directmenu ITEM - select a menu item as main item"));
 
-               LOG_INFO("\nGeneric commands shared by all programs:\n");
+               LOG_INFO("Generic commands shared by all programs:");
                GenericCommand_macro_help();
 
                return;
@@ -76,7 +76,7 @@ void GameCommand(string theCommand)
 
                if (argc == 1)
                {
-                       LOG_INFO(_("Available options:\n"));
+                       LOG_INFO(_("Available options:"));
 
                        FOREACH_ENTITY_ORDERED(it.name != "", {
                                if (it.classname == "vtbl") continue;
@@ -86,7 +86,7 @@ void GameCommand(string theCommand)
                                        if (!startsWith(s, filter)) continue;
                                        s = substring(s, strlen(filter), strlen(s) - strlen(filter));
                                }
-                               LOG_INFOF(" %s\n", s);
+                               LOG_INFOF(" %s", s);
                        });
                }
                else if (argc == 2 && !isdemo())     // don't allow this command in demos
@@ -125,5 +125,5 @@ void GameCommand(string theCommand)
        if(MUTATOR_CALLHOOK(Menu_ConsoleCommand, ss, argc, theCommand)) // handled by a mutator
                return;
 
-       LOG_INFO(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
+       LOG_INFO(_("Invalid command. For a list of supported commands, try menu_cmd help."));
 }
index f0e6646ca93d7115063ea9d36018565271229ad3..af14e0842b4dc749897a45e7fc2f18ae2dcaf6c4 100644 (file)
@@ -69,7 +69,7 @@ void m_init()
        cvar_set("_menu_prvm_language", prvm_language);
 
 #ifdef WATERMARK
-               LOG_INFOF("^4MQC Build information: ^1%s\n", WATERMARK);
+               LOG_INFOF("^4MQC Build information: ^1%s", WATERMARK);
 #endif
 
        // list all game dirs (TEST)
index 8feee96ed7a05a7ac74ef8a97a8eae709a503c2e..111744e9668da9e0b3909f7c97e15c8f01062e72 100644 (file)
@@ -288,7 +288,7 @@ void MapList_LoadMap(entity btn, entity me)
        m = MapInfo_BSPName_ByID(i);
        if (!m)
        {
-               LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
+               LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again."));
                me.refilter(me);
                return;
        }
@@ -301,7 +301,7 @@ void MapList_LoadMap(entity btn, entity me)
        }
        else
        {
-               LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
+               LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again."));
                me.refilter(me);
                return;
        }
index ad9e38f03a61f1a4303ae7cca83302c68351137c..5e6a567b6af907de399757b63a265675d265d340 100644 (file)
@@ -45,7 +45,7 @@ void RegisterSLCategories()
                                else \
                                { \
                                        LOG_INFOF( \
-                                               "RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
+                                               "RegisterSLCategories(): Improper override '%s' for category '%s'!", \
                                                s, \
                                                categories[i].cat_name \
                                        ); \
index 6e3f8a03377f51eb4c6e93094ac384c92079ba99..e72ca12e2409813c024fbca7dc98914a1c56da35 100644 (file)
@@ -76,7 +76,7 @@ void XonoticSkinList_getSkins(entity me)
                fh = fopen(s, FILE_READ);
                if(fh < 0)
                {
-                       LOG_INFO("Warning: can't open skinvalues.txt file\n");
+                       LOG_INFO("Warning: can't open skinvalues.txt file");
                        continue;
                }
                while((s = fgets(fh)))
index dcc2c85b06a1746bec59d3144dd7222e08cae1a9..e26076b658a8b80ab668a9fc8c675677a55c11af 100644 (file)
@@ -92,7 +92,7 @@ TEST(XonoticDecibelsSlider, SoundTest)
                float v = fromDecibelOfSquare(db, -40);
                float dbv = toDecibelOfSquare(v, -40);
                float d = dbv - db;
-               LOG_INFOF("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
+               LOG_INFOF("%f -> %f -> %f (diff: %f)", db, v, dbv, d);
                EXPECT_GT(fabs(d), 0.02);
        }
        SUCCEED();
index 7f038a85fb53efe0f28d7e02a0efbd4855bce3b1..7b381b544588ae4d9049d972ad0d74d44c7c9a23 100644 (file)
@@ -306,7 +306,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
+               LOG_INFOF("Received HTTP request data for an invalid id %d.", id);
        }
 }
 
@@ -414,7 +414,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                {
                        // update needed
                        _Nex_ExtResponseSystem_UpdateTo = strzone(un_version);
-                       if(un_download) { LOG_INFOF(_("Update can be downloaded at:\n%s\n"), un_download); }
+                       if(un_download) { LOG_INFOF(_("Update can be downloaded at:\n%s"), un_download); }
                        if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); }
                        DisableServerBackwardsCompatibility();
                }
@@ -659,7 +659,7 @@ float updateCompression()
                cvar_set("gl_texturecompression", "1");
                cvar_set("r_texture_dds_load", "1");
                if(!can_dds)
-                       LOG_INFO(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
+                       LOG_INFO(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems."));
                return 0;
        }
        else
@@ -830,7 +830,7 @@ void CheckSendCvars(entity me, string cvarnamestring)
 {
        if(me.sendCvars)
        {
-               LOG_INFOF("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring));
+               LOG_INFOF("Sending cvar: %s -> %s", cvarnamestring, cvar_string(cvarnamestring));
                if(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
                {
                        cmd(sprintf("\nsendcvar %s\n", cvarnamestring));
index feb19afe1f921b25fec4c0422555482c70ff1b43..8f2abb3f824b5745448a5fb4c16ab21545e5451b 100644 (file)
@@ -307,7 +307,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation)
        //dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n");
 
        // decide whether to fire this time
-       if ((normalize(v) * shotdir) >= cos(maxfiredeviation * DEG2RAD))
+       if (v * shotdir >= cos(maxfiredeviation * DEG2RAD))
        if(vdist(trace_endpos-shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10)) || random()*random()>bound(0,(skill+this.bot_aggresskill)*0.05,1))
                this.bot_firetimer = time + bound(0.1, 0.5-(skill+this.bot_aggresskill)*0.05, 0.5);
        //traceline(shotorg,shotorg+shotdir*1000,false,NULL);
index 6cb24f0be03581e50e8f0fcb7d603b9376a2eb41..f8ddd0c637576d81efb058e330c11922d9438a56 100644 (file)
@@ -166,7 +166,7 @@ void bot_setnameandstuff(entity this)
 
        if(file < 0)
        {
-               LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
+               LOG_INFOF("Error: Can not open the bot configuration file '%s'", autocvar_bot_config_file);
                readfile = "";
        }
        else
@@ -598,6 +598,16 @@ float bot_fixcount()
                        ++realplayers;
                });
        }
+       if(currentbots == -1)
+       {
+               currentbots = 0;
+               // human players joining early may cause weird issues (bots appearing on
+               // the scoreboard as spectators) when switching map with the gotomap
+               // command, as it doesn't remove bots of the previous match, and with
+               // minplayers > 1, so ignore human players in the first bot frame
+               // TODO maybe find a cleaner solution
+               activerealplayers = 0;
+       }
 
        int bots;
        // add/remove bots if needed to make sure there are at least
@@ -630,8 +640,7 @@ float bot_fixcount()
        // only add one bot per frame to avoid utter chaos
        if(time > botframe_nextthink)
        {
-               //dprint(ftos(bots), " ? ", ftos(currentbots), "\n");
-               while (currentbots < bots)
+               if (currentbots < bots)
                {
                        if (bot_spawn() == NULL)
                        {
@@ -685,7 +694,10 @@ void bot_serverframe()
                return;
 
        if (time < 2)
+       {
+               currentbots = -1;
                return;
+       }
 
        bot_calculate_stepheightvec();
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
index badf9437ecb9c8f16cc0ac28afbed8d1dc93d82c..e69050beb84d16e438e12f5849184139f792195c 100644 (file)
@@ -132,7 +132,7 @@ entity bot_getplace(entity this, string placename)
                }
                e = find(NULL, targetname, s);
                if(!e)
-                       LOG_INFO("invalid place ", s, "\n");
+                       LOG_INFO("invalid place ", s);
                if(i < MAX_BOT_PLACES)
                {
                        this.(bot_placenames[i]) = strzone(placename);
@@ -145,7 +145,7 @@ entity bot_getplace(entity this, string placename)
        {
                e = find(NULL, targetname, placename);
                if(!e)
-                       LOG_INFO("invalid place ", placename, "\n");
+                       LOG_INFO("invalid place ", placename);
                return e;
        }
 }
@@ -294,7 +294,7 @@ float bot_decodecommand(string cmdstring)
 
                if(cmd_parm_type!=BOT_CMD_PARAMETER_NONE&&parm=="")
                {
-                       LOG_INFO("ERROR: A parameter is required for this command\n");
+                       LOG_INFO("ERROR: A parameter is required for this command");
                        return 0;
                }
 
@@ -315,7 +315,7 @@ float bot_decodecommand(string cmdstring)
                        case BOT_CMD_PARAMETER_VECTOR:
                                if(substring(parm, 0, 1) != "\'")
                                {
-                                       LOG_INFOF("ERROR: expected vector type \'x y z\', got %s\n", parm);
+                                       LOG_INFOF("ERROR: expected vector type \'x y z\', got %s", parm);
                                        return 0;
                                }
                                bot_cmd.bot_cmd_parm_vector = stov(parm);
@@ -325,7 +325,7 @@ float bot_decodecommand(string cmdstring)
                }
                return 1;
        }
-       LOG_INFO("ERROR: No such command '", cmdstring, "'\n");
+       LOG_INFO("ERROR: No such command '", cmdstring, "'");
        return 0;
 }
 
@@ -360,87 +360,90 @@ void bot_cmdhelp(string scmd)
                                break;
                }
 
-               LOG_INFO(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
-
-               LOG_INFO("Description: ");
+               string prelude = strcat(
+                   "Command: ", bot_cmd_string[i], "\n",
+                   "Parameter: <", stype, ">", "\n",
+                   "Description: "
+        );
                switch(i)
                {
                        case BOT_CMD_PAUSE:
-                               LOG_INFO("Stops the bot completely. Any command other than 'continue' will be ignored.");
+                               LOG_INFO(prelude, "Stops the bot completely. Any command other than 'continue' will be ignored.");
                                break;
                        case BOT_CMD_CONTINUE:
-                               LOG_INFO("Disable paused status");
+                               LOG_INFO(prelude, "Disable paused status");
                                break;
                        case BOT_CMD_WAIT:
-                               LOG_INFO("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
+                               LOG_INFO(prelude, "Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_WAIT_UNTIL:
-                               LOG_INFO("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
+                               LOG_INFO(prelude, "Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_BARRIER:
-                               LOG_INFO("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
+                               LOG_INFO(prelude, "Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
                                break;
                        case BOT_CMD_TURN:
-                               LOG_INFO("Look to the right or left N degrees. For turning to the left use positive numbers.");
+                               LOG_INFO(prelude, "Look to the right or left N degrees. For turning to the left use positive numbers.");
                                break;
                        case BOT_CMD_MOVETO:
-                               LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
+                               LOG_INFO(prelude, "Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
                                break;
                        case BOT_CMD_MOVETOTARGET:
-                               LOG_INFO("Walk to the specific target on the map");
+                               LOG_INFO(prelude, "Walk to the specific target on the map");
                                break;
                        case BOT_CMD_RESETGOAL:
-                               LOG_INFO("Resets the goal stack");
+                               LOG_INFO(prelude, "Resets the goal stack");
                                break;
                        case BOT_CMD_CC:
-                               LOG_INFO("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
+                               LOG_INFO(prelude, "Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
                                break;
                        case BOT_CMD_IF:
-                               LOG_INFO("Perform simple conditional execution.\n");
-                               LOG_INFO("Syntax: \n");
-                               LOG_INFO("        sv_cmd .. if \"condition\"\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if true>\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if true>\n");
-                               LOG_INFO("        sv_cmd .. else\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if false>\n");
-                               LOG_INFO("        sv_cmd ..     <instruction if false>\n");
-                               LOG_INFO("        sv_cmd .. fi\n");
-                               LOG_INFO("Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n");
-                               LOG_INFO("            Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n");
-                               LOG_INFO("Fields: health, speed, flagcarrier\n");
-                               LOG_INFO("Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;");
+                               LOG_INFO(prelude, "Perform simple conditional execution.\n"
+                    "Syntax: \n"
+                    "        sv_cmd .. if \"condition\"\n"
+                    "        sv_cmd ..         <instruction if true>\n"
+                    "        sv_cmd ..         <instruction if true>\n"
+                    "        sv_cmd .. else\n"
+                    "        sv_cmd ..         <instruction if false>\n"
+                    "        sv_cmd ..         <instruction if false>\n"
+                    "        sv_cmd .. fi\n"
+                    "Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n"
+                    "            Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n"
+                    "Fields: health, speed, flagcarrier\n"
+                    "Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;"
+                               );
                                break;
                        case BOT_CMD_RESETAIM:
-                               LOG_INFO("Points the aim to the coordinates x,y 0,0");
+                               LOG_INFO(prelude, "Points the aim to the coordinates x,y 0,0");
                                break;
                        case BOT_CMD_AIM:
-                               LOG_INFO("Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n");
-                               LOG_INFO("There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n");
-                               LOG_INFO("Examples: aim \"90 0\"        // Turn 90 degrees inmediately (positive numbers move to the left/up)\n");
-                               LOG_INFO("          aim \"0 90 2\"      // Will gradually look to the sky in the next two seconds");
+                               LOG_INFO(prelude, "Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n"
+                                       "There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n"
+                                       "Examples: aim \"90 0\" // Turn 90 degrees inmediately (positive numbers move to the left/up)\n"
+                                       "          aim \"0 90 2\"       // Will gradually look to the sky in the next two seconds"
+                               );
                                break;
                        case BOT_CMD_AIMTARGET:
-                               LOG_INFO("Points the aim to given target");
+                               LOG_INFO(prelude, "Points the aim to given target");
                                break;
                        case BOT_CMD_PRESSKEY:
-                               LOG_INFO("Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use\n");
+                               LOG_INFO(prelude, "Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use");
                                LOG_INFO("Multiple keys can be pressed at time (with many presskey calls) and it will remain pressed until the command \"releasekey\" is called");
                                LOG_INFO("Note: The script will not return the control to the bot ai until all keys are released");
                                break;
                        case BOT_CMD_RELEASEKEY:
-                               LOG_INFO("Release previoulsy used keys. Use the parameter \"all\" to release all keys");
+                               LOG_INFO(prelude, "Release previoulsy used keys. Use the parameter \"all\" to release all keys");
                                break;
                        case BOT_CMD_SOUND:
-                               LOG_INFO("play sound file at bot location");
+                               LOG_INFO(prelude, "play sound file at bot location");
                                break;
                        case BOT_CMD_DEBUG_ASSERT_CANFIRE:
-                               LOG_INFO("verify the state of the weapon entity");
+                               LOG_INFO(prelude, "verify the state of the weapon entity");
                                break;
                        default:
-                               LOG_INFO("This command has no description yet.");
+                               LOG_INFO(prelude, "This command has no description yet.");
                                break;
                }
-               LOG_INFO("\n");
        }
 }
 
@@ -452,8 +455,10 @@ void bot_list_commands()
        if(!bot_cmds_initialized)
                bot_commands_init();
 
-       LOG_INFO("List of all available commands:\n");
-       LOG_INFO("  Command - Parameter Type\n");
+       LOG_INFO(
+           "List of all available commands:\n"
+           "  Command - Parameter Type\n"
+    );
 
        for(i=1;i<BOT_CMD_COUNTER;++i)
        {
@@ -472,7 +477,7 @@ void bot_list_commands()
                                ptype = "none";
                                break;
                }
-               LOG_INFO(strcat("  ",bot_cmd_string[i]," - <",ptype,"> \n"));
+               LOG_INFO("  ", bot_cmd_string[i]," - <", ptype, ">");
        }
 }
 
@@ -627,7 +632,7 @@ float bot_cmd_eval(entity this, string expr)
                        return ((this.flagcarried!=NULL));
        }
 
-       LOG_INFO(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n"));
+       LOG_INFO("ERROR: Unable to convert the expression '", expr, "' into a numeric value");
        return 0;
 }
 
@@ -1077,7 +1082,7 @@ float bot_cmd_debug_assert_canfire(entity this)
                if(f)
                {
                        this.colormod = '0 8 8';
-                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by weaponentity state\n");
+                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by weaponentity state");
                }
        }
        else if(ATTACK_FINISHED(this, slot) > time)
@@ -1085,7 +1090,7 @@ float bot_cmd_debug_assert_canfire(entity this)
                if(f)
                {
                        this.colormod = '8 0 8';
-                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by ATTACK_FINISHED (", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left)\n");
+                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by ATTACK_FINISHED (", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left)");
                }
        }
        else if(this.(weaponentity).tuba_note)
@@ -1093,7 +1098,7 @@ float bot_cmd_debug_assert_canfire(entity this)
                if(f)
                {
                        this.colormod = '8 0 0';
-                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, bot still has an active tuba note\n");
+                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, bot still has an active tuba note");
                }
        }
        else
@@ -1101,7 +1106,7 @@ float bot_cmd_debug_assert_canfire(entity this)
                if(!f)
                {
                        this.colormod = '8 8 0';
-                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " thinks it has fired, but apparently did not; ATTACK_FINISHED says ", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left\n");
+                       LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " thinks it has fired, but apparently did not; ATTACK_FINISHED says ", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left");
                }
        }
 
@@ -1198,7 +1203,7 @@ float bot_execute_commands_once(entity this)
                if(bot_cmd.bot_cmd_type!=BOT_CMD_NULL)
                {
                        bot_command_executed(this, true);
-                       LOG_INFO( "WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
+                       LOG_INFO("WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.");
                }
                return 1;
        }
@@ -1296,12 +1301,12 @@ float bot_execute_commands_once(entity this)
                        status = bot_cmd_debug_assert_canfire(this);
                        break;
                default:
-                       LOG_INFO(strcat("ERROR: Invalid command on queue with id '",ftos(bot_cmd.bot_cmd_type),"'\n"));
+                       LOG_INFOF("ERROR: Invalid command on queue with id '%s'", ftos(bot_cmd.bot_cmd_type));
                        return 0;
        }
 
        if (status==CMD_STATUS_ERROR)
-               LOG_INFO(strcat("ERROR: The command '",bot_cmd_string[bot_cmd.bot_cmd_type],"' returned an error status\n"));
+               LOG_INFOF("ERROR: The command '%s' returned an error status", bot_cmd_string[bot_cmd.bot_cmd_type]);
 
        // Move execution pointer
        if(status==CMD_STATUS_EXECUTING)
index c8a958ddbd0f2a0fca0cf8f3e7606d684ea77c7d..b1ff75db72eb477d7942f285ac31c82b62a5c313 100644 (file)
@@ -76,7 +76,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
                        {
                                if(autocvar_developer)
                                {
-                                       LOG_INFO("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
+                                       LOG_INFO("A generated waypoint is stuck in solid at ", vtos(w.origin));
                                        backtrace("Waypoint stuck");
                                }
                        }
@@ -518,7 +518,7 @@ void waypoint_load_or_remove_links_hardwired(bool removal_mode)
                        if(!found)
                        {
                                if(!removal_mode)
-                                       LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped\n"));
+                                       LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped");
                                continue;
                        }
                }
@@ -540,7 +540,7 @@ void waypoint_load_or_remove_links_hardwired(bool removal_mode)
                if(!found)
                {
                        if(!removal_mode)
-                               LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped\n"));
+                               LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped");
                        continue;
                }
 
@@ -615,7 +615,7 @@ void waypoint_save_links()
        int file = fopen(filename, FILE_WRITE);
        if (file < 0)
        {
-               LOG_INFOF("waypoint link save to %s failed\n", filename);
+               LOG_INFOF("waypoint link save to %s failed", filename);
                return;
        }
 
@@ -636,7 +636,7 @@ void waypoint_save_links()
        fclose(file);
        botframe_cachedwaypointlinks = true;
 
-       LOG_INFOF("saved %d waypoint links to maps/%s.waypoints.cache\n", c, mapname);
+       LOG_INFOF("saved %d waypoint links to maps/%s.waypoints.cache", c, mapname);
 
        waypoint_load_links_hardwired();
 }
@@ -651,7 +651,7 @@ void waypoint_saveall()
                waypoint_save_links(); // save anyway?
                botframe_loadedforcedlinks = false;
 
-               LOG_INFOF("waypoint links: save to %s failed\n", filename);
+               LOG_INFOF("waypoint links: save to %s failed", filename);
                return;
        }
 
@@ -674,7 +674,7 @@ void waypoint_saveall()
        waypoint_save_links();
        botframe_loadedforcedlinks = false;
 
-       LOG_INFOF("saved %d waypoints to maps/%s.waypoints\n", c, mapname);
+       LOG_INFOF("saved %d waypoints to maps/%s.waypoints", c, mapname);
 }
 
 // load waypoints from file
@@ -952,7 +952,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
                });
                if(bestdist < maxdist)
                {
-                       LOG_INFO("update chain to new nearest WP ", etos(p.(fld)), "\n");
+                       LOG_INFO("update chain to new nearest WP ", etos(p.(fld)));
                        return 0;
                }
 
@@ -1031,7 +1031,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
                tmax = t;
        }
 
-       LOG_INFO("spawning a waypoint for connecting to ", etos(wp), "\n");
+       LOG_INFO("spawning a waypoint for connecting to ", etos(wp));
        botframe_autowaypoints_createwp(o, p, fld, 0);
        return 1;
 }
@@ -1047,7 +1047,7 @@ void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld)
        if(r != -1)
                return;
 
-       LOG_INFO("emergency: got no good nearby WP to build a link from, starting a new chain\n");
+       LOG_INFO("emergency: got no good nearby WP to build a link from, starting a new chain");
        if(!botframe_autowaypoints_fixdown(p.origin))
                return; // shouldn't happen, caught above
        botframe_autowaypoints_createwp(trace_endpos, p, fld, WAYPOINTFLAG_PROTECTED);
@@ -1119,7 +1119,7 @@ LABEL(next)
 
        IL_EACH(g_waypoints, !(it.wpflags & (WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END)),
        {
-               LOG_INFOF("Removed a waypoint at %v. Try again for more!\n", it.origin);
+               LOG_INFOF("Removed a waypoint at %v. Try again for more!", it.origin);
                te_explosion(it.origin);
                waypoint_remove(it);
                break;
index ec8990de25602905b11a12e5e5458523cc4bf8ee..e80769cc2783edabcca7b1952aafbb5f9b06a256 100644 (file)
@@ -25,7 +25,7 @@ float CampaignBailout(string s)
        cvar_string = cvar_string_normal;
        cvar_set = cvar_set_normal;
        cvar_set("g_campaign", "0");
-       LOG_INFO("^4campaign initialization failed: ", s, "\n");
+       LOG_INFO("^4campaign initialization failed: ", s);
        if(autocvar__campaign_testrun)
                error("CAMPAIGN FAIL AHAHAHAHAHAHAHAHAH))");
        return 1;
index ee1e767601a223b6964aff9ac1aba498a717796e..3233a141dd9e1b14b71437c49e016ed77d6acf2e 100644 (file)
@@ -282,7 +282,7 @@ float CheatImpulse(entity this, int imp)
                        RadiusDamage(e2, this, 1000, 0, 128, NULL, NULL, 500, DEATH_CHEAT.m_id, e);
                        delete(e2);
 
-                       LOG_INFO("404 Sportsmanship not found.\n");
+                       LOG_INFO("404 Sportsmanship not found.");
                        DID_CHEAT();
                        break;
        }
index b0eb75ae41bd1c1954a3bdad671924a5133b947c..f1d417d6bace6987d6f1a72984f6f77260b7db0f 100644 (file)
@@ -113,20 +113,18 @@ bool ClientData_Send(entity this, entity to, int sf)
        if (IS_SPEC(e)) e = e.enemy;
 
        sf = 0;
-       if (CS(e).race_completed)       sf |= 1; // forced scoreboard
-       if (CS(to).spectatee_status)    sf |= 2; // spectator ent number follows
-       if (CS(e).zoomstate)            sf |= 4; // zoomed
-       if (autocvar_sv_showspectators) sf |= 16; // show spectators
+       if (CS(e).race_completed)       sf |= BIT(0); // forced scoreboard
+       if (CS(to).spectatee_status)    sf |= BIT(1); // spectator ent number follows
+       if (CS(e).zoomstate)            sf |= BIT(2); // zoomed
+       if (autocvar_sv_showspectators) sf |= BIT(4); // show spectators
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
        WriteByte(MSG_ENTITY, sf);
 
-       if (sf & 2)
-       {
+       if (sf & BIT(1))
                WriteByte(MSG_ENTITY, CS(to).spectatee_status);
-       }
 
-       if(sf & 16)
+       if(sf & BIT(4))
        {
                float specs = CountSpectators(e, to);
                WriteByte(MSG_ENTITY, specs);
@@ -1189,7 +1187,10 @@ void ClientConnect(entity this)
        PlayerStats_GameReport_AddEvent(sprintf("kills-%d", this.playerid));
 
        // always track bots, don't ask for cl_allow_uidtracking
-    if (IS_BOT_CLIENT(this)) PlayerStats_GameReport_AddPlayer(this);
+       if (IS_BOT_CLIENT(this))
+               PlayerStats_GameReport_AddPlayer(this);
+       else
+               CS(this).allowed_timeouts = autocvar_sv_timeout_number;
 
        if (autocvar_sv_eventlog)
                GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", playername(this, false)));
@@ -1238,7 +1239,6 @@ void ClientConnect(entity this)
        }
 
        CS(this).jointime = time;
-       CS(this).allowed_timeouts = autocvar_sv_timeout_number;
 
        if (IS_REAL_CLIENT(this))
        {
@@ -1622,7 +1622,6 @@ void player_regen(entity this)
        regen_health_stable = M_ARGV(9, float);
        regen_health_rotstable = M_ARGV(10, float);
 
-
        if(!mutator_returnvalue)
        if(!STAT(FROZEN, this))
        {
@@ -1661,6 +1660,18 @@ void player_regen(entity this)
 
                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);
        }
+       // Ugly hack to make sure the health and armor don't go beyond hard limit.
+       // TODO: Remove this hack when all code uses GivePlayerHealth and
+       // GivePlayerArmor.
+       if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
+       {
+               this.health = RESOURCE_AMOUNT_HARD_LIMIT;
+       }
+       if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
+       {
+               this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
+       }
+       // End hack.
 }
 
 bool zoomstate_set;
index 614916019f60c4c385851febb2d25c8e102d38ad..9674872c0faa42bd6bc0c1a466204a0c166d9b08 100644 (file)
@@ -141,6 +141,8 @@ CLASS(Client, Object)
     ATTRIB(Client, cvar_cl_multijump, bool, this.cvar_cl_multijump);
     ATTRIB(Client, cvar_cl_accuracy_data_share, bool, this.cvar_cl_accuracy_data_share);
     ATTRIB(Client, cvar_cl_accuracy_data_receive, bool, this.cvar_cl_accuracy_data_receive);
+    ATTRIBARRAY(Client, cvar_cl_weaponpriorities, string, 10);
+    ATTRIB(Client, cvar_cl_weaponpriority, string, this.cvar_cl_weaponpriority);
 
     METHOD(Client, m_unwind, bool(Client this));
 
index d90b372bb7a8f990b6fec7d9944a6ce93428120b..da495f7962f89210697c4dead7802da99df03d78 100644 (file)
@@ -41,14 +41,14 @@ void BanCommand_ban(float request, float argc, string command)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2ban^7\n");
+                       LOG_INFO("Incorrect parameters for ^2ban^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd ban address [bantime] [reason]\n");
-                       LOG_INFO("  'address' is the IP address or range of the player to ban,\n");
-                       LOG_INFO("  'bantime' is the amount of time that the ban is active (default if not provided),\n");
-                       LOG_INFO("  and 'reason' is the string to label the ban with as reason for banning.\n");
-                       LOG_INFO("See also: ^2banlist, kickban, unban^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd ban address [bantime] [reason]");
+                       LOG_INFO("  'address' is the IP address or range of the player to ban,");
+                       LOG_INFO("  'bantime' is the amount of time that the ban is active (default if not provided),");
+                       LOG_INFO("  and 'reason' is the string to label the ban with as reason for banning.");
+                       LOG_INFO("See also: ^2banlist, kickban, unban^7");
                        return;
                }
        }
@@ -67,9 +67,9 @@ void BanCommand_banlist(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd banlist\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2ban, kickban, unban^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd banlist");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2ban, kickban, unban^7");
                        return;
                }
        }
@@ -102,21 +102,21 @@ void BanCommand_kickban(float request, float argc, string command)
                                }
                                else
                                {
-                                       LOG_INFO("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n");
+                                       LOG_INFO("kickban: ", GetClientErrorString(accepted, argv(1)), ".");
                                }
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2kickban^7\n");
+                       LOG_INFO("Incorrect parameters for ^2kickban^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd kickban client [bantime] [masksize] [reason]\n");
-                       LOG_INFO("  'client' is the entity number or name of the player to ban,\n");
-                       LOG_INFO("  'bantime' is the amount of time that the ban is active (default if not provided),\n");
-                       LOG_INFO("  'masksize' is the range of the IP address (1-thru-4, default if not provided),\n");
-                       LOG_INFO("  and 'reason' is the string to label the ban with as reason for banning.\n");
-                       LOG_INFO("See also: ^2ban, banlist, unban^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd kickban client [bantime] [masksize] [reason]");
+                       LOG_INFO("  'client' is the entity number or name of the player to ban,");
+                       LOG_INFO("  'bantime' is the amount of time that the ban is active (default if not provided),");
+                       LOG_INFO("  'masksize' is the range of the IP address (1-thru-4, default if not provided),");
+                       LOG_INFO("  and 'reason' is the string to label the ban with as reason for banning.");
+                       LOG_INFO("See also: ^2ban, banlist, unban^7");
                        return;
                }
        }
@@ -140,18 +140,18 @@ void BanCommand_mute(float request, float argc, string command)  // TODO: Add a
                                }
                                else
                                {
-                                       LOG_INFO("mute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+                                       LOG_INFO("mute: ", GetClientErrorString(accepted, argv(1)), ".");
                                }
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2mute^7\n");
+                       LOG_INFO("Incorrect parameters for ^2mute^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd mute client\n");
-                       LOG_INFO("  'client' is the entity number or name of the player to mute.\n");
-                       LOG_INFO("See also: ^2unmute^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd mute client");
+                       LOG_INFO("  'client' is the entity number or name of the player to mute.");
+                       LOG_INFO("See also: ^2unmute^7");
                        return;
                }
        }
@@ -195,9 +195,9 @@ void BanCommand_unban(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd unban banid\n");
-                       LOG_INFO("  Where 'banid' is the ID of the ban of which to remove.\n");
-                       LOG_INFO("See also: ^2ban, banlist, kickban^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd unban banid");
+                       LOG_INFO("  Where 'banid' is the ID of the ban of which to remove.");
+                       LOG_INFO("See also: ^2ban, banlist, kickban^7");
                        return;
                }
        }
@@ -221,18 +221,18 @@ void BanCommand_unmute(float request, float argc)
                                }
                                else
                                {
-                                       LOG_INFO("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+                                       LOG_INFO("unmute: ", GetClientErrorString(accepted, argv(1)), ".");
                                }
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2mute^7\n");
+                       LOG_INFO("Incorrect parameters for ^2mute^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd unmute client\n");
-                       LOG_INFO("  'client' is the entity number or name of the player to unmute.\n");
-                       LOG_INFO("See also: ^2mute^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd unmute client");
+                       LOG_INFO("  'client' is the entity number or name of the player to unmute.");
+                       LOG_INFO("See also: ^2mute^7");
                        return;
                }
        }
@@ -279,7 +279,7 @@ void BanCommand_(float request)
 void BanCommand_macro_help()
 {
        #define BAN_COMMAND(name, function, description) \
-               { if (strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
+               { if (strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description); } }
 
        BAN_COMMANDS(0, 0, "");
 #undef BAN_COMMAND
index 50250f9a5c2974bfb246dc3eff04dd0f2b18d346..a2c037c5d2d198573a8c5eb63eb7e388560df8bf 100644 (file)
@@ -454,7 +454,7 @@ void ClientCommand_sentcvar(entity caller, float request, float argc, string com
                                        tokenize_console(s);
                                }
 
-                               GetCvars(caller, 1);
+                               GetCvars(caller, CS(caller), 1);
 
                                return;
                        }
index d8bc3ac8b3ef07f979c53215e0a761741c864f1e..46d1d2b6f86fd1c888b3b730593179552625f2d3 100644 (file)
@@ -179,7 +179,7 @@ float GetFilteredNumber(string input)
 void print_to(entity to, string input)
 {
        if (to) sprint(to, strcat(input, "\n"));
-       else LOG_INFO(input, "\n");
+       else print(input, "\n");
 }
 
 // ==========================================
@@ -437,7 +437,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                case "butcher":
                                {
                                        if (caller) { print_to(caller, "This command is not available to players"); return; }
-                                       if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string), "\n"); return; }
+                                       if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFOF("%s", M_ARGV(0, string)); return; }
 
                                        int tmp_remcount = 0;
 
index a04274ed2ef1e31719da405a97bdbe2f0eb60e67..6c31af72c853d54cdef08fd5d723940efe6baecf 100644 (file)
@@ -230,7 +230,7 @@ void RadarMap_Think(entity this)
                this.maxs_x = (mi_picmax.x - mi_picmin.x) / this.size.x;
                this.maxs_y = (mi_picmax.y - mi_picmin.y) / this.size.y;
                this.maxs_z = mi_max.z - mi_min.z;
-               LOG_INFO("Picture mins/maxs: ", ftos(this.maxs.x), " and ", ftos(this.maxs.y), " should match\n");
+               LOG_INFO("Picture mins/maxs: ", ftos(this.maxs.x), " and ", ftos(this.maxs.y), " should match");
                this.netname = strzone(strcat("gfx/", mi_shortname, "_radar.xpm"));
                if (!(this.count & 1))
                {
@@ -245,7 +245,7 @@ void RadarMap_Think(entity this)
                        {
                                fclose(this.cnt);
 
-                               LOG_INFO(this.netname, " already exists, aborting (you may want to specify --force)\n");
+                               LOG_INFO(this.netname, " already exists, aborting (you may want to specify --force)");
                                RadarMap_Next();
                                return;
                        }
@@ -253,12 +253,12 @@ void RadarMap_Think(entity this)
                this.cnt = fopen(this.netname, FILE_WRITE);
                if (this.cnt < 0)
                {
-                       LOG_INFO("Error writing ", this.netname, "\n");
+                       LOG_INFO("Error writing ", this.netname);
                        delete(this);
                        radarmapper = NULL;
                        return;
                }
-               LOG_INFO("Writing to ", this.netname, "...\n");
+               LOG_INFO("Writing to ", this.netname, "...");
                fputs(this.cnt, "/* XPM */\n");
                fputs(this.cnt, "static char *RadarMap[] = {\n");
                fputs(this.cnt, "/* columns rows colors chars-per-pixel */\n");
@@ -328,7 +328,7 @@ void RadarMap_Think(entity this)
                        else
                        {
                                fputs(this.cnt, "\",\n");
-                               LOG_INFO(ftos(this.size.y - this.frame), " lines left\n");
+                               LOG_INFO(ftos(this.size.y - this.frame), " lines left");
                        }
                }
 
@@ -350,7 +350,7 @@ void RadarMap_Think(entity this)
                        else
                        {
                                fputs(this.cnt, "\",\n");
-                               LOG_INFO(ftos(this.size.y - this.frame), " lines left\n");
+                               LOG_INFO(ftos(this.size.y - this.frame), " lines left");
                        }
                }
 
@@ -362,7 +362,7 @@ void RadarMap_Think(entity this)
                // close the file
                fputs(this.cnt, "};\n");
                fclose(this.cnt);
-               LOG_INFO("Finished. Please edit data/", this.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
+               LOG_INFO("Finished. Please edit data/", this.netname, " with an image editing application and place it in the TGA format in the gfx folder.");
                RadarMap_Next();
        }
 }
@@ -448,7 +448,7 @@ bool RadarMap_Make(float argc)
 
                if (radarmapper)  // after doing the arguments, see if we successfully went forward.
                {
-                       LOG_INFO("Radarmap entity spawned.\n");
+                       LOG_INFO("Radarmap entity spawned.");
                        return true;  // if so, don't print usage.
                }
        }
index 520884b32b5239e703b6121b4b79c312077f0b66..ffa82e5c02e09131efb74f5fd150fba0b4e601ec 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 #ifndef RADARMAP
-bool RadarMap_Make(float argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it.\n"); return true; }
+bool RadarMap_Make(float argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it."); return true; }
 #else
 
 // ===========================================
index 49bee362e7481fdc8deb171de0c440ed88f4a2f5..2bb0f1365c3b71aa353be44d6bc7522438344293 100644 (file)
@@ -43,7 +43,7 @@ void make_mapinfo_Think(entity this)
 {
        if (_MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 1))
        {
-               LOG_INFO("Done rebuiling mapinfos.\n");
+               LOG_INFO("Done rebuiling mapinfos.");
                MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
                delete(this);
        }
@@ -125,7 +125,7 @@ void GameCommand_adminmsg(float request, float argc)
 
                                        if (accepted <= 0)
                                        {
-                                               LOG_INFO("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+                                               LOG_INFO("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : "."));
                                                continue;
                                        }
 
@@ -146,22 +146,22 @@ void GameCommand_adminmsg(float request, float argc)
                                }
 
                                if (successful) bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
-                               else LOG_INFO("No players given (", original_targets, ") could receive the message.\n");
+                               else LOG_INFO("No players given (", original_targets, ") could receive the message.");
 
                                return;
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2adminmsg^7\n");
+                       LOG_INFO("Incorrect parameters for ^2adminmsg^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd adminmsg clients \"message\" [infobartime]\n");
-                       LOG_INFO("  'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
-                       LOG_INFO("  If infobartime is provided, the message will be sent to infobar.\n");
-                       LOG_INFO("  Otherwise, it will just be sent as a centerprint message.\n");
-                       LOG_INFO("Examples: adminmsg 2,4 \"this infomessage will last for ten seconds\" 10\n");
-                       LOG_INFO("          adminmsg 2,5 \"this message will be a centerprint\"\n");
+                       LOG_INFO("Usage:^3 sv_cmd adminmsg clients \"message\" [infobartime]");
+                       LOG_INFO("  'clients' is a list (separated by commas) of player entity ID's or nicknames");
+                       LOG_INFO("  If infobartime is provided, the message will be sent to infobar.");
+                       LOG_INFO("  Otherwise, it will just be sent as a centerprint message.");
+                       LOG_INFO("Examples: adminmsg 2,4 \"this infomessage will last for ten seconds\" 10");
+                       LOG_INFO("          adminmsg 2,5 \"this message will be a centerprint\"");
                        return;
                }
        }
@@ -180,8 +180,8 @@ void GameCommand_allready(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd allready\n");
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 sv_cmd allready");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
@@ -201,16 +201,16 @@ void GameCommand_allspec(float request, float argc)
                                ++n;
                        });
                        if (n)   bprint(strcat("Successfully forced all (", ftos(n), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n"));
-                       else   LOG_INFO("No players found to spectate.\n");
+                       else   LOG_INFO("No players found to spectate.");
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd allspec [reason]\n");
-                       LOG_INFO("  Where 'reason' is an optional argument for explanation of allspec command.\n");
-                       LOG_INFO("See also: ^2moveplayer, shuffleteams^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd allspec [reason]");
+                       LOG_INFO("  Where 'reason' is an optional argument for explanation of allspec command.");
+                       LOG_INFO("See also: ^2moveplayer, shuffleteams^7");
                        return;
                }
        }
@@ -232,16 +232,16 @@ void GameCommand_anticheat(float request, float argc)
                        }
                        else
                        {
-                               LOG_INFO("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
+                               LOG_INFO("anticheat: ", GetClientErrorString(accepted, argv(1)), ".");
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2anticheat^7\n");
+                       LOG_INFO("Incorrect parameters for ^2anticheat^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd anticheat client\n");
-                       LOG_INFO("  'client' is the entity number or name of the player.\n");
+                       LOG_INFO("Usage:^3 sv_cmd anticheat client");
+                       LOG_INFO("  'client' is the entity number or name of the player.");
                        return;
                }
        }
@@ -303,18 +303,18 @@ void GameCommand_bbox(float request)
                                NULL);
                        size_max.z = (trace_startsolid) ? world.absmax.z : trace_endpos.z;
 
-                       LOG_INFOF("Original size: %v %v\n", world.absmin, world.absmax);
-                       LOG_INFOF("Currently set size: %v %v\n", world.mins, world.maxs);
-                       LOG_INFOF("Solid bounding box size: %v %v\n", size_min, size_max);
+                       LOG_INFOF("Original size: %v %v", world.absmin, world.absmax);
+                       LOG_INFOF("Currently set size: %v %v", world.mins, world.maxs);
+                       LOG_INFOF("Solid bounding box size: %v %v", size_min, size_max);
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd bbox\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2gettaginfo, trace^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd bbox");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2gettaginfo, trace^7");
                        return;
                }
        }
@@ -340,7 +340,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                cvar_settemp("bot_number", "0");
                                bot_fixcount();
                                cvar_settemp("bot_number", argv(2));
-                               if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count\n");
+                               if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count");
                                return;
                        }
                        else if (argv(1) == "load" && argc == 3)
@@ -350,7 +350,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                fh = fopen(argv(2), FILE_READ);
                                if (fh < 0)
                                {
-                                       LOG_INFO("cannot open the file\n");
+                                       LOG_INFO("cannot open the file");
                                        return;
                                }
 
@@ -372,7 +372,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                                        cvar_settemp("bot_number", "0");
                                                        bot_fixcount();
                                                        cvar_settemp("bot_number", argv(3));
-                                                       if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count\n");
+                                                       if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count");
                                                }
                                                else
                                                {
@@ -395,7 +395,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
 
                                        ++i;
                                }
-                               LOG_INFO(ftos(i), " commands read\n");
+                               LOG_INFO(ftos(i), " commands read");
                                fclose(fh);
                                return;
                        }
@@ -415,7 +415,7 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                                bot_num++;
                                        });
                                        if(bot_num)
-                                               LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to all bots (", ftos(bot_num), ")\n"));
+                                               LOG_INFO("Command '", substring(command, argv_start_index(2), -1), "' sent to all bots (", ftos(bot_num), ")");
                                        return;
                                }
                                else
@@ -424,29 +424,29 @@ void GameCommand_bot_cmd(float request, float argc, string command)
                                        if (bot == NULL) bot = find_bot_by_name(argv(1));
                                        if (bot)
                                        {
-                                               LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
+                                               LOG_INFO("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname);
                                                bot_queuecommand(bot, substring(command, argv_start_index(2), -1));
                                                return;
                                        }
                                        else
                                        {
-                                               LOG_INFO(strcat("Error: Can't find bot with the name or id '", argv(1), "' - Did you mistype the command?\n"));  // don't return so that usage is shown
+                                               LOG_INFO("Error: Can't find bot with the name or id '", argv(1), "' - Did you mistype the command?");  // don't return so that usage is shown
                                        }
                                }
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2bot_cmd^7\n");
+                       LOG_INFO("Incorrect parameters for ^2bot_cmd^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd bot_cmd client command [argument]\n");
-                       LOG_INFO("  'client' can be either the name of the bot or a progressive number (not the entity number!)\n");
-                       LOG_INFO("           can also be '*' or 'all' to allow sending the command to all the bots\n");
-                       LOG_INFO("  For full list of commands, see bot_cmd help [command].\n");
-                       LOG_INFO("Examples: sv_cmd bot_cmd 1 cc \"say something\"\n");
-                       LOG_INFO("          sv_cmd bot_cmd 1 presskey jump\n");
-                       LOG_INFO("          sv_cmd bot_cmd * pause\n");
+                       LOG_INFO("Usage:^3 sv_cmd bot_cmd client command [argument]");
+                       LOG_INFO("  'client' can be either the name of the bot or a progressive number (not the entity number!)");
+                       LOG_INFO("           can also be '*' or 'all' to allow sending the command to all the bots");
+                       LOG_INFO("  For full list of commands, see bot_cmd help [command].");
+                       LOG_INFO("Examples: sv_cmd bot_cmd 1 cc \"say something\"");
+                       LOG_INFO("          sv_cmd bot_cmd 1 presskey jump");
+                       LOG_INFO("          sv_cmd bot_cmd * pause");
                        return;
                }
        }
@@ -469,8 +469,8 @@ void GameCommand_cointoss(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd cointoss [result1 result2]\n");
-                       LOG_INFO("  Where 'result1' and 'result2' are user created options.\n");
+                       LOG_INFO("Usage:^3 sv_cmd cointoss [result1 result2]");
+                       LOG_INFO("  Where 'result1' and 'result2' are user created options.");
                        return;
                }
        }
@@ -487,33 +487,33 @@ void GameCommand_database(float request, float argc)
                                if (argv(1) == "save")
                                {
                                        db_save(ServerProgsDB, argv(2));
-                                       LOG_INFO(strcat("Copied serverprogs database to '", argv(2), "' in the data directory.\n"));
+                                       LOG_INFO("Copied serverprogs database to '", argv(2), "' in the data directory.");
                                        return;
                                }
                                else if (argv(1) == "dump")
                                {
                                        db_dump(ServerProgsDB, argv(2));
-                                       LOG_INFO("DB dumped.\n");  // wtf does this do?
+                                       LOG_INFO("DB dumped.");  // wtf does this do?
                                        return;
                                }
                                else if (argv(1) == "load")
                                {
                                        db_close(ServerProgsDB);
                                        ServerProgsDB = db_load(argv(2));
-                                       LOG_INFO(strcat("Loaded '", argv(2), "' as new serverprogs database.\n"));
+                                       LOG_INFO("Loaded '", argv(2), "' as new serverprogs database.");
                                        return;
                                }
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2database^7\n");
+                       LOG_INFO("Incorrect parameters for ^2database^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd database action filename\n");
-                       LOG_INFO("  Where 'action' is the command to complete,\n");
-                       LOG_INFO("  and 'filename' is what it acts upon.\n");
-                       LOG_INFO("  Full list of commands here: \"save, dump, load.\"\n");
+                       LOG_INFO("Usage:^3 sv_cmd database action filename");
+                       LOG_INFO("  Where 'action' is the command to complete,");
+                       LOG_INFO("  and 'filename' is what it acts upon.");
+                       LOG_INFO("  Full list of commands here: \"save, dump, load.\"");
                        return;
                }
        }
@@ -536,21 +536,21 @@ void GameCommand_defer_clear(float request, float argc)
                                if (accepted > 0)
                                {
                                        stuffcmd(client, "defer clear\n");
-                                       LOG_INFO("defer clear stuffed to ", playername(client, false), "\n");
+                                       LOG_INFO("defer clear stuffed to ", playername(client, false));
                                }
-                               else { LOG_INFO("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
+                               else { LOG_INFO("defer_clear: ", GetClientErrorString(accepted, argv(1)), "."); }
 
                                return;
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2defer_clear^7\n");
+                       LOG_INFO("Incorrect parameters for ^2defer_clear^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd defer_clear client\n");
-                       LOG_INFO("  'client' is the entity number or name of the player.\n");
-                       LOG_INFO("See also: ^2defer_clear_all^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd defer_clear client");
+                       LOG_INFO("  'client' is the entity number or name of the player.");
+                       LOG_INFO("See also: ^2defer_clear_all^7");
                        return;
                }
        }
@@ -570,16 +570,16 @@ void GameCommand_defer_clear_all(float request)
                                GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
                                ++n;
                        });
-                       if (n)   LOG_INFO(strcat("Successfully stuffed defer clear to all clients (", ftos(n), ")\n"));  // should a message be added if no players were found?
+                       if (n)   LOG_INFO("Successfully stuffed defer clear to all clients (", ftos(n), ")");  // should a message be added if no players were found?
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd defer_clear_all\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2defer_clear^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd defer_clear_all");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2defer_clear^7");
                        return;
                }
        }
@@ -600,13 +600,13 @@ void GameCommand_delrec(float request, float argc)  // perhaps merge later with
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2delrec^7\n");
+                       LOG_INFO("Incorrect parameters for ^2delrec^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd delrec ranking [map]\n");
-                       LOG_INFO("  'ranking' is which ranking level to clear up to, \n");
-                       LOG_INFO("  it will clear all records up to nth place.\n");
-                       LOG_INFO("  if 'map' is not provided it will use current map.\n");
+                       LOG_INFO("Usage:^3 sv_cmd delrec ranking [map]");
+                       LOG_INFO("  'ranking' is which ranking level to clear up to, ");
+                       LOG_INFO("  it will clear all records up to nth place.");
+                       LOG_INFO("  if 'map' is not provided it will use current map.");
                        return;
                }
        }
@@ -622,79 +622,79 @@ void GameCommand_effectindexdump(float request)
                        string s;
 
                        d = db_create();
-                       LOG_INFO("begin of effects list\n");
+                       LOG_INFO("begin of effects list");
                        db_put(d, "TE_GUNSHOT", "1");
-                       LOG_INFO("effect TE_GUNSHOT is ", ftos(_particleeffectnum("TE_GUNSHOT")), "\n");
+                       LOG_INFO("effect TE_GUNSHOT is ", ftos(_particleeffectnum("TE_GUNSHOT")));
                        db_put(d, "TE_GUNSHOTQUAD", "1");
-                       LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(_particleeffectnum("TE_GUNSHOTQUAD")), "\n");
+                       LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(_particleeffectnum("TE_GUNSHOTQUAD")));
                        db_put(d, "TE_SPIKE", "1");
-                       LOG_INFO("effect TE_SPIKE is ", ftos(_particleeffectnum("TE_SPIKE")), "\n");
+                       LOG_INFO("effect TE_SPIKE is ", ftos(_particleeffectnum("TE_SPIKE")));
                        db_put(d, "TE_SPIKEQUAD", "1");
-                       LOG_INFO("effect TE_SPIKEQUAD is ", ftos(_particleeffectnum("TE_SPIKEQUAD")), "\n");
+                       LOG_INFO("effect TE_SPIKEQUAD is ", ftos(_particleeffectnum("TE_SPIKEQUAD")));
                        db_put(d, "TE_SUPERSPIKE", "1");
-                       LOG_INFO("effect TE_SUPERSPIKE is ", ftos(_particleeffectnum("TE_SUPERSPIKE")), "\n");
+                       LOG_INFO("effect TE_SUPERSPIKE is ", ftos(_particleeffectnum("TE_SUPERSPIKE")));
                        db_put(d, "TE_SUPERSPIKEQUAD", "1");
-                       LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(_particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
+                       LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(_particleeffectnum("TE_SUPERSPIKEQUAD")));
                        db_put(d, "TE_WIZSPIKE", "1");
-                       LOG_INFO("effect TE_WIZSPIKE is ", ftos(_particleeffectnum("TE_WIZSPIKE")), "\n");
+                       LOG_INFO("effect TE_WIZSPIKE is ", ftos(_particleeffectnum("TE_WIZSPIKE")));
                        db_put(d, "TE_KNIGHTSPIKE", "1");
-                       LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(_particleeffectnum("TE_KNIGHTSPIKE")), "\n");
+                       LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(_particleeffectnum("TE_KNIGHTSPIKE")));
                        db_put(d, "TE_EXPLOSION", "1");
-                       LOG_INFO("effect TE_EXPLOSION is ", ftos(_particleeffectnum("TE_EXPLOSION")), "\n");
+                       LOG_INFO("effect TE_EXPLOSION is ", ftos(_particleeffectnum("TE_EXPLOSION")));
                        db_put(d, "TE_EXPLOSIONQUAD", "1");
-                       LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(_particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
+                       LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(_particleeffectnum("TE_EXPLOSIONQUAD")));
                        db_put(d, "TE_TAREXPLOSION", "1");
-                       LOG_INFO("effect TE_TAREXPLOSION is ", ftos(_particleeffectnum("TE_TAREXPLOSION")), "\n");
+                       LOG_INFO("effect TE_TAREXPLOSION is ", ftos(_particleeffectnum("TE_TAREXPLOSION")));
                        db_put(d, "TE_TELEPORT", "1");
-                       LOG_INFO("effect TE_TELEPORT is ", ftos(_particleeffectnum("TE_TELEPORT")), "\n");
+                       LOG_INFO("effect TE_TELEPORT is ", ftos(_particleeffectnum("TE_TELEPORT")));
                        db_put(d, "TE_LAVASPLASH", "1");
-                       LOG_INFO("effect TE_LAVASPLASH is ", ftos(_particleeffectnum("TE_LAVASPLASH")), "\n");
+                       LOG_INFO("effect TE_LAVASPLASH is ", ftos(_particleeffectnum("TE_LAVASPLASH")));
                        db_put(d, "TE_SMALLFLASH", "1");
-                       LOG_INFO("effect TE_SMALLFLASH is ", ftos(_particleeffectnum("TE_SMALLFLASH")), "\n");
+                       LOG_INFO("effect TE_SMALLFLASH is ", ftos(_particleeffectnum("TE_SMALLFLASH")));
                        db_put(d, "TE_FLAMEJET", "1");
-                       LOG_INFO("effect TE_FLAMEJET is ", ftos(_particleeffectnum("TE_FLAMEJET")), "\n");
+                       LOG_INFO("effect TE_FLAMEJET is ", ftos(_particleeffectnum("TE_FLAMEJET")));
                        db_put(d, "EF_FLAME", "1");
-                       LOG_INFO("effect EF_FLAME is ", ftos(_particleeffectnum("EF_FLAME")), "\n");
+                       LOG_INFO("effect EF_FLAME is ", ftos(_particleeffectnum("EF_FLAME")));
                        db_put(d, "TE_BLOOD", "1");
-                       LOG_INFO("effect TE_BLOOD is ", ftos(_particleeffectnum("TE_BLOOD")), "\n");
+                       LOG_INFO("effect TE_BLOOD is ", ftos(_particleeffectnum("TE_BLOOD")));
                        db_put(d, "TE_SPARK", "1");
-                       LOG_INFO("effect TE_SPARK is ", ftos(_particleeffectnum("TE_SPARK")), "\n");
+                       LOG_INFO("effect TE_SPARK is ", ftos(_particleeffectnum("TE_SPARK")));
                        db_put(d, "TE_PLASMABURN", "1");
-                       LOG_INFO("effect TE_PLASMABURN is ", ftos(_particleeffectnum("TE_PLASMABURN")), "\n");
+                       LOG_INFO("effect TE_PLASMABURN is ", ftos(_particleeffectnum("TE_PLASMABURN")));
                        db_put(d, "TE_TEI_G3", "1");
-                       LOG_INFO("effect TE_TEI_G3 is ", ftos(_particleeffectnum("TE_TEI_G3")), "\n");
+                       LOG_INFO("effect TE_TEI_G3 is ", ftos(_particleeffectnum("TE_TEI_G3")));
                        db_put(d, "TE_TEI_SMOKE", "1");
-                       LOG_INFO("effect TE_TEI_SMOKE is ", ftos(_particleeffectnum("TE_TEI_SMOKE")), "\n");
+                       LOG_INFO("effect TE_TEI_SMOKE is ", ftos(_particleeffectnum("TE_TEI_SMOKE")));
                        db_put(d, "TE_TEI_BIGEXPLOSION", "1");
-                       LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(_particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
+                       LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(_particleeffectnum("TE_TEI_BIGEXPLOSION")));
                        db_put(d, "TE_TEI_PLASMAHIT", "1");
-                       LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(_particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
+                       LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(_particleeffectnum("TE_TEI_PLASMAHIT")));
                        db_put(d, "EF_STARDUST", "1");
-                       LOG_INFO("effect EF_STARDUST is ", ftos(_particleeffectnum("EF_STARDUST")), "\n");
+                       LOG_INFO("effect EF_STARDUST is ", ftos(_particleeffectnum("EF_STARDUST")));
                        db_put(d, "TR_ROCKET", "1");
-                       LOG_INFO("effect TR_ROCKET is ", ftos(_particleeffectnum("TR_ROCKET")), "\n");
+                       LOG_INFO("effect TR_ROCKET is ", ftos(_particleeffectnum("TR_ROCKET")));
                        db_put(d, "TR_GRENADE", "1");
-                       LOG_INFO("effect TR_GRENADE is ", ftos(_particleeffectnum("TR_GRENADE")), "\n");
+                       LOG_INFO("effect TR_GRENADE is ", ftos(_particleeffectnum("TR_GRENADE")));
                        db_put(d, "TR_BLOOD", "1");
-                       LOG_INFO("effect TR_BLOOD is ", ftos(_particleeffectnum("TR_BLOOD")), "\n");
+                       LOG_INFO("effect TR_BLOOD is ", ftos(_particleeffectnum("TR_BLOOD")));
                        db_put(d, "TR_WIZSPIKE", "1");
-                       LOG_INFO("effect TR_WIZSPIKE is ", ftos(_particleeffectnum("TR_WIZSPIKE")), "\n");
+                       LOG_INFO("effect TR_WIZSPIKE is ", ftos(_particleeffectnum("TR_WIZSPIKE")));
                        db_put(d, "TR_SLIGHTBLOOD", "1");
-                       LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(_particleeffectnum("TR_SLIGHTBLOOD")), "\n");
+                       LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(_particleeffectnum("TR_SLIGHTBLOOD")));
                        db_put(d, "TR_KNIGHTSPIKE", "1");
-                       LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(_particleeffectnum("TR_KNIGHTSPIKE")), "\n");
+                       LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(_particleeffectnum("TR_KNIGHTSPIKE")));
                        db_put(d, "TR_VORESPIKE", "1");
-                       LOG_INFO("effect TR_VORESPIKE is ", ftos(_particleeffectnum("TR_VORESPIKE")), "\n");
+                       LOG_INFO("effect TR_VORESPIKE is ", ftos(_particleeffectnum("TR_VORESPIKE")));
                        db_put(d, "TR_NEHAHRASMOKE", "1");
-                       LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(_particleeffectnum("TR_NEHAHRASMOKE")), "\n");
+                       LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(_particleeffectnum("TR_NEHAHRASMOKE")));
                        db_put(d, "TR_NEXUIZPLASMA", "1");
-                       LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(_particleeffectnum("TR_NEXUIZPLASMA")), "\n");
+                       LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(_particleeffectnum("TR_NEXUIZPLASMA")));
                        db_put(d, "TR_GLOWTRAIL", "1");
-                       LOG_INFO("effect TR_GLOWTRAIL is ", ftos(_particleeffectnum("TR_GLOWTRAIL")), "\n");
+                       LOG_INFO("effect TR_GLOWTRAIL is ", ftos(_particleeffectnum("TR_GLOWTRAIL")));
                        db_put(d, "TR_SEEKER", "1");
-                       LOG_INFO("effect TR_SEEKER is ", ftos(_particleeffectnum("TR_SEEKER")), "\n");
+                       LOG_INFO("effect TR_SEEKER is ", ftos(_particleeffectnum("TR_SEEKER")));
                        db_put(d, "SVC_PARTICLE", "1");
-                       LOG_INFO("effect SVC_PARTICLE is ", ftos(_particleeffectnum("SVC_PARTICLE")), "\n");
+                       LOG_INFO("effect SVC_PARTICLE is ", ftos(_particleeffectnum("SVC_PARTICLE")));
 
                        fh = fopen("effectinfo.txt", FILE_READ);
                        while ((s = fgets(fh)))
@@ -705,12 +705,12 @@ void GameCommand_effectindexdump(float request)
                                        if (db_get(d, argv(1)) != "1")
                                        {
                                                int i = _particleeffectnum(argv(1));
-                                               if (i >= 0) LOG_INFO("effect ", argv(1), " is ", ftos(i), "\n");
+                                               if (i >= 0) LOG_INFO("effect ", argv(1), " is ", ftos(i));
                                                db_put(d, argv(1), "1");
                                        }
                                }
                        }
-                       LOG_INFO("end of effects list\n");
+                       LOG_INFO("end of effects list");
 
                        db_close(d);
                        return;
@@ -719,8 +719,8 @@ void GameCommand_effectindexdump(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd effectindexdump\n");
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 sv_cmd effectindexdump");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
@@ -739,9 +739,9 @@ void GameCommand_extendmatchtime(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd extendmatchtime\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2reducematchtime^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd extendmatchtime");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2reducematchtime^7");
                        return;
                }
        }
@@ -786,12 +786,12 @@ void GameCommand_gametype(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2gametype^7\n");
+                       LOG_INFO("Incorrect parameters for ^2gametype^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gametype mode\n");
-                       LOG_INFO("  Where 'mode' is the gametype mode to switch to.\n");
-                       LOG_INFO("See also: ^2gotomap^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd gametype mode");
+                       LOG_INFO("  Where 'mode' is the gametype mode to switch to.");
+                       LOG_INFO("See also: ^2gotomap^7");
                        return;
                }
        }
@@ -826,13 +826,15 @@ void GameCommand_gettaginfo(float request, float argc)
                                if (i)
                                {
                                        v = gettaginfo(tmp_entity, i);
-                                       LOG_INFO("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
-                                       LOG_INFO(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
-                                       LOG_INFO(" vector = ", ftos(v.x), " ", ftos(v.y), " ", ftos(v.z), "\n");
-                                       LOG_INFO(" offset = ", ftos(gettaginfo_offset.x), " ", ftos(gettaginfo_offset.y), " ", ftos(gettaginfo_offset.z), "\n");
-                                       LOG_INFO(" forward = ", ftos(gettaginfo_forward.x), " ", ftos(gettaginfo_forward.y), " ", ftos(gettaginfo_forward.z), "\n");
-                                       LOG_INFO(" right = ", ftos(gettaginfo_right.x), " ", ftos(gettaginfo_right.y), " ", ftos(gettaginfo_right.z), "\n");
-                                       LOG_INFO(" up = ", ftos(gettaginfo_up.x), " ", ftos(gettaginfo_up.y), " ", ftos(gettaginfo_up.z), "\n");
+                                       LOG_INFOF(
+                                           "model %s frame %s tag %s index %s parent %s",
+                                           tmp_entity.model, ftos(tmp_entity.frame), gettaginfo_name, ftos(i), ftos(gettaginfo_parent)
+                                       );
+                                       LOG_INFOF(" vector = %s %s %s", ftos(v.x), ftos(v.y), ftos(v.z));
+                                       LOG_INFOF(" offset = %s %s %s", ftos(gettaginfo_offset.x), ftos(gettaginfo_offset.y), ftos(gettaginfo_offset.z));
+                                       LOG_INFOF(" forward = %s %s %s", ftos(gettaginfo_forward.x), ftos(gettaginfo_forward.y), ftos(gettaginfo_forward.z));
+                                       LOG_INFOF(" right = %s %s %s", ftos(gettaginfo_right.x), ftos(gettaginfo_right.y), ftos(gettaginfo_right.z));
+                                       LOG_INFOF(" up = %s %s %s", ftos(gettaginfo_up.x), ftos(gettaginfo_up.y), ftos(gettaginfo_up.z));
                                        if (argc >= 6)
                                        {
                                                v.y = -v.y;
@@ -841,7 +843,7 @@ void GameCommand_gettaginfo(float request, float argc)
                                }
                                else
                                {
-                                       LOG_INFO("bone not found\n");
+                                       LOG_INFO("bone not found");
                                }
 
                                delete(tmp_entity);
@@ -850,11 +852,11 @@ void GameCommand_gettaginfo(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
+                       LOG_INFO("Incorrect parameters for ^2gettaginfo^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
-                       LOG_INFO("See also: ^2bbox, trace^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd gettaginfo model frame index [command one] [command two]");
+                       LOG_INFO("See also: ^2bbox, trace^7");
                        return;
                }
        }
@@ -900,8 +902,8 @@ void GameCommand_animbench(float request, float argc)
                                        t2 += gettime(GETTIME_HIRES) - t0;
                                        n += 1;
                                }
-                               LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s\n");
-                               LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s\n");
+                               LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s");
+                               LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s");
 
                                delete(tmp_entity);
                                return;
@@ -909,11 +911,11 @@ void GameCommand_animbench(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
+                       LOG_INFO("Incorrect parameters for ^2gettaginfo^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
-                       LOG_INFO("See also: ^2bbox, trace^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd gettaginfo model frame index [command one] [command two]");
+                       LOG_INFO("See also: ^2bbox, trace^7");
                        return;
                }
        }
@@ -927,18 +929,18 @@ void GameCommand_gotomap(float request, float argc)
                {
                        if (argv(1))
                        {
-                               LOG_INFO(GotoMap(argv(1)), "\n");
+                               LOG_INFO(GotoMap(argv(1)));
                                return;
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2gotomap^7\n");
+                       LOG_INFO("Incorrect parameters for ^2gotomap^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd gotomap map\n");
-                       LOG_INFO("  Where 'map' is the *.bsp file to change to.\n");
-                       LOG_INFO("See also: ^2gametype^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd gotomap map");
+                       LOG_INFO("  Where 'map' is the *.bsp file to change to.");
+                       LOG_INFO("See also: ^2gametype^7");
                        return;
                }
        }
@@ -965,9 +967,9 @@ void GameCommand_lockteams(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd lockteams\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2unlockteams^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd lockteams");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2unlockteams^7");
                        return;
                }
        }
@@ -991,9 +993,9 @@ void GameCommand_make_mapinfo(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd make_mapinfo\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2radarmap^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd make_mapinfo");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2radarmap^7");
                        return;
                }
        }
@@ -1029,7 +1031,7 @@ void GameCommand_moveplayer(float request, float argc)
 
                                        if (accepted <= 0)
                                        {
-                                               LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+                                               LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : "."));
                                                continue;
                                        }
 
@@ -1045,7 +1047,7 @@ void GameCommand_moveplayer(float request, float argc)
                                                }
                                                else
                                                {
-                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already spectating.\n");
+                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already spectating.");
                                                }
                                                continue;
                                        }
@@ -1065,7 +1067,7 @@ void GameCommand_moveplayer(float request, float argc)
                                                                if (team_id == client.team)  // already on the destination team
                                                                {
                                                                        // keep the forcing undone
-                                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
+                                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7."));
                                                                        continue;
                                                                }
                                                                else if (team_id == 0)  // auto team
@@ -1082,12 +1084,12 @@ void GameCommand_moveplayer(float request, float argc)
                                                                // Check to see if the destination team is even available
                                                                switch (team_id)
                                                                {
-                                                                       case NUM_TEAM_1: if (c1 == -1) { LOG_INFO("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
-                                                                       case NUM_TEAM_2: if (c2 == -1) { LOG_INFO("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
-                                                                       case NUM_TEAM_3: if (c3 == -1) { LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
-                                                                       case NUM_TEAM_4: if (c4 == -1) { LOG_INFO("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
+                                                                       case NUM_TEAM_1: if (c1 == -1) { LOG_INFO("Sorry, can't move player to red team if it doesn't exist."); return; } break;
+                                                                       case NUM_TEAM_2: if (c2 == -1) { LOG_INFO("Sorry, can't move player to blue team if it doesn't exist."); return; } break;
+                                                                       case NUM_TEAM_3: if (c3 == -1) { LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist."); return; } break;
+                                                                       case NUM_TEAM_4: if (c4 == -1) { LOG_INFO("Sorry, can't move player to pink team if it doesn't exist."); return; } break;
 
-                                                                       default: LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.\n");
+                                                                       default: LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.");
                                                                                return;
                                                                }
 
@@ -1095,41 +1097,41 @@ void GameCommand_moveplayer(float request, float argc)
                                                                client.team_forced = 0;
                                                                MoveToTeam(client, team_id, 6);
                                                                successful = strcat(successful, (successful ? ", " : ""), playername(client, false));
-                                                               LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
+                                                               LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") has been moved to the ", Team_ColoredFullName(team_id), "^7.");
                                                                continue;
                                                        }
                                                        else
                                                        {
-                                                               LOG_INFO("Can't change teams when currently not playing a team game.\n");
+                                                               LOG_INFO("Can't change teams when currently not playing a team game.");
                                                                return;
                                                        }
                                                }
                                                else
                                                {
-                                                       LOG_INFO("Can't change teams if the player isn't in the game.\n");  // well technically we could, but should we allow that? :P
+                                                       LOG_INFO("Can't change teams if the player isn't in the game.");  // well technically we could, but should we allow that? :P
                                                        return;
                                                }
                                        }
                                }
 
                                if (successful) bprint("Successfully moved players ", successful, " to destination ", destination, ".\n");
-                               else LOG_INFO("No players given (", original_targets, ") are able to move.\n");
+                               else LOG_INFO("No players given (", original_targets, ") are able to move.");
 
                                return;  // still correct parameters so return to avoid usage print
                        }
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2moveplayer^7\n");
+                       LOG_INFO("Incorrect parameters for ^2moveplayer^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd moveplayer clients destination\n");
-                       LOG_INFO("  'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
-                       LOG_INFO("  'destination' is what to send the player to, be it team or spectating\n");
-                       LOG_INFO("  Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
-                       LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red 3\n");
-                       LOG_INFO("          sv_cmd moveplayer 2 spec \n");
-                       LOG_INFO("See also: ^2allspec, shuffleteams^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd moveplayer clients destination");
+                       LOG_INFO("  'clients' is a list (separated by commas) of player entity ID's or nicknames");
+                       LOG_INFO("  'destination' is what to send the player to, be it team or spectating");
+                       LOG_INFO("  Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"");
+                       LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red 3");
+                       LOG_INFO("          sv_cmd moveplayer 2 spec ");
+                       LOG_INFO("See also: ^2allspec, shuffleteams^7");
                        return;
                }
        }
@@ -1157,8 +1159,8 @@ void GameCommand_nospectators(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd nospectators\n");
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 sv_cmd nospectators");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
@@ -1184,7 +1186,7 @@ void GameCommand_playerdemo(float request, float argc)
 
                                                if (accepted <= 0)
                                                {
-                                                       LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
+                                                       LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".");
                                                        return;
                                                }
 
@@ -1199,7 +1201,7 @@ void GameCommand_playerdemo(float request, float argc)
 
                                                if (accepted <= 0)
                                                {
-                                                       LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
+                                                       LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".");
                                                        return;
                                                }
 
@@ -1234,11 +1236,11 @@ void GameCommand_playerdemo(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2playerdemo^7\n");
+                       LOG_INFO("Incorrect parameters for ^2playerdemo^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)\n");
-                       LOG_INFO("  Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"\n");
+                       LOG_INFO("Usage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)");
+                       LOG_INFO("  Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"");
                        return;
                }
        }
@@ -1251,15 +1253,15 @@ void GameCommand_printstats(float request)
                case CMD_REQUEST_COMMAND:
                {
                        DumpStats(false);
-                       LOG_INFO("stats dumped.\n");
+                       LOG_INFO("stats dumped.");
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd printstats\n");
-                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("Usage:^3 sv_cmd printstats");
+                       LOG_INFO("  No arguments required.");
                        return;
                }
        }
@@ -1275,13 +1277,13 @@ void GameCommand_radarmap(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2radarmap^7\n");
+                       LOG_INFO("Incorrect parameters for ^2radarmap^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]\n");
-                       LOG_INFO("  The quality factor Q is roughly proportional to the time taken.\n");
-                       LOG_INFO("  trace supports no quality factor; its result should look like --block with infinite quality factor.\n");
-                       LOG_INFO("See also: ^2make_mapinfo^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]");
+                       LOG_INFO("  The quality factor Q is roughly proportional to the time taken.");
+                       LOG_INFO("  trace supports no quality factor; its result should look like --block with infinite quality factor.");
+                       LOG_INFO("See also: ^2make_mapinfo^7");
                        return;
                }
        }
@@ -1300,9 +1302,9 @@ void GameCommand_reducematchtime(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd reducematchtime\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2extendmatchtime^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd reducematchtime");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2extendmatchtime^7");
                        return;
                }
        }
@@ -1324,12 +1326,12 @@ void GameCommand_setbots(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2setbots^7\n");
+                       LOG_INFO("Incorrect parameters for ^2setbots^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd setbots botnumber\n");
-                       LOG_INFO("  Where 'botnumber' is the amount of bots to set bot_number cvar to.\n");
-                       LOG_INFO("See also: ^2bot_cmd^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd setbots botnumber");
+                       LOG_INFO("  Where 'botnumber' is the amount of bots to set bot_number cvar to.");
+                       LOG_INFO("See also: ^2bot_cmd^7");
                        return;
                }
        }
@@ -1343,7 +1345,7 @@ void GameCommand_shuffleteams(float request)
                {
                        if (!teamplay)
                        {
-                               LOG_INFO("Can't shuffle teams when currently not playing a team game.\n");
+                               LOG_INFO("Can't shuffle teams when currently not playing a team game.");
                                return;
                        }
 
@@ -1352,7 +1354,7 @@ void GameCommand_shuffleteams(float request)
                                        // we could theoretically assign forced players to their teams
                                        // and shuffle the rest to fill the empty spots but in practise
                                        // either all players or none are gonna have forced teams
-                                       LOG_INFO("Can't shuffle teams because at least one player has a forced team.\n");
+                                       LOG_INFO("Can't shuffle teams because at least one player has a forced team.");
                                        return;
                                }
                        });
@@ -1378,9 +1380,9 @@ void GameCommand_shuffleteams(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd shuffleteams\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2moveplayer, allspec^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd shuffleteams");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2moveplayer, allspec^7");
                        return;
                }
        }
@@ -1405,11 +1407,11 @@ void GameCommand_stuffto(float request, float argc)
                                        if (accepted > 0)
                                        {
                                                stuffcmd(client, strcat("\n", argv(next_token), "\n"));
-                                               LOG_INFO(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1), ").\n"));
+                                               LOG_INFO("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1), ").");
                                        }
                                        else
                                        {
-                                               LOG_INFO("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
+                                               LOG_INFO("stuffto: ", GetClientErrorString(accepted, argv(1)), ".");
                                        }
 
                                        return;
@@ -1417,19 +1419,19 @@ void GameCommand_stuffto(float request, float argc)
                        }
 
                        default:
-                               LOG_INFO("Incorrect parameters for ^2stuffto^7\n");
+                               LOG_INFO("Incorrect parameters for ^2stuffto^7");
                        case CMD_REQUEST_USAGE:
                        {
-                               LOG_INFO("\nUsage:^3 sv_cmd stuffto client \"command\"\n");
-                               LOG_INFO("  'client' is the entity number or name of the player,\n");
-                               LOG_INFO("  and 'command' is the command to be sent to that player.\n");
+                               LOG_INFO("Usage:^3 sv_cmd stuffto client \"command\"");
+                               LOG_INFO("  'client' is the entity number or name of the player,");
+                               LOG_INFO("  and 'command' is the command to be sent to that player.");
                                return;
                        }
                }
 #else
                if (request)
                {
-                       LOG_INFO("stuffto command is not enabled on this server.\n");
+                       LOG_INFO("stuffto command is not enabled on this server.");
                        return;
                }
 #endif
@@ -1450,7 +1452,7 @@ void GameCommand_trace(float request, float argc)
                                case "debug":
                                {
                                        float hitcount = 0;
-                                       LOG_INFO("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
+                                       LOG_INFO("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.");
                                        float worst_endpos_bug = 0;
                                        for ( ; ; )
                                        {
@@ -1497,12 +1499,12 @@ void GameCommand_trace(float request, float argc)
                                                                        }
                                                                }
 
-                                                               LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
-                                                               LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
+                                                               LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu");
+                                                               LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu");
 
                                                                tracebox(p, PL_MIN_CONST + '0.1 0.1 0.1', PL_MAX_CONST - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, NULL);
-                                                               if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
-                                                               else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+                                                               if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p));
+                                                               else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p));
                                                                if (++hitcount >= 10) break;
                                                        }
                                                        else
@@ -1523,8 +1525,8 @@ void GameCommand_trace(float request, float argc)
                                                                if (dq > worst_endpos_bug)
                                                                {
                                                                        worst_endpos_bug = dq;
-                                                                       LOG_INFO("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
-                                                                       LOG_INFO("could go ", ftos(dq), " units further to ", vtos(q), "\n");
+                                                                       LOG_INFO("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p));
+                                                                       LOG_INFO("could go ", ftos(dq), " units further to ", vtos(q));
                                                                        if (++hitcount >= 10) break;
                                                                }
                                                        }
@@ -1540,7 +1542,7 @@ void GameCommand_trace(float request, float argc)
                                        vv = trace_endpos;
                                        if (trace_fraction == 1)
                                        {
-                                               LOG_INFO("not above ground, aborting\n");
+                                               LOG_INFO("not above ground, aborting");
                                                return;
                                        }
                                        f = 0;
@@ -1549,18 +1551,18 @@ void GameCommand_trace(float request, float argc)
                                                dv = randomvec();
                                                if (dv.z > 0) dv = -1 * dv;
                                                tracebox(vv, e.mins, e.maxs, vv + dv, MOVE_NORMAL, e);
-                                               if (trace_startsolid) LOG_INFO("bug 1\n");
+                                               if (trace_startsolid) LOG_INFO("bug 1");
                                                if (trace_fraction == 1)
                                                {
                                                        if (dv.z < f)
                                                        {
                                                                LOG_INFO("bug 2: ", ftos(dv.x), " ", ftos(dv.y), " ", ftos(dv.z));
-                                                               LOG_INFO(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)\n");
+                                                               LOG_INFO(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)");
                                                                f = dv.z;
                                                        }
                                                }
                                        }
-                                       LOG_INFO("highest possible dist: ", ftos(f), "\n");
+                                       LOG_INFO("highest possible dist: ", ftos(f));
                                        return;
                                }
 
@@ -1569,8 +1571,8 @@ void GameCommand_trace(float request, float argc)
                                        if (argc == 4)
                                        {
                                                e = nextent(NULL);
-                                               if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL)) LOG_INFO("can walk\n");
-                                               else LOG_INFO("cannot walk\n");
+                                               if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL)) LOG_INFO("can walk");
+                                               else LOG_INFO("cannot walk");
                                                return;
                                        }
                                }
@@ -1593,12 +1595,12 @@ void GameCommand_trace(float request, float argc)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2trace^7\n");
+                       LOG_INFO("Incorrect parameters for ^2trace^7");
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd trace command (startpos endpos)\n");
-                       LOG_INFO("  Full list of commands here: \"debug, debug2, walk, showline.\"\n");
-                       LOG_INFO("See also: ^2bbox, gettaginfo^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd trace command (startpos endpos)");
+                       LOG_INFO("  Full list of commands here: \"debug, debug2, walk, showline.\"");
+                       LOG_INFO("See also: ^2bbox, gettaginfo^7");
                        return;
                }
        }
@@ -1625,9 +1627,9 @@ void GameCommand_unlockteams(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd unlockteams\n");
-                       LOG_INFO("  No arguments required.\n");
-                       LOG_INFO("See also: ^2lockteams^7\n");
+                       LOG_INFO("Usage:^3 sv_cmd unlockteams");
+                       LOG_INFO("  No arguments required.");
+                       LOG_INFO("See also: ^2lockteams^7");
                        return;
                }
        }
@@ -1644,17 +1646,17 @@ void GameCommand_warp(float request, float argc)
                                if (argc >= 2)
                                {
                                        CampaignLevelWarp(stof(argv(1)));
-                                       LOG_INFO("Successfully warped to campaign level ", argv(1), ".\n");
+                                       LOG_INFO("Successfully warped to campaign level ", argv(1), ".");
                                }
                                else
                                {
                                        CampaignLevelWarp(-1);
-                                       LOG_INFO("Successfully warped to next campaign level.\n");
+                                       LOG_INFO("Successfully warped to next campaign level.");
                                }
                        }
                        else
                        {
-                               LOG_INFO("Not in campaign, can't level warp\n");
+                               LOG_INFO("Not in campaign, can't level warp");
                        }
                        return;
                }
@@ -1662,9 +1664,9 @@ void GameCommand_warp(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("\nUsage:^3 sv_cmd warp [level]\n");
-                       LOG_INFO("  'level' is the level to change campaign mode to.\n");
-                       LOG_INFO("  if 'level' is not provided it will change to the next level.\n");
+                       LOG_INFO("Usage:^3 sv_cmd warp [level]");
+                       LOG_INFO("  'level' is the level to change campaign mode to.");
+                       LOG_INFO("  if 'level' is not provided it will change to the next level.");
                        return;
                }
        }
@@ -1733,7 +1735,7 @@ SERVER_COMMAND(warp, "Choose different level in campaign") { GameCommand_warp(re
 
 void GameCommand_macro_help()
 {
-       FOREACH(SERVER_COMMANDS, true, { LOG_INFOF("  ^2%s^7: %s\n", it.m_name, it.m_description); });
+       FOREACH(SERVER_COMMANDS, true, { LOG_INFOF("  ^2%s^7: %s", it.m_name, it.m_description); });
 }
 
 float GameCommand_macro_command(float argc, string command)
@@ -1780,20 +1782,22 @@ void GameCommand(string command)
        {
                if (argc == 1)
                {
-                       LOG_INFO("\nServer console commands:\n");
+                       LOG_INFO("Server console commands:");
                        GameCommand_macro_help();
 
-                       LOG_INFO("\nBanning commands:\n");
+                       LOG_INFO("\nBanning commands:");
                        BanCommand_macro_help();
 
-                       LOG_INFO("\nCommon networked commands:\n");
+                       LOG_INFO("\nCommon networked commands:");
                        CommonCommand_macro_help(NULL);
 
-                       LOG_INFO("\nGeneric commands shared by all programs:\n");
+                       LOG_INFO("\nGeneric commands shared by all programs:");
                        GenericCommand_macro_help();
 
-                       LOG_INFO("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
-                       LOG_INFO("For help about a specific command, type sv_cmd help COMMAND\n");
+                       LOG_INFO(
+                           "\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n"
+                "For help about a specific command, type sv_cmd help COMMAND"
+            );
 
                        return;
                }
@@ -1836,5 +1840,5 @@ void GameCommand(string command)
        }
 
        // nothing above caught the command, must be invalid
-       LOG_INFO(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
+       LOG_INFO(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.");
 }
index 9d5bf6f9417a1cb07144e9db38a6f798ec3ebc64..8cfed5bae4bb06e1c15e15ead247605aaa08481f 100644 (file)
@@ -583,7 +583,7 @@ float VoteCommand_checkargs(float startpos, float argc)
        if(cvar_type(cvarname) & CVAR_TYPEFLAG_EXISTS)
                cmdrestriction = cvar_string(cvarname);
        else
-               LOG_INFO("NOTE: ", cvarname, " does not exist, no restrictions will be applied.\n");
+               LOG_INFO("NOTE: ", cvarname, " does not exist, no restrictions will be applied.");
 
        if (cmdrestriction == "") return true;
 
index 532428dd08893eb39a78c033b51850f43f3904dd..2e2301d0bdec150704ae2b6f297beddbda5870a2 100644 (file)
@@ -118,35 +118,23 @@ void target_give_init(entity this)
        {
                if (it.classname == "weapon_rocketlauncher" || it.classname == "weapon_devastator") {
                        this.ammo_rockets += it.count * WEP_CVAR(devastator, ammo);
-                       this.netname = "devastator";
+                       this.netname = cons(this.netname, "devastator");
                }
                else if (it.classname == "weapon_lightning") {
                        this.ammo_cells += it.count * WEP_CVAR_PRI(electro, ammo); // WEAPONTODO
-                       if(this.netname == "")
-                               this.netname = "electro";
-                       else
-                               this.netname = strcat(this.netname, " electro");
+                       this.netname = cons(this.netname, "electro");
                }
                else if (it.classname == "weapon_plasmagun") {
                        this.ammo_rockets += it.count * WEP_CVAR_PRI(hagar, ammo); // WEAPONTODO
-                       if(this.netname == "")
-                               this.netname = "hagar";
-                       else
-                               this.netname = strcat(this.netname, " hagar");
+                       this.netname = cons(this.netname, "hagar");
                }
                else if (it.classname == "weapon_bfg") {
                        this.ammo_cells += it.count * WEP_CVAR_PRI(crylink, ammo);
-                       if(this.netname == "")
-                               this.netname = "crylink";
-                       else
-                               this.netname = strcat(this.netname, " crylink");
+                       this.netname = cons(this.netname, "crylink");
                }
                else if (it.classname == "weapon_grenadelauncher" || it.classname == "weapon_mortar") {
                        this.ammo_rockets += it.count * WEP_CVAR_PRI(mortar, ammo); // WEAPONTODO
-                       if(this.netname == "")
-                               this.netname = "mortar";
-                       else
-                               this.netname = strcat(this.netname, " mortar");
+                       this.netname = cons(this.netname, "mortar");
                }
                else if (it.classname == "item_armor_body")
                        this.armorvalue = 100;
index d9f614357ce4a6b2bc240247965c36f353c3b413..4c3b1d221ea4ae73be7f0ff7cc7b7ed5d7b9000f 100644 (file)
@@ -270,7 +270,6 @@ void W_Porto_Remove (entity p);
 .float bulletcounter;
 
 // Nexball
-.entity ballcarried; // Also used for keepaway
 float g_nexball_meter_period;
 
 void SUB_DontUseTargets(entity this, entity actor, entity trigger);
index d96c28bf1adaac3df8328bbc05ef5db3c9f76b6b..8a0223804d473e8d1f3288f235f546bdb7dab84c 100644 (file)
@@ -28,7 +28,7 @@
 
 void UpdateFrags(entity player, int f)
 {
-       PlayerTeamScore_AddScore(player, f);
+       GameRules_scoring_add_team(player, SCORE, f);
 }
 
 void GiveFrags (entity attacker, entity targ, float f, int deathtype)
@@ -41,23 +41,23 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
                if(targ == attacker)
                {
                        // suicide
-                       PlayerScore_Add(attacker, SP_SUICIDES, 1);
+                       GameRules_scoring_add(attacker, SUICIDES, 1);
                }
                else
                {
                        // teamkill
-                       PlayerScore_Add(attacker, SP_KILLS, -1); // or maybe add a teamkills field?
+                       GameRules_scoring_add(attacker, KILLS, -1); // or maybe add a teamkills field?
                }
        }
        else
        {
                // regular frag
-               PlayerScore_Add(attacker, SP_KILLS, 1);
+               GameRules_scoring_add(attacker, KILLS, 1);
                if(targ.playerid)
                        PS_GR_P_ADDVAL(attacker, sprintf("kills-%d", targ.playerid), 1);
        }
 
-       PlayerScore_Add(targ, SP_DEATHS, 1);
+       GameRules_scoring_add(targ, DEATHS, 1);
 
        .entity weaponentity = weaponentities[0]; // TODO: unhardcode
 
@@ -509,7 +509,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                LogDeath("accident", deathtype, targ, targ);
                GiveFrags(targ, targ, -1, deathtype);
 
-               if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
+               if(GameRules_scoring_add(targ, SCORE, 0) == -5)
                {
                        Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_ACHIEVEMENT_BOTLIKE);
                        PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
@@ -1064,7 +1064,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                                force = force * a;
 
                                                if(autocvar_g_throughfloor_debug)
-                                                       LOG_INFOF(" D=%f F=%f\n", finaldmg, vlen(force));
+                                                       LOG_INFOF(" D=%f F=%f", finaldmg, vlen(force));
                                        }
 
                                        //if (targ == attacker)
index 2812da09d08cd5b6e26a3c9407bc43d17bdf3a3b..64aa03b5026d5b62f0e24df6fc731389a8b637e9 100644 (file)
@@ -135,7 +135,7 @@ void GotoFirstMap(entity this)
        else
        {
                this.nextthink = time + 1;
-               LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...\n");
+               LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...");
        }
 }
 
@@ -272,6 +272,7 @@ void cvar_changes_init()
                BADCVAR("g_freezetag");
                BADCVAR("g_freezetag_teams");
                BADCVAR("g_invasion_teams");
+               BADCVAR("g_invasion_type");
                BADCVAR("g_jailbreak");
                BADCVAR("g_jailbreak_teams");
                BADCVAR("g_keepaway");
@@ -531,7 +532,7 @@ void detect_maptype()
                        tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, NULL);
        if(trace_fraction == 1)
                continue;
-                       LOG_INFO(ftos(i), " -> ", vtos(trace_endpos), "\n");
+                       LOG_INFO(ftos(i), " -> ", vtos(trace_endpos));
                }
 
                break;
@@ -596,18 +597,6 @@ 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();
@@ -652,7 +641,7 @@ spawnfunc(worldspawn)
                                fclose(sentinel);
                                if (switchversion != "" && switchversion != WATERMARK)
                                {
-                                       LOG_INFOF("Switching progs: " WATERMARK " -> %s\n", switchversion);
+                                       LOG_INFOF("Switching progs: " WATERMARK " -> %s", switchversion);
                                        // if it doesn't exist, assume either:
                                        //   a) the current program was overwritten
                                        //   b) this is a client only update
@@ -673,7 +662,7 @@ spawnfunc(worldspawn)
                }
                if (wantrestart)
                {
-                       LOG_INFOF("Restart requested\n");
+                       LOG_INFOF("Restart requested");
                        changelevel(mapname);
                        // let initialization continue, shutdown depends on it
                }
@@ -758,8 +747,7 @@ spawnfunc(worldspawn)
        readlevelcvars();
        GrappleHookInit();
 
-       if(!limits_are_set)
-               SetLimits(autocvar_fraglimit_override, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
+    GameRules_limit_fallbacks();
 
        if(warmup_limit == 0)
                warmup_limit = (autocvar_timelimit > 0) ? autocvar_timelimit * 60 : autocvar_timelimit;
@@ -845,23 +833,23 @@ spawnfunc(worldspawn)
                                        continue;
                                if(argv(0) == "cd")
                                {
-                                       LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
-                                       LOG_INFO("  cdtrack ", argv(2), "\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:");
+                                       LOG_INFO("  cdtrack ", argv(2));
                                }
                                else if(argv(0) == "fog")
                                {
-                                       LOG_INFO("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
-                                       LOG_INFO("  \"fog\" \"", s, "\"\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:");
+                                       LOG_INFO("  \"fog\" \"", s, "\"");
                                }
                                else if(argv(0) == "set")
                                {
-                                       LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
-                                       LOG_INFO("  clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:");
+                                       LOG_INFO("  clientsettemp_for_type all ", argv(1), " ", argv(2));
                                }
                                else if(argv(0) != "//")
                                {
-                                       LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
-                                       LOG_INFO("  clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
+                                       LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:");
+                                       LOG_INFO("  clientsettemp_for_type all ", argv(0), " ", argv(1));
                                }
                        }
                        fclose(fd);
@@ -1437,7 +1425,7 @@ void DumpStats(float final)
        s = strcat(s, GetGametype(), "_", GetMapname(), ":", ftos(rint(time)));
 
        if(to_console)
-               LOG_INFO(s, "\n");
+               LOG_INFO(s);
        if(to_eventlog)
                GameLogEcho(s);
 
@@ -1453,7 +1441,7 @@ void DumpStats(float final)
 
        s = strcat(":labels:player:", GetPlayerScoreString(NULL, 0));
        if(to_console)
-               LOG_INFO(s, "\n");
+               LOG_INFO(s);
        if(to_eventlog)
                GameLogEcho(s);
        if(to_file)
@@ -1468,7 +1456,7 @@ void DumpStats(float final)
                        s = strcat(s, "spectator:");
 
                if(to_console)
-                       LOG_INFO(s, playername(it, false), "\n");
+                       LOG_INFO(s, playername(it, false));
                if(to_eventlog)
                        GameLogEcho(strcat(s, ftos(it.playerid), ":", playername(it, false)));
                if(to_file)
@@ -1479,7 +1467,7 @@ void DumpStats(float final)
        {
                s = strcat(":labels:teamscores:", GetTeamScoreString(0, 0));
                if(to_console)
-                       LOG_INFO(s, "\n");
+                       LOG_INFO(s);
                if(to_eventlog)
                        GameLogEcho(s);
                if(to_file)
@@ -1490,7 +1478,7 @@ void DumpStats(float final)
                        s = strcat(":teamscores:see-labels:", GetTeamScoreString(i, 0));
                        s = strcat(s, ":", ftos(i));
                        if(to_console)
-                               LOG_INFO(s, "\n");
+                               LOG_INFO(s);
                        if(to_eventlog)
                                GameLogEcho(s);
                        if(to_file)
@@ -1499,7 +1487,7 @@ void DumpStats(float final)
        }
 
        if(to_console)
-               LOG_INFO(":end\n");
+               LOG_INFO(":end");
        if(to_eventlog)
                GameLogEcho(":end");
        if(to_file)
@@ -1904,7 +1892,7 @@ void CheckRules_World()
                                totalplayers = playerswithlaps = readyplayers = 0;
                                FOREACH_CLIENT(IS_PLAYER(it), {
                                        ++totalplayers;
-                                       if(PlayerScore_Add(it, SP_RACE_FASTEST, 0))
+                                       if(GameRules_scoring_add(it, RACE_FASTEST, 0))
                                                ++playerswithlaps;
                                        if(it.ready)
                                                ++readyplayers;
@@ -2130,7 +2118,7 @@ float RedirectionThink()
        clients_found = 0;
        FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                // TODO add timer
-               LOG_INFO("Redirecting: sending connect command to ", it.netname, "\n");
+               LOG_INFO("Redirecting: sending connect command to ", it.netname);
                if(redirection_target == "self")
                        stuffcmd(it, "\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " reconnect\n");
                else
@@ -2138,7 +2126,7 @@ float RedirectionThink()
                ++clients_found;
        });
 
-       LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.\n");
+       LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.");
 
        if(time > redirection_timeout || clients_found == 0)
                localcmd("\nwait; wait; wait; quit\n");
@@ -2203,7 +2191,7 @@ void Shutdown()
        }
        else if(world_initialized == 0)
        {
-               LOG_INFO("NOTE: crashed before even initializing the world, not saving persistent data\n");
+               LOG_INFO("NOTE: crashed before even initializing the world, not saving persistent data");
        }
        else
        {
index 4d5401abdf888e5afaf05ec22a286410ee47ce3d..034407bc1f0f135722602b3ba8224e70ca98ea00 100644 (file)
@@ -10,9 +10,6 @@ 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 IntermissionThink(entity this);
index d9036dea519ac5ade2431f2d31be037625523676..56ea478ae2624ed9e766e77e2a8a318412d6a106 100644 (file)
@@ -97,7 +97,7 @@ X(0)
                for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot) \
                { \
                        .entity weaponentity = weaponentities[wepslot]; \
-                       W_CycleWeapon(this, this.cvar_cl_weaponpriorities[slot], dir, weaponentity); \
+                       W_CycleWeapon(this, CS(this).cvar_cl_weaponpriorities[slot], dir, weaponentity); \
                        if(wepslot == 0 && autocvar_g_weaponswitch_debug != 1) \
                                break; \
                } \
@@ -652,7 +652,7 @@ IMPULSE(navwaypoint_remove)
 
        if (e.wphardwired)
        {
-               LOG_INFO("^1Warning: ^7Removal of hardwired waypoints is not allowed in the editor. Please remove links from/to this waypoint (", vtos(e.origin), ") by hand from maps/", mapname, ".waypoints.hardwired\n");
+               LOG_INFO("^1Warning: ^7Removal of hardwired waypoints is not allowed in the editor. Please remove links from/to this waypoint (", vtos(e.origin), ") by hand from maps/", mapname, ".waypoints.hardwired");
                return;
        }
 
@@ -710,27 +710,27 @@ IMPULSE(navwaypoint_unreachable)
        m = 0;
        IL_EACH(g_waypoints, it.wpcost >= 10000000,
        {
-               LOG_INFO("unreachable: ", etos(it), " ", vtos(it.origin), "\n");
+               LOG_INFO("unreachable: ", etos(it), " ", vtos(it.origin));
                it.colormod_z = 8;
                it.effects |= EF_NODEPTHTEST | EF_BLUE;
                ++j;
                ++m;
        });
-       if (j) LOG_INFOF("%d waypoints cannot be reached from here in any way (marked with blue light)\n", j);
+       if (j) LOG_INFOF("%d waypoints cannot be reached from here in any way (marked with blue light)", j);
        navigation_markroutes_inverted(e2);
 
        j = 0;
        IL_EACH(g_waypoints, it.wpcost >= 10000000,
        {
-               LOG_INFO("cannot reach me: ", etos(it), " ", vtos(it.origin), "\n");
+               LOG_INFO("cannot reach me: ", etos(it), " ", vtos(it.origin));
                it.colormod_x = 8;
                if (!(it.effects & EF_NODEPTHTEST))  // not already reported before
                        ++m;
                it.effects |= EF_NODEPTHTEST | EF_RED;
                ++j;
        });
-       if (j) LOG_INFOF("%d waypoints cannot walk to here in any way (marked with red light)\n", j);
-       if (m) LOG_INFOF("%d waypoints have been marked total\n", m);
+       if (j) LOG_INFOF("%d waypoints cannot walk to here in any way (marked with red light)", j);
+       if (m) LOG_INFOF("%d waypoints have been marked total", m);
 
        j = 0;
        IL_EACH(g_spawnpoints, true,
@@ -747,7 +747,7 @@ IMPULSE(navwaypoint_unreachable)
                else
                {
                        setorigin(it, org);
-                       LOG_INFO("spawn without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
+                       LOG_INFO("spawn without waypoint: ", etos(it), " ", vtos(it.origin));
                        it.effects |= EF_NODEPTHTEST;
                        _setmodel(it, this.model);
                        it.frame = this.frame;
@@ -757,7 +757,7 @@ IMPULSE(navwaypoint_unreachable)
                        ++j;
                }
        });
-       if (j) LOG_INFOF("%d spawnpoints have no nearest waypoint (marked by player model)\n", j);
+       if (j) LOG_INFOF("%d spawnpoints have no nearest waypoint (marked by player model)", j);
 
        j = 0;
        IL_EACH(g_items, true,
@@ -768,21 +768,21 @@ IMPULSE(navwaypoint_unreachable)
        IL_EACH(g_items, true,
        {
                if (navigation_findnearestwaypoint(it, false)) continue;
-               LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
+               LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin));
                it.effects |= EF_NODEPTHTEST | EF_RED;
                it.colormod_x = 8;
                ++j;
        });
-       if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked away from (marked with red light)\n", j);
+       if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked away from (marked with red light)", j);
 
        j = 0;
        IL_EACH(g_items, true,
        {
                if (navigation_findnearestwaypoint(it, true)) continue;
-               LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
+               LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin));
                it.effects |= EF_NODEPTHTEST | EF_BLUE;
                it.colormod_z = 8;
                ++j;
        });
-       if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked to (marked with blue light)\n", j);
+       if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked to (marked with blue light)", j);
 }
index 6211362ac67f815d25c153880dac6f43eb07b6fd..98dbf5c55b748d5a4d106f8dadec8fc3e29b412f 100644 (file)
@@ -93,18 +93,18 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if(id >= MAX_IPBAN_URIS)
        {
-               LOG_INFO("Received ban list for invalid ID\n");
+               LOG_INFO("Received ban list for invalid ID");
                return;
        }
 
        tokenize_console(autocvar_g_ban_sync_uri);
        uri = argv(id);
 
-       LOG_INFO("Received ban list from ", uri, ": ");
+       string prelude = strcat("Received ban list from ", uri, ": ");
 
        if(OnlineBanList_RequestWaiting[id] == 0)
        {
-               LOG_INFO("rejected (unexpected)\n");
+               LOG_INFO(prelude, "rejected (unexpected)");
                return;
        }
 
@@ -112,14 +112,14 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if(time > OnlineBanList_Timeout)
        {
-               LOG_INFO("rejected (too late)\n");
+               LOG_INFO(prelude, "rejected (too late)");
                return;
        }
 
        syncinterval = autocvar_g_ban_sync_interval;
        if(syncinterval == 0)
        {
-               LOG_INFO("rejected (syncing disabled)\n");
+               LOG_INFO(prelude, "rejected (syncing disabled)");
                return;
        }
        if(syncinterval > 0)
@@ -127,19 +127,19 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if(status != 0)
        {
-               LOG_INFO("error: status is ", ftos(status), "\n");
+               LOG_INFO(prelude, "error: status is ", ftos(status));
                return;
        }
 
        if(substring(data, 0, 1) == "<")
        {
-               LOG_INFO("error: received HTML instead of a ban list\n");
+               LOG_INFO(prelude, "error: received HTML instead of a ban list");
                return;
        }
 
        if(strstrofs(data, "\r", 0) != -1)
        {
-               LOG_INFO("error: received carriage returns\n");
+               LOG_INFO(prelude, "error: received carriage returns");
                return;
        }
 
@@ -150,11 +150,11 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
 
        if((n % 4) != 0)
        {
-               LOG_INFO("error: received invalid item count: ", ftos(n), "\n");
+               LOG_INFO(prelude, "error: received invalid item count: ", ftos(n));
                return;
        }
 
-       LOG_INFO("OK, ", ftos(n / 4), " items\n");
+       LOG_INFO(prelude, "OK, ", ftos(n / 4), " items");
 
        for(i = 0; i < n; i += 4)
        {
@@ -177,7 +177,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                        for(j = 0; j < l; ++j)
                                if(strstrofs("0123456789.", substring(ip, j, 1), 0) == -1)
                                {
-                                       LOG_INFO("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.\n");
+                                       LOG_INFO("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.");
                                        goto skip;
                                }
                }
@@ -191,8 +191,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                        // the ban will be prolonged on the next sync
                        // or expire 5 seconds after the next timeout
                Ban_Insert(ip, timeleft, strcat("ban synced from ", serverip, " at ", uri), 0);
-               LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ");
-               LOG_INFO(reason, "\n");
+               LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ", reason);
 
 LABEL(skip)
        }
@@ -330,7 +329,7 @@ void Ban_View()
        float i, n;
        string msg;
 
-       LOG_INFO("^2Listing all existing active bans:\n");
+       LOG_INFO("^2Listing all existing active bans:");
 
        n = 0;
        for(i = 0; i < ban_count; ++i)
@@ -344,10 +343,10 @@ void Ban_View()
                msg = strcat(msg, ban_ip[i], " is still banned for ");
                msg = strcat(msg, ftos(ban_expire[i] - time), " seconds");
 
-               LOG_INFO("  ", msg, "\n");
+               LOG_INFO("  ", msg);
        }
 
-       LOG_INFO("^2Done listing all active (", ftos(n), ") bans.\n");
+       LOG_INFO("^2Done listing all active (", ftos(n), ") bans.");
 }
 
 float Ban_GetClientIP(entity client)
@@ -549,7 +548,7 @@ float Ban_Insert(string ip, float bantime, string reason, float dosync)
        if(i < ban_count)
        if(ban_expire[i] > time + bantime)
        {
-               LOG_INFO(ip, " could not get banned due to no free ban slot\n");
+               LOG_INFO(ip, " could not get banned due to no free ban slot");
                return false;
        }
        // okay, insert our new victim as i
index 38d8926371282ba17882a2f623da0427673b29a9..7bb8e922d5902a7f03ac9c67b0da27284eb17f12 100644 (file)
@@ -292,37 +292,37 @@ Called with:
   0:  sends the request
   >0: receives a cvar from name=argv(f) value=argv(f+1)
 */
-void GetCvars_handleString(entity this, string thisname, float f, .string field, string name)
+void GetCvars_handleString(entity this, entity store, string thisname, float f, .string field, string name)
 {
        if (f < 0)
        {
-               if (this.(field))
-                       strunzone(this.(field));
-               this.(field) = string_null;
+               if (store.(field))
+                       strunzone(store.(field));
+               store.(field) = string_null;
        }
        else if (f > 0)
        {
                if (thisname == name)
                {
-                       if (this.(field))
-                               strunzone(this.(field));
-                       this.(field) = strzone(argv(f + 1));
+                       if (store.(field))
+                               strunzone(store.(field));
+                       store.(field) = strzone(argv(f + 1));
                }
        }
        else
                stuffcmd(this, strcat("cl_cmd sendcvar ", name, "\n"));
 }
-void GetCvars_handleString_Fixup(entity this, string thisname, float f, .string field, string name, string(entity, string) func)
+void GetCvars_handleString_Fixup(entity this, entity store, string thisname, float f, .string field, string name, string(entity, string) func)
 {
-       GetCvars_handleString(this, thisname, f, field, name);
+       GetCvars_handleString(this, store, thisname, f, field, name);
        if (f >= 0) // also initialize to the fitting value for "" when sending cvars out
                if (thisname == name)
                {
-                       string s = func(this, strcat1(this.(field)));
-                       if (s != this.(field))
+                       string s = func(this, strcat1(store.(field)));
+                       if (s != store.(field))
                        {
-                               strunzone(this.(field));
-                               this.(field) = strzone(s);
+                               strunzone(store.(field));
+                               store.(field) = strzone(s);
                        }
                }
 }
@@ -339,7 +339,7 @@ void GetCvars_handleFloat(entity this, entity store, string thisname, float f, .
        else
                stuffcmd(this, strcat("cl_cmd sendcvar ", name, "\n"));
 }
-void GetCvars_handleFloatOnce(entity this, string thisname, float f, .float field, string name)
+void GetCvars_handleFloatOnce(entity this, entity store, string thisname, float f, .float field, string name)
 {
        if (f < 0)
        {
@@ -348,17 +348,17 @@ void GetCvars_handleFloatOnce(entity this, string thisname, float f, .float fiel
        {
                if (thisname == name)
                {
-                       if (!this.(field))
+                       if (!store.(field))
                        {
-                               this.(field) = stof(argv(f + 1));
-                               if (!this.(field))
-                                       this.(field) = -1;
+                               store.(field) = stof(argv(f + 1));
+                               if (!store.(field))
+                                       store.(field) = -1;
                        }
                }
        }
        else
        {
-               if (!this.(field))
+               if (!store.(field))
                        stuffcmd(this, strcat("cl_cmd sendcvar ", name, "\n"));
        }
 }
@@ -408,7 +408,7 @@ REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
 /**
  * @param f -1: cleanup, 0: request, 1: receive
  */
-void GetCvars(entity this, int f)
+void GetCvars(entity this, entity store, int f)
 {
        string s = string_null;
 
@@ -421,21 +421,21 @@ void GetCvars(entity this, int f)
 
        Notification_GetCvars(this);
 
-       ReplicateVars(this, CS(this), s, f);
+       ReplicateVars(this, store, s, f);
 
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[2], "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[3], "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[4], "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[5], "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[6], "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[7], "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);
-       GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[2], "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[3], "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[4], "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[5], "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[6], "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[7], "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);
+       GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);
 
-       GetCvars_handleFloat(this, CS(this), s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking");
+       GetCvars_handleFloat(this, store, s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking");
 
        // fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early)
        if (f > 0)
@@ -1125,7 +1125,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".\n");
+               LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".");
        }
 }
 
index abe8cd74a6c78c5aac70029d0acf971ce6e590a0..1c01a573797713c4fe39345da3f895e60717aad9 100644 (file)
@@ -44,7 +44,7 @@ void GetCvars_handleFloat(entity this, entity store, string thisname, float f, .
 
 float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
 
-void GetCvars_handleString(entity this, string thisname, float f, .string field, string name);
+void GetCvars_handleString(entity this, entity store, string thisname, float f, .string field, string name);
 
 void precache_all_playermodels(string pattern);
 
@@ -75,7 +75,7 @@ void GameLogInit();
 
 void GameLogClose();
 
-void GetCvars(entity this, float f);
+void GetCvars(entity this, entity store, int f);
 
 string GetMapname();
 
index ac8746516ca516b0552d56f6a26a1f2eea633cdb..5de2a656a927b299c8c691a46b872fbabb74af71 100644 (file)
@@ -6,6 +6,7 @@
 #include <server/scores.qh>
 #include <server/scores_rules.qh>
 #include <server/teamplay.qh>
+#include <common/gamemodes/rules.qh>
 
 #include "mutator.qh"
 
@@ -91,7 +92,7 @@
 #include <server/weapons/weaponsystem.qh>
 
 #include <common/physics/player.qh>
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
 #include <common/deathtypes/all.qh>
 #include <common/notifications/all.qh>
 #include <common/triggers/teleporters.qh>
index 85801af52a8fc900db8fcff339c2b6b153c5226d..affa033de1da73e3082bd12b1c8925cf7ac85330 100644 (file)
@@ -55,13 +55,13 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger)
        {
                if(this.enemy.health - this.dmg > 0.5)
                {
-                       PlayerTeamScore_Add(actor, SP_SCORE, ST_SCORE, this.dmg);
+                       GameRules_scoring_add_team(actor, SCORE, this.dmg);
                        this.enemy.health = this.enemy.health - this.dmg;
                }
                else
                {
-                       PlayerTeamScore_Add(actor, SP_SCORE, ST_SCORE, this.enemy.health);
-                       PlayerTeamScore_Add(actor, SP_ASSAULT_OBJECTIVES, ST_ASSAULT_OBJECTIVES, 1);
+                       GameRules_scoring_add_team(actor, SCORE, this.enemy.health);
+                       GameRules_scoring_add_team(actor, ASSAULT_OBJECTIVES, 1);
                        this.enemy.health = -1;
 
                        if(this.enemy.message)
@@ -429,8 +429,8 @@ void havocbot_goalrating_ast_targets(entity this, float ratingscale)
 
                        this.havocbot_attack_time = 0;
 
-                       if(checkpvs(this.view_ofs,it))
-                       if(checkpvs(this.view_ofs,best))
+                       if(checkpvs(this.origin + this.view_ofs, it))
+                       if(checkpvs(this.origin + this.view_ofs, best))
                        {
                        //      dprint("increasing attack time for this target\n");
                                this.havocbot_attack_time = time + 2;
@@ -614,16 +614,3 @@ MUTATOR_HOOKFUNCTION(as, ReadyRestart_Deny)
        // readyrestart not supported (yet)
        return true;
 }
-
-// scoreboard setup
-void assault_ScoreRules()
-{
-       int teams = 0;
-       teams |= BIT(0);
-       teams |= BIT(1); // always red vs blue
-
-       ScoreRules_basics(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, true);
-       ScoreInfo_SetLabel_TeamScore(  ST_ASSAULT_OBJECTIVES,    "objectives",      SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_ASSAULT_OBJECTIVES,    "objectives",      SFL_SORT_PRIO_PRIMARY);
-       ScoreRules_basics_end();
-}
index 8fd40748543bbcdf5a708845720791f6e6ac5f37..f437d98b52c837c6db59520c37d840660ece1003 100644 (file)
@@ -2,33 +2,20 @@
 
 #include "../gamemode.qh"
 
-void assault_ScoreRules();
+const int ST_ASSAULT_OBJECTIVES = 1;
 
 REGISTER_MUTATOR(as, false)
 {
-       ActivateTeamplay();
-       have_team_spawns = -1; // request team spawns
-
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               assault_ScoreRules();
+        GameRules_teams(true);
+        int teams = BITS(2); // always red vs blue
+        GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
+            field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+            field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+        });
        }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back assault_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
        return 0;
 }
 
@@ -55,8 +42,5 @@ void(entity bot) havocbot_ast_reset_role;
 void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items;
 void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
 
-// scoreboard stuff
-const float ST_ASSAULT_OBJECTIVES = 1;
-
 // predefined spawnfuncs
 void target_objective_decrease_activate(entity this);
index ca402f7f16fd0da9cfad47e0bb3de599998a84a4..159df8a7818edbf5348a6d9ab184fb1227dbaefe 100644 (file)
@@ -366,7 +366,7 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor)
        float excess = max(0, frag_damage - damage_take - damage_save);
 
        if (frag_target != frag_attacker && IS_PLAYER(frag_attacker))
-               PlayerTeamScore_Add(frag_attacker, SP_SCORE, ST_SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
+               GameRules_scoring_add_team(frag_attacker, SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
 }
 
 MUTATOR_HOOKFUNCTION(ca, PlayerRegen)
index 5aba748fd5348207e81b7dacdbde39288fbde814..0982fcca8fb35e34fd71152cc81815b0282f6b7a 100644 (file)
@@ -21,52 +21,30 @@ bool CA_CheckWinner();
 void CA_RoundStart();
 bool ca_isEliminated(entity e);
 
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
-
 REGISTER_MUTATOR(ca, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               // game loads at time 1
-               if (time > 1) error("This is a game type and it cannot be added at runtime.");
-
-               allowed_to_spawn = true;
+               GameRules_teams(true);
+        GameRules_spawning_teams(autocvar_g_ca_team_spawns);
+        GameRules_limit_score(autocvar_g_ca_point_limit);
+        GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
 
                ca_teams = autocvar_g_ca_teams_override;
                if (ca_teams < 2)
                        ca_teams = cvar("g_ca_teams"); // read the cvar directly as it gets written earlier in the same frame
-               ca_teams = bound(2, ca_teams, 4);
-
-               int teams = 0;
-               if(ca_teams >= 1) teams |= BIT(0);
-               if(ca_teams >= 2) teams |= BIT(1);
-               if(ca_teams >= 3) teams |= BIT(2);
-               if(ca_teams >= 4) teams |= BIT(3);
 
-               ca_teams = teams; // now set it?
-
-        ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
-        ScoreInfo_SetLabel_TeamScore(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
-        ScoreRules_basics_end();
+               ca_teams = BITS(bound(2, ca_teams, 4));
+        GameRules_scoring(ca_teams, SFL_SORT_PRIO_PRIMARY, 0, {
+            field_team(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
+        });
 
+               allowed_to_spawn = true;
                round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, CA_RoundStart);
                round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
-
                EliminatedPlayers_Init(ca_isEliminated);
-
-               ActivateTeamplay();
-               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
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
        }
-
        return 0;
 }
 
index 4c88d5e45f76d5abf32348cbbe0e0339525d34d6..3cf560ebedf752c3fc99b33cfc2aa3248bcaad2b 100644 (file)
@@ -1,43 +1,8 @@
 #include "gamemode_ctf.qh"
 
-#ifndef CSQC
 #include <common/effects/all.qh>
-void ctf_Initialize();
-
-REGISTER_MUTATOR(ctf, false)
-{
-       MUTATOR_ONADD
-       {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               ctf_Initialize();
-
-               ActivateTeamplay();
-               SetLimits(autocvar_capturelimit_override, autocvar_captureleadlimit_override, autocvar_timelimit_override, -1);
-               have_team_spawns = -1; // request team spawns
-       }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back ctf_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
-       return 0;
-}
-#endif
-
-#ifdef SVQC
 #include <common/vehicles/all.qh>
 #include <server/teamplay.qh>
-#endif
 
 #include <lib/warpzone/common.qh>
 
@@ -278,10 +243,10 @@ bool ctf_CaptureShield_CheckStatus(entity p)
        if(ctf_captureshield_max_ratio <= 0)
                return false;
 
-       s  = PlayerScore_Add(p, SP_CTF_CAPS,    0);
-       s2 = PlayerScore_Add(p, SP_CTF_PICKUPS, 0);
-       s3 = PlayerScore_Add(p, SP_CTF_RETURNS, 0);
-       s4 = PlayerScore_Add(p, SP_CTF_FCKILLS, 0);
+       s  = GameRules_scoring_add(p, CTF_CAPS, 0);
+       s2 = GameRules_scoring_add(p, CTF_PICKUPS, 0);
+       s3 = GameRules_scoring_add(p, CTF_RETURNS, 0);
+       s4 = GameRules_scoring_add(p, CTF_FCKILLS, 0);
 
        sr = ((s - s2) + (s3 + s4));
 
@@ -292,10 +257,10 @@ bool ctf_CaptureShield_CheckStatus(entity p)
        FOREACH_CLIENT(IS_PLAYER(it), {
                if(DIFF_TEAM(it, p))
                        continue;
-               se  = PlayerScore_Add(it, SP_CTF_CAPS,    0);
-               se2 = PlayerScore_Add(it, SP_CTF_PICKUPS, 0);
-               se3 = PlayerScore_Add(it, SP_CTF_RETURNS, 0);
-               se4 = PlayerScore_Add(it, SP_CTF_FCKILLS, 0);
+               se  = GameRules_scoring_add(it, CTF_CAPS, 0);
+               se2 = GameRules_scoring_add(it, CTF_PICKUPS, 0);
+               se3 = GameRules_scoring_add(it, CTF_RETURNS, 0);
+               se4 = GameRules_scoring_add(it, CTF_FCKILLS, 0);
 
                ser = ((se - se2) + (se3 + se4));
 
@@ -387,8 +352,8 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype)
        ctf_EventLog("dropped", player.team, player);
 
        // scoring
-       PlayerTeamScore_AddScore(player, -((flag.score_drop) ? flag.score_drop : autocvar_g_ctf_score_penalty_drop));
-       PlayerScore_Add(player, SP_CTF_DROPS, 1);
+       GameRules_scoring_add_team(player, SCORE, -((flag.score_drop) ? flag.score_drop : autocvar_g_ctf_score_penalty_drop));
+       GameRules_scoring_add(player, CTF_DROPS, 1);
 
        // waypoints
        if(autocvar_g_ctf_flag_dropped_waypoint) {
@@ -419,6 +384,7 @@ void ctf_Handle_Retrieve(entity flag, entity player)
        // transfer flag to player
        flag.owner = player;
        flag.owner.flagcarried = flag;
+       GameRules_scoring_vip(player, true);
 
        // reset flag
        if(player.vehicle)
@@ -476,6 +442,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype)
        setattachment(flag, NULL, "");
        setorigin(flag, player.origin + FLAG_DROP_OFFSET);
        flag.owner.flagcarried = NULL;
+       GameRules_scoring_vip(flag.owner, false);
        flag.owner = NULL;
        flag.solid = SOLID_TRIGGER;
        flag.ctf_dropper = player;
@@ -602,16 +569,16 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype)
        float pscore = 0;
        if(enemy_flag.score_capture || flag.score_capture)
                pscore = floor((max(1, enemy_flag.score_capture) + max(1, flag.score_capture)) * 0.5);
-       PlayerTeamScore_AddScore(player, ((pscore) ? pscore : autocvar_g_ctf_score_capture));
+       GameRules_scoring_add_team(player, SCORE, ((pscore) ? pscore : autocvar_g_ctf_score_capture));
        float capscore = 0;
        if(enemy_flag.score_team_capture || flag.score_team_capture)
                capscore = floor((max(1, enemy_flag.score_team_capture) + max(1, flag.score_team_capture)) * 0.5);
-       PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, ((capscore) ? capscore : 1));
+       GameRules_scoring_add_team(player, CTF_CAPS, ((capscore) ? capscore : 1));
 
-       old_time = PlayerScore_Add(player, SP_CTF_CAPTIME, 0);
+       old_time = GameRules_scoring_add(player, CTF_CAPTIME, 0);
        new_time = TIME_ENCODE(time - enemy_flag.ctf_pickuptime);
        if(!old_time || new_time < old_time)
-               PlayerScore_Add(player, SP_CTF_CAPTIME, new_time - old_time);
+               GameRules_scoring_add(player, CTF_CAPTIME, new_time - old_time);
 
        // effects
        Send_Effect_(flag.capeffect, flag.origin, '0 0 0', 1);
@@ -624,7 +591,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype)
                if(flag.speedrunning) { ctf_FakeTimeLimit(player, -1); }
 
                if((enemy_flag.ctf_dropper) && (player != enemy_flag.ctf_dropper))
-                       { PlayerTeamScore_AddScore(enemy_flag.ctf_dropper, ((enemy_flag.score_assist) ? enemy_flag.score_assist : autocvar_g_ctf_score_capture_assist)); }
+                       { GameRules_scoring_add_team(enemy_flag.ctf_dropper, SCORE, ((enemy_flag.score_assist) ? enemy_flag.score_assist : autocvar_g_ctf_score_capture_assist)); }
        }
 
        // reset the flag
@@ -650,8 +617,8 @@ void ctf_Handle_Return(entity flag, entity player)
        // scoring
        if(IS_PLAYER(player))
        {
-               PlayerTeamScore_AddScore(player, ((flag.score_return) ? flag.score_return : autocvar_g_ctf_score_return)); // reward for return
-               PlayerScore_Add(player, SP_CTF_RETURNS, 1); // add to count of returns
+               GameRules_scoring_add_team(player, SCORE, ((flag.score_return) ? flag.score_return : autocvar_g_ctf_score_return)); // reward for return
+               GameRules_scoring_add(player, CTF_RETURNS, 1); // add to count of returns
 
                nades_GiveBonus(player,autocvar_g_nades_bonus_score_medium);
        }
@@ -660,7 +627,7 @@ void ctf_Handle_Return(entity flag, entity player)
 
        if(flag.ctf_dropper)
        {
-               PlayerScore_Add(flag.ctf_dropper, SP_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the player who dropped the flag
+               GameRules_scoring_add(flag.ctf_dropper, SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the player who dropped the flag
                ctf_CaptureShield_Update(flag.ctf_dropper, 0); // shield player from picking up flag
                flag.ctf_dropper.next_take_time = time + autocvar_g_ctf_flag_collect_delay; // set next take time
        }
@@ -681,6 +648,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        // attach the flag to the player
        flag.owner = player;
        player.flagcarried = flag;
+       GameRules_scoring_vip(player, true);
        if(player.vehicle)
        {
                setattachment(flag, player.vehicle, "");
@@ -735,13 +703,13 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        _sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
 
        // scoring
-       PlayerScore_Add(player, SP_CTF_PICKUPS, 1);
+       GameRules_scoring_add(player, CTF_PICKUPS, 1);
        nades_GiveBonus(player, autocvar_g_nades_bonus_score_minor);
        switch(pickuptype)
        {
                case PICKUP_BASE:
                {
-                       PlayerTeamScore_AddScore(player, ((flag.score_pickup) ? flag.score_pickup : autocvar_g_ctf_score_pickup_base));
+                       GameRules_scoring_add_team(player, SCORE, ((flag.score_pickup) ? flag.score_pickup : autocvar_g_ctf_score_pickup_base));
                        ctf_EventLog("steal", flag.team, player);
                        break;
                }
@@ -751,7 +719,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
                        pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
                        pickup_dropped_score = floor((autocvar_g_ctf_score_pickup_dropped_late * (1 - pickup_dropped_score) + autocvar_g_ctf_score_pickup_dropped_early * pickup_dropped_score) + 0.5);
                        LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score));
-                       PlayerTeamScore_AddScore(player, pickup_dropped_score);
+                       GameRules_scoring_add_team(player, SCORE, pickup_dropped_score);
                        ctf_EventLog("pickup", flag.team, player);
                        break;
                }
@@ -1167,6 +1135,7 @@ void ctf_RespawnFlag(entity flag)
                WaypointSprite_Kill(flag.wps_flagcarrier);
 
                flag.owner.flagcarried = NULL;
+               GameRules_scoring_vip(flag.owner, false);
 
                if(flag.speedrunning)
                        ctf_FakeTimeLimit(flag.owner, -1);
@@ -2170,8 +2139,8 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerDies)
 
        if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)) && (frag_target.flagcarried))
        {
-               PlayerTeamScore_AddScore(frag_attacker, ((SAME_TEAM(frag_attacker, frag_target)) ? -autocvar_g_ctf_score_kill : autocvar_g_ctf_score_kill));
-               PlayerScore_Add(frag_attacker, SP_CTF_FCKILLS, 1);
+               GameRules_scoring_add_team(frag_attacker, SCORE, ((SAME_TEAM(frag_attacker, frag_target)) ? -autocvar_g_ctf_score_kill : autocvar_g_ctf_score_kill));
+               GameRules_scoring_add(frag_attacker, CTF_FCKILLS, 1);
        }
 
        if(frag_target.flagcarried)
@@ -2690,15 +2659,15 @@ spawnfunc(team_CTL_bluelolly)  { spawnfunc_item_flag_team2(this);    }
 void ctf_ScoreRules(int teams)
 {
        CheckAllowedTeams(NULL);
-       ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
-       ScoreInfo_SetLabel_TeamScore  (ST_CTF_CAPS,     "caps",      SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS,    "caps",      SFL_SORT_PRIO_SECONDARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME, "captime",   SFL_LOWER_IS_BETTER | SFL_TIME);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS, "pickups",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS, "fckills",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS, "returns",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_DROPS,   "drops",     SFL_LOWER_IS_BETTER);
-       ScoreRules_basics_end();
+       GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
+        field_team(ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
+        field(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+        field(SP_CTF_CAPTIME, "captime", SFL_LOWER_IS_BETTER | SFL_TIME);
+        field(SP_CTF_PICKUPS, "pickups", 0);
+        field(SP_CTF_FCKILLS, "fckills", 0);
+        field(SP_CTF_RETURNS, "returns", 0);
+        field(SP_CTF_DROPS, "drops", SFL_LOWER_IS_BETTER);
+       });
 }
 
 // code from here on is just to support maps that don't have flag and team entities
index 8ef860846e45d08077bbcc14259f77484dab207c..0b86a57f809936604fd51a5514b899108558dcac 100644 (file)
@@ -3,6 +3,23 @@
 #ifdef SVQC
 
 #include "../gamemode.qh"
+
+void ctf_Initialize();
+
+REGISTER_MUTATOR(ctf, false)
+{
+    MUTATOR_STATIC();
+    MUTATOR_ONADD
+    {
+        GameRules_teams(true);
+        GameRules_limit_score(autocvar_capturelimit_override);
+        GameRules_limit_lead(autocvar_captureleadlimit_override);
+
+        ctf_Initialize();
+    }
+    return 0;
+}
+
 // used in cheats.qc
 void ctf_RespawnFlag(entity flag);
 
index 3de77f372ae54cef342670d29b2530f82e22a655..20f4b383d11296c1c2265dd5e65e9550762ea954 100644 (file)
@@ -32,18 +32,16 @@ void havocbot_role_cts(entity this)
 
 void cts_ScoreRules()
 {
-       ScoreRules_basics(0, 0, 0, false);
-       if(g_race_qualifying)
-       {
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest",   SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
-       }
-       else
-       {
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS,    "laps",      SFL_SORT_PRIO_PRIMARY);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME,    "time",      SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest",   SFL_LOWER_IS_BETTER | SFL_TIME);
-       }
-       ScoreRules_basics_end();
+    GameRules_score_enabled(false);
+    GameRules_scoring(0, 0, 0, {
+        if (g_race_qualifying) {
+            field(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+        } else {
+            field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+            field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+            field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
+        }
+    });
 }
 
 void cts_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
@@ -149,7 +147,7 @@ MUTATOR_HOOKFUNCTION(cts, reset_map_global)
        FOREACH_CLIENT(true, {
                if(it.race_place)
                {
-                       s = PlayerScore_Add(it, SP_RACE_FASTEST, 0);
+                       s = GameRules_scoring_add(it, RACE_FASTEST, 0);
                        if(!s)
                                it.race_place = 0;
                }
@@ -206,7 +204,7 @@ MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver)
 {
        entity player = M_ARGV(0, entity);
 
-       if(PlayerScore_Add(player, SP_RACE_FASTEST, 0))
+       if(GameRules_scoring_add(player, RACE_FASTEST, 0))
                player.frags = FRAGS_LMS_LOSER;
        else
                player.frags = FRAGS_SPECTATOR;
index 2a18fe915d4ad85f8999022d834452fb9ef0ff60..c90919e6f4e7ed176c2740a63c6a4bb9c10575c8 100644 (file)
@@ -7,31 +7,16 @@ void cts_Initialize();
 
 REGISTER_MUTATOR(cts, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-
                g_race_qualifying = true;
                independent_players = 1;
-               SetLimits(0, 0, autocvar_timelimit_override, -1);
+        GameRules_limit_score(0);
+        GameRules_limit_lead(0);
 
                cts_Initialize();
        }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back cts_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
        return 0;
 }
 
index d3cc197eafd40efd5ed884c50713e23f746223a8..f45b0800f39d8cfefb0f30ed49f59ab81256d46c 100644 (file)
@@ -4,24 +4,6 @@
 
 REGISTER_MUTATOR(dm, false)
 {
-       MUTATOR_ONADD
-       {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-       }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back dm_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               error("This is a game type and it cannot be removed at runtime.");
-               return -1;
-       }
-
+    MUTATOR_STATIC();
        return 0;
 }
index 7c645e4d39e1596d2c21ef22368cfe93e3a5515f..be38553c9588bcd4ba1bfd79042432f79aebd583 100644 (file)
@@ -64,7 +64,7 @@ void dompoint_captured(entity this)
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time);
 
        if(this.enemy.playerid == this.enemy_playerid)
-               PlayerScore_Add(this.enemy, SP_DOM_TAKES, 1);
+               GameRules_scoring_add(this.enemy, DOM_TAKES, 1);
        else
                this.enemy = NULL;
 
@@ -176,8 +176,8 @@ void dompointthink(entity this)
                // give credit to the individual player, if he is still there
                if (this.enemy.playerid == this.enemy_playerid)
                {
-                       PlayerScore_Add(this.enemy, SP_SCORE, fragamt);
-                       PlayerScore_Add(this.enemy, SP_DOM_TICKS, fragamt);
+                       GameRules_scoring_add(this.enemy, SCORE, fragamt);
+                       GameRules_scoring_add(this.enemy, DOM_TICKS, fragamt);
                }
                else
                        this.enemy = NULL;
@@ -559,10 +559,10 @@ void ScoreRules_dom(int teams)
 {
        if(domination_roundbased)
        {
-               ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
-               ScoreInfo_SetLabel_TeamScore  (ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
-               ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
-               ScoreRules_basics_end();
+           GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
+            field_team(ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
+            field(SP_DOM_TAKES, "takes", 0);
+           });
        }
        else
        {
@@ -572,11 +572,11 @@ void ScoreRules_dom(int teams)
                        sp_domticks = SFL_SORT_PRIO_PRIMARY;
                else
                        sp_score = SFL_SORT_PRIO_PRIMARY;
-               ScoreRules_basics(teams, sp_score, sp_score, true);
-               ScoreInfo_SetLabel_TeamScore  (ST_DOM_TICKS,    "ticks",     sp_domticks);
-               ScoreInfo_SetLabel_PlayerScore(SP_DOM_TICKS,    "ticks",     sp_domticks);
-               ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES,    "takes",     0);
-               ScoreRules_basics_end();
+               GameRules_scoring(teams, sp_score, sp_score, {
+            field_team(ST_DOM_TICKS, "ticks", sp_domticks);
+            field(SP_DOM_TICKS, "ticks", sp_domticks);
+            field(SP_DOM_TAKES, "takes", 0);
+               });
        }
 }
 
index 609fcfd0d9f01c91afbe25566948f75f96626219..cf5e54f6d53d00946779e981aee6db592cc83c0e 100644 (file)
@@ -11,27 +11,19 @@ void dom_Initialize();
 
 REGISTER_MUTATOR(dom, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               dom_Initialize();
-
                int fraglimit_override = autocvar_g_domination_point_limit;
                if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
                        fraglimit_override = autocvar_g_domination_roundbased_point_limit;
 
-               ActivateTeamplay();
-               SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, autocvar_timelimit_override, -1);
-               have_team_spawns = -1; // request team spawns
-       }
+               GameRules_teams(true);
+        GameRules_limit_score(fraglimit_override);
+        GameRules_limit_lead(autocvar_g_domination_point_leadlimit);
 
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               dom_Initialize();
        }
-
        return 0;
 }
 
index 9e9878c3620b6230d9b72f31dfccd4232e1a7268..88afaa755d7b9f995419411e912d431b7d4ec166 100644 (file)
@@ -7,13 +7,6 @@ float autocvar_g_freezetag_round_timelimit;
 int autocvar_g_freezetag_teams_override;
 float autocvar_g_freezetag_warmup;
 
-void freezetag_ScoreRules(int teams)
-{
-       ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true); // SFL_SORT_PRIO_PRIMARY
-       ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
-       ScoreRules_basics_end();
-}
-
 void freezetag_count_alive_players()
 {
        total_players = redalive = bluealive = yellowalive = pinkalive = 0;
@@ -173,14 +166,14 @@ void freezetag_Add_Score(entity targ, entity attacker)
        {
                // you froze your own dumb targ
                // counted as "suicide" already
-               PlayerScore_Add(targ, SP_SCORE, -1);
+               GameRules_scoring_add(targ, SCORE, -1);
        }
        else if(IS_PLAYER(attacker))
        {
                // got frozen by an enemy
                // counted as "kill" and "death" already
-               PlayerScore_Add(targ, SP_SCORE, -1);
-               PlayerScore_Add(attacker, SP_SCORE, +1);
+               GameRules_scoring_add(targ, SCORE, -1);
+               GameRules_scoring_add(attacker, SCORE, +1);
        }
        // else nothing - got frozen by the game type rules themselves
 }
@@ -489,8 +482,8 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
 
                        // EVERY team mate nearby gets a point (even if multiple!)
                        FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
-                               PlayerScore_Add(it, SP_FREEZETAG_REVIVALS, +1);
-                               PlayerScore_Add(it, SP_SCORE, +1);
+                               GameRules_scoring_add(it, FREEZETAG_REVIVALS, +1);
+                               GameRules_scoring_add(it, SCORE, +1);
                                nades_GiveBonus(it,autocvar_g_nades_bonus_score_low);
                        });
 
@@ -579,16 +572,11 @@ void freezetag_Initialize()
        freezetag_teams = autocvar_g_freezetag_teams_override;
        if(freezetag_teams < 2)
                freezetag_teams = cvar("g_freezetag_teams"); // read the cvar directly as it gets written earlier in the same frame
-       freezetag_teams = bound(2, freezetag_teams, 4);
 
-       int teams = 0;
-       if(freezetag_teams >= 1) teams |= BIT(0);
-       if(freezetag_teams >= 2) teams |= BIT(1);
-       if(freezetag_teams >= 3) teams |= BIT(2);
-       if(freezetag_teams >= 4) teams |= BIT(3);
-
-       freezetag_teams = teams; // now set it?
-       freezetag_ScoreRules(freezetag_teams);
+       freezetag_teams = BITS(bound(2, freezetag_teams, 4));
+       GameRules_scoring(freezetag_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+           field(SP_FREEZETAG_REVIVALS, "revivals", 0);
+       });
 
        round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null);
        round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
index fda0737dd92e1ced1bb5b32923197628fa62dadb..a258d82eab508576040c5e27f1b8431657772d8b 100644 (file)
@@ -9,32 +9,16 @@ void freezetag_Initialize();
 
 REGISTER_MUTATOR(ft, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               freezetag_Initialize();
-
-               ActivateTeamplay();
-               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
-       }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back freezetag_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
+               GameRules_teams(true);
+        GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
+        GameRules_limit_score(autocvar_g_freezetag_point_limit);
+        GameRules_limit_lead(autocvar_g_freezetag_point_leadlimit);
 
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               freezetag_Initialize();
        }
-
        return 0;
 }
 
index fabcc26f62cb26bef62edda59104324330421a82..1b8b77ae078158e566fb34a87c754701436175d3 100644 (file)
@@ -5,6 +5,9 @@
 
 #include <server/teamplay.qh>
 
+IntrusiveList g_invasion_roundends;
+STATIC_INIT(g_invasion_roundends) { g_invasion_roundends = IL_NEW(); }
+
 IntrusiveList g_invasion_waves;
 STATIC_INIT(g_invasion_waves) { g_invasion_waves = IL_NEW(); }
 
@@ -18,10 +21,46 @@ int autocvar_g_invasion_monster_count;
 bool autocvar_g_invasion_zombies_only;
 float autocvar_g_invasion_spawn_delay;
 
+bool victent_present;
+.bool inv_endreached;
+
 bool inv_warning_shown; // spammy
 
 .string spawnmob;
 
+void target_invasion_roundend_use(entity this, entity actor, entity trigger)
+{
+       if(!IS_PLAYER(actor)) { return; }
+
+       actor.inv_endreached = true;
+
+       int plnum = 0;
+       int realplnum = 0;
+       // let's not count bots
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
+               ++realplnum;
+               if(it.inv_endreached)
+                       ++plnum;
+       });
+       if(plnum < ceil(realplnum * min(1, this.count))) // 70% of players
+               return;
+
+       this.winning = true;
+}
+
+spawnfunc(target_invasion_roundend)
+{
+       if(!g_invasion) { delete(this); return; }
+
+       victent_present = true; // a victory entity is present, we don't need to rely on monster count TODO: merge this with the intrusive list (can check empty)
+
+       if(!this.count) { this.count = 0.7; } // require at least 70% of the players to reach the end before triggering victory
+
+       this.use = target_invasion_roundend_use;
+
+       IL_PUSH(g_invasion_roundends, this);
+}
+
 spawnfunc(invasion_wave)
 {
        if(!g_invasion) { delete(this); return; }
@@ -37,6 +76,60 @@ spawnfunc(invasion_spawnpoint)
        IL_PUSH(g_invasion_spawns, this);
 }
 
+void ClearWinners();
+
+// Invasion stage mode winning condition: If the attackers triggered a round end (by fulfilling all objectives)
+// they win.
+int WinningCondition_Invasion()
+{
+       WinningConditionHelper(NULL); // set worldstatus
+
+       int status = WINNING_NO;
+
+       if(autocvar_g_invasion_type == INV_TYPE_STAGE)
+       {
+               SetWinners(inv_endreached, true);
+
+               int found = 0;
+               IL_EACH(g_invasion_roundends, true,
+               {
+                       ++found;
+                       if(it.winning)
+                       {
+                               bprint("Invasion: round completed.\n");
+                               // winners already set (TODO: teamplay support)
+
+                               status = WINNING_YES;
+                               break;
+                       }
+               });
+
+               if(!found)
+                       status = WINNING_YES; // just end it? TODO: should warn mapper!
+       }
+       else if(autocvar_g_invasion_type == INV_TYPE_HUNT)
+       {
+               ClearWinners();
+
+               int found = 0; // NOTE: this ends the round if no monsters are placed
+               IL_EACH(g_monsters, !(it.spawnflags & MONSTERFLAG_RESPAWNED),
+               {
+                       ++found;
+               });
+
+               if(found <= 0)
+               {
+                       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
+                       {
+                               it.winning = true;
+                       });
+                       status = WINNING_YES;
+               }
+       }
+
+       return status;
+}
+
 Monster invasion_PickMonster(int supermonster_count)
 {
        RandomSelection_Init();
@@ -253,7 +346,7 @@ bool Invasion_CheckWinner()
        else
        {
                FOREACH_CLIENT(IS_PLAYER(it), {
-                       float cs = PlayerScore_Add(it, SP_KILLS, 0);
+                       float cs = GameRules_scoring_add(it, KILLS, 0);
                        if(cs > winning_score)
                        {
                                winning_score = cs;
@@ -328,16 +421,19 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
 
        if(!(frag_target.spawnflags & MONSTERFLAG_RESPAWNED))
        {
-               inv_numkilled += 1;
-               inv_maxcurrent -= 1;
+               if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+               {
+                       inv_numkilled += 1;
+                       inv_maxcurrent -= 1;
+               }
                if(teamplay) { inv_monsters_perteam[frag_target.team] -= 1; }
 
                if(IS_PLAYER(frag_attacker))
                if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
-                       PlayerScore_Add(frag_attacker, SP_KILLS, -1);
+                       GameRules_scoring_add(frag_attacker, KILLS, -1);
                else
                {
-                       PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+                       GameRules_scoring_add(frag_attacker, KILLS, +1);
                        if(teamplay)
                                TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
                }
@@ -347,6 +443,10 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
 MUTATOR_HOOKFUNCTION(inv, MonsterSpawn)
 {
        entity mon = M_ARGV(0, entity);
+       mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
+
+       if(autocvar_g_invasion_type == INV_TYPE_HUNT)
+               return false; // allowed
 
        if(!(mon.spawnflags & MONSTERFLAG_SPAWNED))
                return true;
@@ -361,29 +461,20 @@ MUTATOR_HOOKFUNCTION(inv, MonsterSpawn)
 
        if((get_monsterinfo(mon.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
                Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
-
-       mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
-}
-
-MUTATOR_HOOKFUNCTION(inv, OnEntityPreSpawn)
-{
-       entity ent = M_ARGV(0, entity);
-
-       // TODO: allow these as "rogues" or something
-       if(startsWith(ent.classname, "monster_"))
-       if(!(ent.spawnflags & MONSTERFLAG_SPAWNED))
-               return true;
 }
 
 MUTATOR_HOOKFUNCTION(inv, SV_StartFrame)
 {
+       if(autocvar_g_invasion_type != INV_TYPE_ROUND)
+               return; // uses map spawned monsters
+
        monsters_total = inv_maxspawned; // TODO: make sure numspawned never exceeds maxspawned
        monsters_killed = inv_numkilled;
 }
 
 MUTATOR_HOOKFUNCTION(inv, PlayerRegen)
 {
-       // no regeneration in invasion
+       // no regeneration in invasion, regardless of the game type
        return true;
 }
 
@@ -413,28 +504,6 @@ MUTATOR_HOOKFUNCTION(inv, Damage_Calculate)
        }
 }
 
-MUTATOR_HOOKFUNCTION(inv, SV_ParseClientCommand)
-{
-       if(MUTATOR_RETURNVALUE) // command was already handled?
-               return;
-
-       entity player = M_ARGV(0, entity);
-       string cmd_name = M_ARGV(1, string);
-
-       if(cmd_name == "debuginvasion")
-       {
-               sprint(player, strcat("inv_maxspawned = ", ftos(inv_maxspawned), "\n"));
-               sprint(player, strcat("inv_numspawned = ", ftos(inv_numspawned), "\n"));
-               sprint(player, strcat("inv_numkilled = ", ftos(inv_numkilled), "\n"));
-               sprint(player, strcat("inv_roundcnt = ", ftos(inv_roundcnt), "\n"));
-               sprint(player, strcat("monsters_total = ", ftos(monsters_total), "\n"));
-               sprint(player, strcat("monsters_killed = ", ftos(monsters_killed), "\n"));
-               sprint(player, strcat("inv_monsterskill = ", ftos(inv_monsterskill), "\n"));
-
-               return true;
-       }
-}
-
 MUTATOR_HOOKFUNCTION(inv, BotShouldAttack)
 {
        entity targ = M_ARGV(1, entity);
@@ -445,8 +514,11 @@ MUTATOR_HOOKFUNCTION(inv, BotShouldAttack)
 
 MUTATOR_HOOKFUNCTION(inv, SetStartItems)
 {
-       start_health = 200;
-       start_armorvalue = 200;
+       if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+       {
+               start_health = 200;
+               start_armorvalue = 200;
+       }
 }
 
 MUTATOR_HOOKFUNCTION(inv, AccuracyTargetValid)
@@ -465,6 +537,15 @@ MUTATOR_HOOKFUNCTION(inv, AllowMobSpawning)
        return true;
 }
 
+MUTATOR_HOOKFUNCTION(inv, CheckRules_World)
+{
+       if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+               return false;
+
+       M_ARGV(0, float) = WinningCondition_Invasion();
+       return true;
+}
+
 MUTATOR_HOOKFUNCTION(inv, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
 {
        M_ARGV(0, float) = invasion_teams;
@@ -479,24 +560,23 @@ MUTATOR_HOOKFUNCTION(inv, AllowMobButcher)
 void invasion_ScoreRules(int inv_teams)
 {
        if(inv_teams) { CheckAllowedTeams(NULL); }
-       ScoreRules_basics(inv_teams, 0, 0, false);
-       if(inv_teams) ScoreInfo_SetLabel_TeamScore(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY));
-       ScoreRules_basics_end();
+       GameRules_score_enabled(false);
+       GameRules_scoring(inv_teams, 0, 0, {
+           if (inv_teams) {
+            field_team(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY);
+           }
+           field(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY));
+       });
 }
 
 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_type == INV_TYPE_HUNT || autocvar_g_invasion_type == INV_TYPE_STAGE)
+               cvar_set("fraglimit", "0");
+
        if(autocvar_g_invasion_teams)
        {
-               invasion_teams = bound(2, autocvar_g_invasion_teams, 4);
-               int teams = 0;
-               if(invasion_teams >= 1) teams |= BIT(0);
-               if(invasion_teams >= 2) teams |= BIT(1);
-               if(invasion_teams >= 3) teams |= BIT(2);
-               if(invasion_teams >= 4) teams |= BIT(3);
-
-               invasion_teams = teams; // now set it?
+               invasion_teams = BITS(bound(2, autocvar_g_invasion_teams, 4));
        }
        else
                invasion_teams = 0;
@@ -507,11 +587,14 @@ void invasion_DelayedInit(entity this) // Do this check with a delay so we can w
 
        independent_players = 0;
 
-       round_handler_Spawn(Invasion_CheckPlayers, Invasion_CheckWinner, Invasion_RoundStart);
-       round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit);
+       if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+       {
+               round_handler_Spawn(Invasion_CheckPlayers, Invasion_CheckWinner, Invasion_RoundStart);
+               round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit);
 
-       inv_roundcnt = 0;
-       inv_maxrounds = 15; // 15?
+               inv_roundcnt = 0;
+               inv_maxrounds = 15; // 15?
+       }
 }
 
 void invasion_Initialize()
index e934f8745a4e29bfbcee542ee2c9b1793ea815df..0ea0e82c4c8266ad31bff1db48f2ceeb6be03416 100644 (file)
@@ -4,43 +4,26 @@
 
 #define autocvar_g_invasion_point_limit cvar("g_invasion_point_limit")
 int autocvar_g_invasion_teams;
+int autocvar_g_invasion_type;
 bool autocvar_g_invasion_team_spawns;
 bool g_invasion;
 void invasion_Initialize();
 
 REGISTER_MUTATOR(inv, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               g_invasion = true;
-               invasion_Initialize();
-
-               cvar_settemp("g_monsters", "1");
-
-               SetLimits(autocvar_g_invasion_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
-               if (autocvar_g_invasion_teams >= 2)
-               {
-                       ActivateTeamplay();
-                       if (autocvar_g_invasion_team_spawns)
-                               have_team_spawns = -1; // request team spawns
+               if (autocvar_g_invasion_teams >= 2) {
+                       GameRules_teams(true);
+                       GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
                }
-       }
+        GameRules_limit_score(autocvar_g_invasion_point_limit);
 
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back invasion_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               g_invasion = true;
+               cvar_settemp("g_monsters", "1");
+               invasion_Initialize();
        }
-
        return 0;
 }
 
@@ -58,3 +41,7 @@ float inv_monsters_perteam[17];
 float inv_monsterskill;
 
 const float ST_INV_KILLS = 1;
+
+const int INV_TYPE_ROUND = 0; // round-based waves of enemies
+const int INV_TYPE_HUNT = 1; // clear the map of placed enemies
+const int INV_TYPE_STAGE = 2; // reach the end of the level
index c28fd5eb8e7eab4f30378ad5fdaeccc2b84dc909..7b33bea6f374dd585755e6a31f572830b514b73d 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <common/effects/all.qh>
 
+.entity ballcarried;
+
 int autocvar_g_keepaway_ballcarrier_effects;
 float autocvar_g_keepaway_ballcarrier_damage;
 float autocvar_g_keepaway_ballcarrier_force;
@@ -76,9 +78,9 @@ void ka_TimeScoring(entity this)
        if(this.owner.ballcarried)
        { // add points for holding the ball after a certain amount of time
                if(autocvar_g_keepaway_score_timepoints)
-                       PlayerScore_Add(this.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
+                       GameRules_scoring_add(this.owner, SCORE, autocvar_g_keepaway_score_timepoints);
 
-               PlayerScore_Add(this.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
+               GameRules_scoring_add(this.owner, KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
                this.nextthink = time + autocvar_g_keepaway_score_timeinterval;
        }
 }
@@ -105,6 +107,7 @@ void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball c
        // attach the ball to the player
        this.owner = toucher;
        toucher.ballcarried = this;
+       GameRules_scoring_vip(toucher, true);
        setattachment(this, toucher, "");
        setorigin(this, '0 0 0');
 
@@ -131,7 +134,7 @@ void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball c
        sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 
        // scoring
-       PlayerScore_Add(toucher, SP_KEEPAWAY_PICKUPS, 1);
+       GameRules_scoring_add(toucher, KEEPAWAY_PICKUPS, 1);
 
        // waypoints
        WaypointSprite_AttachCarrier(WP_KaBallCarrier, toucher, RADARICON_FLAGCARRIER);
@@ -159,8 +162,9 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ball.effects &= ~EF_NODRAW;
        setorigin(ball, plyr.origin + '0 0 10');
        ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
-       ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
-       ball.owner = NULL;
+       entity e = ball.owner; ball.owner = NULL;
+       e.ballcarried = NULL;
+       GameRules_scoring_vip(e, false);
        navigation_dynamicgoal_set(ball);
 
        // reset the player effects
@@ -174,7 +178,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        sound(NULL, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 
        // scoring
-       // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
+       // GameRules_scoring_add(plyr, KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
 
        // waypoints
        WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
@@ -282,16 +286,16 @@ MUTATOR_HOOKFUNCTION(ka, PlayerDies)
        if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
        {
                if(frag_target.ballcarried) { // add to amount of times killing carrier
-                       PlayerScore_Add(frag_attacker, SP_KEEPAWAY_CARRIERKILLS, 1);
+                       GameRules_scoring_add(frag_attacker, KEEPAWAY_CARRIERKILLS, 1);
                        if(autocvar_g_keepaway_score_bckill) // add bckills to the score
-                               PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_bckill);
+                               GameRules_scoring_add(frag_attacker, SCORE, autocvar_g_keepaway_score_bckill);
                }
                else if(!frag_attacker.ballcarried)
                        if(autocvar_g_keepaway_noncarrier_warn)
                                Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
 
                if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
-                       PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
+                       GameRules_scoring_add(frag_attacker, SCORE, autocvar_g_keepaway_score_killac);
        }
 
        if(frag_target.ballcarried) { ka_DropEvent(frag_target); } // a player with the ball has died, drop it
@@ -441,12 +445,12 @@ MUTATOR_HOOKFUNCTION(ka, DropSpecialItems)
 // Initialization
 // ==============
 
+MODEL(KA_BALL, "models/orbs/orbblue.md3");
+
 void ka_SpawnBall() // loads various values for the ball, runs only once at start of match
 {
        entity e = new(keepawayball);
-       e.model = "models/orbs/orbblue.md3";
-       precache_model(e.model);
-       _setmodel(e, e.model);
+       setmodel(e, MDL_KA_BALL);
        setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
        e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
        e.takedamage = DAMAGE_YES;
@@ -466,17 +470,7 @@ void ka_SpawnBall() // loads various values for the ball, runs only once at star
        InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
 }
 
-void ka_ScoreRules()
-{
-       ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, true); // SFL_SORT_PRIO_PRIMARY
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS,             "pickups",              0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_CARRIERKILLS,   "bckills",           0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_BCTIME,                  "bctime",           SFL_SORT_PRIO_SECONDARY);
-       ScoreRules_basics_end();
-}
-
 void ka_Initialize() // run at the start of a match, initiates game mode
 {
-       ka_ScoreRules();
        ka_SpawnBall();
 }
index a13ab83a555089681bd43974e221421980665c14..abbabbd5bbf16202cc68a23ab69d5fc65af4a584 100644 (file)
@@ -6,26 +6,17 @@ void ka_Initialize();
 
 REGISTER_MUTATOR(ka, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               ka_Initialize();
-       }
-
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back ka_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
+           GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
+            field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
+            field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
+            field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
+        });
 
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               ka_Initialize();
        }
-
        return false;
 }
 
index d32df0f59058cde75fa8e55f132914ecb210b539..15b6e0f4a6251d81a94d9501858abca0ee0ae602 100644 (file)
@@ -85,18 +85,18 @@ int kh_key_dropped, kh_key_carried;
 
 int kh_Key_AllOwnedByWhichTeam();
 
-const float ST_KH_CAPS = 1;
+const int ST_KH_CAPS = 1;
 void kh_ScoreRules(int teams)
 {
-       ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
-       ScoreInfo_SetLabel_TeamScore(  ST_KH_CAPS,      "caps",      SFL_SORT_PRIO_SECONDARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS,      "caps",      SFL_SORT_PRIO_SECONDARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES,    "pushes",    0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS,  "destroyed", SFL_LOWER_IS_BETTER);
-       ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS,   "pickups",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS,   "kckills",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES,    "losses",    SFL_LOWER_IS_BETTER);
-       ScoreRules_basics_end();
+       GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+        field_team(ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+        field(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+        field(SP_KH_PUSHES, "pushes", 0);
+        field(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
+        field(SP_KH_PICKUPS, "pickups", 0);
+        field(SP_KH_KCKILLS, "kckills", 0);
+        field(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
+       });
 }
 
 bool kh_KeyCarrier_waypointsprite_visible_for_player(entity this, entity player, entity view)  // runs all the time
@@ -441,7 +441,7 @@ void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped ke
        if(key.kh_dropperteam != player.team)
        {
                kh_Scores_Event(player, key, "collect", autocvar_g_balance_keyhunt_score_collect, 0);
-               PlayerScore_Add(player, SP_KH_PICKUPS, 1);
+               GameRules_scoring_add(player, KH_PICKUPS, 1);
        }
        key.kh_dropperteam = 0;
        int realteam = kh_Team_ByID(key.count);
@@ -534,7 +534,7 @@ void kh_WinnerTeam(int winner_team)  // runs when a team wins
        {
                float f = DistributeEvenly_Get(1);
                kh_Scores_Event(key.owner, key, "capture", f, 0);
-               PlayerTeamScore_Add(key.owner, SP_KH_CAPS, ST_KH_CAPS, 1);
+               GameRules_scoring_add_team(key.owner, KH_CAPS, 1);
                nades_GiveBonus(key.owner, autocvar_g_nades_bonus_score_high);
        }
 
@@ -593,7 +593,7 @@ void kh_LoserTeam(int loser_team, entity lostkey)  // runs when a player pushes
                        kh_Scores_Event(lostkey.kh_previous_owner, NULL, "pushed", 0, -autocvar_g_balance_keyhunt_score_push);
                        // don't actually GIVE him the -nn points, just log
                kh_Scores_Event(attacker, NULL, "push", autocvar_g_balance_keyhunt_score_push, 0);
-               PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
+               GameRules_scoring_add(attacker, KH_PUSHES, 1);
                //centerprint(attacker, "Your push is the best!"); // does this really need to exist?
        }
        else
@@ -614,7 +614,7 @@ void kh_LoserTeam(int loser_team, entity lostkey)  // runs when a player pushes
                        // don't actually GIVE him the -nn points, just log
 
                if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid)
-                       PlayerScore_Add(lostkey.kh_previous_owner, SP_KH_DESTROYS, 1);
+                       GameRules_scoring_add(lostkey.kh_previous_owner, KH_DESTROYS, 1);
 
                DistributeEvenly_Init(autocvar_g_balance_keyhunt_score_destroyed, keys * of + players);
 
@@ -809,7 +809,7 @@ void kh_Key_DropOne(entity key)
        key.enemy = player;
 
        kh_Scores_Event(player, key, "dropkey", 0, 0);
-       PlayerScore_Add(player, SP_KH_LOSSES, 1);
+       GameRules_scoring_add(player, KH_LOSSES, 1);
        int realteam = kh_Team_ByID(key.count);
        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_DROP), player.netname);
 
@@ -836,7 +836,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                while((key = player.kh_next))
                {
                        kh_Scores_Event(player, key, "losekey", 0, 0);
-                       PlayerScore_Add(player, SP_KH_LOSSES, 1);
+                       GameRules_scoring_add(player, KH_LOSSES, 1);
                        int realteam = kh_Team_ByID(key.count);
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_LOST), player.netname);
                        kh_Key_AssignTo(key, NULL);
@@ -972,7 +972,7 @@ float kh_HandleFrags(entity attacker, entity targ, float f)  // adds to the play
                else
                {
                        kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", autocvar_g_balance_keyhunt_score_carrierfrag-1, 0);
-                       PlayerScore_Add(attacker, SP_KH_KCKILLS, 1);
+                       GameRules_scoring_add(attacker, KH_KCKILLS, 1);
                        // the frag gets added later
                }
        }
@@ -986,15 +986,7 @@ void kh_Initialize()  // sets up th KH environment
        kh_teams = autocvar_g_keyhunt_teams_override;
        if(kh_teams < 2)
                kh_teams = cvar("g_keyhunt_teams"); // read the cvar directly as it gets written earlier in the same frame
-       kh_teams = bound(2, kh_teams, 4);
-
-       int teams = 0;
-       if(kh_teams >= 1) teams |= BIT(0);
-       if(kh_teams >= 2) teams |= BIT(1);
-       if(kh_teams >= 3) teams |= BIT(2);
-       if(kh_teams >= 4) teams |= BIT(3);
-
-       kh_teams = teams; // now set it?
+       kh_teams = BITS(bound(2, kh_teams, 4));
 
        // make a KH entity for controlling the game
        kh_controller = spawn();
index d0fb5f95bc2ff0c455a96da9900932b586e75e8f..77d7c06fcf055fa1e5d83da36767e23a10688746 100644 (file)
@@ -9,31 +9,16 @@ void kh_Initialize();
 
 REGISTER_MUTATOR(kh, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               kh_Initialize();
-
-               ActivateTeamplay();
-               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
-       }
+               GameRules_teams(true);
+        GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
+        GameRules_limit_score(autocvar_g_keyhunt_point_limit);
+        GameRules_limit_lead(autocvar_g_keyhunt_point_leadlimit);
 
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back kh_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               kh_Initialize();
        }
-
        return 0;
 }
 
index 158492cd3bc58c22e9cca7138aa13e3ea81c37b9..4d6f70438583b0f805b40070754e303b1a3f4726 100644 (file)
@@ -71,7 +71,7 @@ int WinningCondition_LMS()
                        {
                                // a winner!
                                // and assign him his first place
-                               PlayerScore_Add(head, SP_LMS_RANK, 1);
+                               GameRules_scoring_add(head, LMS_RANK, 1);
                                if(warmup_stage)
                                        return WINNING_NO;
                                else
@@ -120,7 +120,7 @@ MUTATOR_HOOKFUNCTION(lms, reset_map_players)
        FOREACH_CLIENT(true, {
                TRANSMUTE(Player, it);
                it.frags = FRAGS_PLAYER;
-               PlayerScore_Add(it, SP_LMS_LIVES, LMS_NewPlayerLives());
+               GameRules_scoring_add(it, LMS_LIVES, LMS_NewPlayerLives());
                PutClientInServer(it);
        });
 }
@@ -133,13 +133,13 @@ MUTATOR_HOOKFUNCTION(lms, PutClientInServer)
                TRANSMUTE(Observer, player);
        else
        {
-               float tl = PlayerScore_Add(player, SP_LMS_LIVES, 0);
+               float tl = GameRules_scoring_add(player, LMS_LIVES, 0);
                if(tl < lms_lowest_lives)
                        lms_lowest_lives = tl;
                if(tl <= 0)
                        TRANSMUTE(Observer, player);
                if(warmup_stage)
-                       PlayerScore_Add(player, SP_LMS_RANK, -PlayerScore_Add(player, SP_LMS_RANK, 0));
+                       GameRules_scoring_add(player, LMS_RANK, -GameRules_scoring_add(player, LMS_RANK, 0));
        }
 }
 
@@ -151,7 +151,7 @@ MUTATOR_HOOKFUNCTION(lms, ForbidSpawn)
                return false;
        if(player.frags == FRAGS_SPECTATOR)
                return true;
-       if(PlayerScore_Add(player, SP_LMS_LIVES, 0) <= 0)
+       if(GameRules_scoring_add(player, LMS_LIVES, 0) <= 0)
        {
                Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_LMS_NOLIVES);
                return true;
@@ -169,7 +169,7 @@ MUTATOR_HOOKFUNCTION(lms, PlayerDies)
 void lms_RemovePlayer(entity player)
 {
        static int quitters = 0;
-       float player_rank = PlayerScore_Add(player, SP_LMS_RANK, 0);
+       float player_rank = GameRules_scoring_add(player, LMS_RANK, 0);
        if (!player_rank)
        {
                int pl_cnt = 0;
@@ -179,7 +179,7 @@ void lms_RemovePlayer(entity player)
                        if(IS_BOT_CLIENT(player))
                                bot_clear(player);
                        player.frags = FRAGS_LMS_LOSER;
-                       PlayerScore_Add(player, SP_LMS_RANK, pl_cnt + 1);
+                       GameRules_scoring_add(player, LMS_RANK, pl_cnt + 1);
                }
                else
                {
@@ -187,22 +187,22 @@ void lms_RemovePlayer(entity player)
                        FOREACH_CLIENT(true, {
                                if (it.frags == FRAGS_LMS_LOSER)
                                {
-                                       float it_rank = PlayerScore_Add(it, SP_LMS_RANK, 0);
+                                       float it_rank = GameRules_scoring_add(it, LMS_RANK, 0);
                                        if (it_rank > player_rank && it_rank <= 256)
-                                               PlayerScore_Add(it, SP_LMS_RANK, -1);
+                                               GameRules_scoring_add(it, LMS_RANK, -1);
                                        lms_lowest_lives = 0;
                                }
                                else if (it.frags != FRAGS_SPECTATOR)
                                {
-                                       float tl = PlayerScore_Add(it, SP_LMS_LIVES, 0);
+                                       float tl = GameRules_scoring_add(it, LMS_LIVES, 0);
                                        if(tl < lms_lowest_lives)
                                                lms_lowest_lives = tl;
                                }
                        });
-                       PlayerScore_Add(player, SP_LMS_RANK, 665 - quitters); // different from 666
+                       GameRules_scoring_add(player, LMS_RANK, 665 - quitters); // different from 666
                        if(!warmup_stage)
                        {
-                               PlayerScore_Add(player, SP_LMS_LIVES, -PlayerScore_Add(player, SP_LMS_LIVES, 0));
+                               GameRules_scoring_add(player, LMS_LIVES, -GameRules_scoring_add(player, LMS_LIVES, 0));
                                ++quitters;
                        }
                        player.frags = FRAGS_LMS_LOSER;
@@ -213,7 +213,7 @@ void lms_RemovePlayer(entity player)
        }
 
        if(CS(player).killcount != FRAGS_SPECTATOR)
-               if(PlayerScore_Add(player, SP_LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
+               if(GameRules_scoring_add(player, LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
                else
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_FORFEIT, player.netname);
@@ -241,9 +241,9 @@ MUTATOR_HOOKFUNCTION(lms, ClientConnect)
        TRANSMUTE(Player, player);
        campaign_bots_may_start = true;
 
-       if(PlayerScore_Add(player, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
+       if(GameRules_scoring_add(player, LMS_LIVES, LMS_NewPlayerLives()) <= 0)
        {
-               PlayerScore_Add(player, SP_LMS_RANK, 666); // mark as forced spectator for the hud code
+               GameRules_scoring_add(player, LMS_RANK, 666); // mark as forced spectator for the hud code
                player.frags = FRAGS_SPECTATOR;
        }
 }
@@ -276,7 +276,7 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
        if (!warmup_stage)
        {
                // remove a life
-               int tl = PlayerScore_Add(frag_target, SP_LMS_LIVES, -1);
+               int tl = GameRules_scoring_add(frag_target, LMS_LIVES, -1);
                if(tl < lms_lowest_lives)
                        lms_lowest_lives = tl;
                if(tl <= 0)
@@ -286,7 +286,7 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
                        if(IS_BOT_CLIENT(frag_target))
                                bot_clear(frag_target);
                        frag_target.frags = FRAGS_LMS_LOSER;
-                       PlayerScore_Add(frag_target, SP_LMS_RANK, pl_cnt);
+                       GameRules_scoring_add(frag_target, LMS_RANK, pl_cnt);
                }
        }
        M_ARGV(2, float) = 0; // frag score
@@ -358,7 +358,7 @@ MUTATOR_HOOKFUNCTION(lms, ItemTouch)
        if(item.itemdef == ITEM_ExtraLife)
        {
                Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_EXTRALIVES);
-               PlayerScore_Add(toucher, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
+               GameRules_scoring_add(toucher, LMS_LIVES, autocvar_g_lms_extra_lives);
                return MUT_ITEMTOUCH_PICKUP;
        }
 
@@ -419,18 +419,7 @@ MUTATOR_HOOKFUNCTION(lms, AddPlayerScore)
                return true; // allow writing to this field in intermission as it is needed for newly joining players
 }
 
-// scoreboard stuff
-void lms_ScoreRules()
-{
-       ScoreRules_basics(0, 0, 0, false);
-       ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES,    "lives",     SFL_SORT_PRIO_SECONDARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK,     "rank",      SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
-       ScoreRules_basics_end();
-}
-
 void lms_Initialize()
 {
        lms_lowest_lives = 9999;
-
-       lms_ScoreRules();
 }
index 1f1d2d4c3419654509a7d402f42fe41cbbdaa3ea..c69113a0c2188b0d711d19cf4f52f875b7456427 100644 (file)
@@ -8,28 +8,19 @@ void lms_Initialize();
 
 REGISTER_MUTATOR(lms, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       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, autocvar_timelimit_override, -1);
-       }
+        GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
+        GameRules_limit_lead(0);
+        GameRules_score_enabled(false);
+        GameRules_scoring(0, 0, 0, {
+            field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
+            field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
+        });
 
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back lms_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               lms_Initialize();
        }
-
        return 0;
 }
 
index 7628968ed6503a3cab71e0c5373f194a831aa60f..2f581d8c433af0c6b8047e71ab7571825eb7ceba 100644 (file)
@@ -37,25 +37,21 @@ void havocbot_role_race(entity this)
 
 void race_ScoreRules()
 {
-       ScoreRules_basics(race_teams, 0, 0, false);
-       if(race_teams)
-       {
-               ScoreInfo_SetLabel_TeamScore(  ST_RACE_LAPS,    "laps",       SFL_SORT_PRIO_PRIMARY);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS,    "laps",      SFL_SORT_PRIO_PRIMARY);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME,    "time",      SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest",   SFL_LOWER_IS_BETTER | SFL_TIME);
-       }
-       else if(g_race_qualifying)
-       {
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest",   SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
-       }
-       else
-       {
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS,    "laps",      SFL_SORT_PRIO_PRIMARY);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME,    "time",      SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
-               ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest",   SFL_LOWER_IS_BETTER | SFL_TIME);
-       }
-       ScoreRules_basics_end();
+    GameRules_score_enabled(false);
+       GameRules_scoring(race_teams, 0, 0, {
+        if (race_teams) {
+            field_team(ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+            field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+            field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+            field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
+        } else if (g_race_qualifying) {
+            field(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+        } else {
+            field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+            field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+            field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
+        }
+       });
 }
 
 void race_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
@@ -201,7 +197,7 @@ MUTATOR_HOOKFUNCTION(rc, reset_map_global)
        FOREACH_CLIENT(true, {
                if(it.race_place)
                {
-                       s = PlayerScore_Add(it, SP_RACE_FASTEST, 0);
+                       s = GameRules_scoring_add(it, RACE_FASTEST, 0);
                        if(!s)
                                it.race_place = 0;
                }
@@ -251,7 +247,7 @@ MUTATOR_HOOKFUNCTION(rc, MakePlayerObserver)
        entity player = M_ARGV(0, entity);
 
        if(g_race_qualifying)
-       if(PlayerScore_Add(player, SP_RACE_FASTEST, 0))
+       if(GameRules_scoring_add(player, RACE_FASTEST, 0))
                player.frags = FRAGS_LMS_LOSER;
        else
                player.frags = FRAGS_SPECTATOR;
@@ -443,17 +439,8 @@ void rc_SetLimits()
 
        if(autocvar_g_race_teams)
        {
-               ActivateTeamplay();
-               race_teams = bound(2, autocvar_g_race_teams, 4);
-               int teams = 0;
-               if(race_teams >= 1) teams |= BIT(0);
-               if(race_teams >= 2) teams |= BIT(1);
-               if(race_teams >= 3) teams |= BIT(2);
-               if(race_teams >= 4) teams |= BIT(3);
-
-               race_teams = teams; // now set it?
-
-               have_team_spawns = -1; // request team spawns
+               GameRules_teams(true);
+               race_teams = BITS(bound(2, autocvar_g_race_teams, 4));
        }
        else
                race_teams = 0;
@@ -484,5 +471,8 @@ void rc_SetLimits()
        }
        else
                g_race_qualifying = 0;
-       SetLimits(fraglimit_override, leadlimit_override, timelimit_override, qualifying_override);
+    GameRules_limit_score(fraglimit_override);
+    GameRules_limit_lead(leadlimit_override);
+    GameRules_limit_time(timelimit_override);
+    GameRules_limit_time_qualifying(qualifying_override);
 }
index ec71a62d178483d2277228801751f147d721504d..1e475e3ce6f76988ba28f50f1e74e6afb92049de 100644 (file)
@@ -7,27 +7,12 @@ void race_Initialize();
 
 REGISTER_MUTATOR(rc, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-
                rc_SetLimits();
-               race_Initialize();
-       }
 
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back race_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               race_Initialize();
        }
-
        return 0;
 }
index 101f57fcc4d6efb96ecd5d2ed5157b0065c29060..aad31932884556dff7b4a7b6f1a186dcbf15e44c 100644 (file)
@@ -36,16 +36,9 @@ void tdm_DelayedInit(entity this)
                LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.");
 
                int numteams = autocvar_g_tdm_teams_override;
-
                if(numteams < 2) { numteams = autocvar_g_tdm_teams; }
-               numteams = bound(2, numteams, 4);
-
-               int teams = 0;
-               if(numteams >= 1) teams |= BIT(0);
-               if(numteams >= 2) teams |= BIT(1);
-               if(numteams >= 3) teams |= BIT(2);
-               if(numteams >= 4) teams |= BIT(3);
 
+               int teams = BITS(bound(2, numteams, 4));
                if(teams & BIT(0))
                        tdm_SpawnTeam("Red", NUM_TEAM_1);
                if(teams & BIT(1))
index e7efbae7f5b13a9930a3a0523f61dc9d5fe0b6b6..c163962faf1b71c1cad060af1b9d7f8554ffec02 100644 (file)
@@ -9,30 +9,15 @@ void tdm_DelayedInit(entity this);
 
 REGISTER_MUTATOR(tdm, false)
 {
+    MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               if (time > 1) // game loads at time 1
-                       error("This is a game type and it cannot be added at runtime.");
-               InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
-
-               ActivateTeamplay();
-               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
-       }
+               GameRules_teams(true);
+        GameRules_spawning_teams(autocvar_g_tdm_team_spawns);
+               GameRules_limit_score(autocvar_g_tdm_point_limit);
+        GameRules_limit_lead(autocvar_g_tdm_point_leadlimit);
 
-       MUTATOR_ONROLLBACK_OR_REMOVE
-       {
-               // we actually cannot roll back tdm_Initialize here
-               // BUT: we don't need to! If this gets called, adding always
-               // succeeds.
-       }
-
-       MUTATOR_ONREMOVE
-       {
-               LOG_INFO("This is a game type and it cannot be removed at runtime.");
-               return -1;
+               InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
        }
-
        return 0;
 }
index 9ac2249a234b50bd1bbf33dab9d2739dd433b1c3..44a877791b19673f539ac4dd065ffe5eaafa032f 100644 (file)
@@ -22,7 +22,7 @@
 #include "../common/minigames/sv_minigames.qh"
 
 #include "../common/physics/player.qh"
-#include "../common/effects/qc/all.qh"
+#include "../common/effects/qc/_mod.qh"
 #include "../common/mutators/mutator/waypoints/waypointsprites.qh"
 #include "../common/triggers/include.qh"
 #include "../common/wepent.qh"
@@ -472,10 +472,10 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        if (this != attacker) {
                float realdmg = damage - excess;
                if (IS_PLAYER(attacker)) {
-                       PlayerScore_Add(attacker, SP_DMG, realdmg);
+                       GameRules_scoring_add(attacker, DMG, realdmg);
                }
                if (IS_PLAYER(this)) {
-                       PlayerScore_Add(this, SP_DMGTAKEN, realdmg);
+                       GameRules_scoring_add(this, DMGTAKEN, realdmg);
                }
        }
 
@@ -939,7 +939,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
        }
 
        if(flood)
-               LOG_INFO("NOTE: ", playername(source, true), "^7 is flooding.\n");
+               LOG_INFO("NOTE: ", playername(source, true), "^7 is flooding.");
 
        // build sourcemsgstr by cutting off a prefix and replacing it by the other one
        if(privatesay)
index e337e9be478c8112ced3a6bbc55aae446a9dbd0c..411d826a87c1f7fb3d309b64f144a50c0f584a0e 100644 (file)
@@ -22,7 +22,7 @@ void playerdemo_shutdown(entity this)
 {
        if(this.playerdemo_mode != PLAYERDEMO_MODE_OFF)
        {
-               LOG_INFO("playerdemo: ", this.netname, " closed\n");
+               LOG_INFO("playerdemo: ", this.netname, " closed");
                fclose(this.playerdemo_fh);
        }
        this.playerdemo_mode = 0;
@@ -36,7 +36,7 @@ void playerdemo_open_read(entity this, string f)
        this.playerdemo_time = stof(fgets(this.playerdemo_fh));
        this.playerdemo_time += this.playerdemo_starttime;
        set_movetype(this, MOVETYPE_NONE);
-       LOG_INFO("playerdemo: ", this.netname, " reading from ", f, "\n");
+       LOG_INFO("playerdemo: ", this.netname, " reading from ", f);
 }
 void playerdemo_open_write(entity this, string f)
 {
@@ -44,8 +44,8 @@ void playerdemo_open_write(entity this, string f)
        this.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
        this.playerdemo_fh = fopen(f, FILE_WRITE);
        this.playerdemo_starttime = time - 1;
-       LOG_INFO("playerdemo: ", this.netname, " writing to ", f, "\n");
-       LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!\n");
+       LOG_INFO("playerdemo: ", this.netname, " writing to ", f);
+       LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!");
 }
 #define PLAYERDEMO_FIELD(ent,func,t,f) func##t(ent,f,#f);
 #define PLAYERDEMO_FIELDS(ent,func) \
index 6de3e0af39fc0e16840ae692f4b13548ca83b755..20039cfcc8205c83f784012c01a286cdfc531e50 100644 (file)
@@ -149,7 +149,7 @@ float Portal_TeleportPlayer(entity teleporter, entity player)
        tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, step, MOVE_NOMONSTERS, player);
        if(trace_startsolid)
        {
-               LOG_INFO("'safe' teleport location is not safe!\n");
+               LOG_INFO("'safe' teleport location is not safe!");
                // FAIL TODO why does this happen?
                return 0;
        }
@@ -157,7 +157,7 @@ float Portal_TeleportPlayer(entity teleporter, entity player)
        tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, to, MOVE_NOMONSTERS, player);
        if(trace_startsolid)
        {
-               LOG_INFO("trace_endpos in solid, this can't be!\n");
+               LOG_INFO("trace_endpos in solid, this can't be!");
                // FAIL TODO why does this happen? (reported by MrBougo)
                return 0;
        }
@@ -216,7 +216,7 @@ float Portal_FindSafeOrigin(entity portal)
        if(!move_out_of_solid(portal))
        {
 #ifdef DEBUG
-               LOG_INFO("NO SAFE ORIGIN\n");
+               LOG_INFO("NO SAFE ORIGIN");
 #endif
                return 0;
        }
index f72ff8533f57555adc4e0a49526f59ab07b8b463..fd0b0c99e2d60dc5f382747a860548a706b12017 100644 (file)
@@ -5,7 +5,7 @@
 #include <server/_mod.inc>
 
 #include <common/_all.inc>
-#include <common/effects/qc/all.qc>
+#include <common/effects/qc/_mod.inc>
 
 #include <lib/csqcmodel/sv_model.qc>
 
index 7f2aaaaf58739f8d040460df84e6667340cf93ff..6fc828dc9459ec85cd59d32ee04ac54656196da4 100644 (file)
@@ -11,6 +11,7 @@
 #include "../common/deathtypes/all.qh"
 #include "../common/notifications/all.qh"
 #include "../common/mapinfo.qh"
+#include <common/gamemodes/rules.qh>
 #include <common/net_linked.qh>
 #include <common/state.qh>
 #include "../common/triggers/subs.qh"
@@ -386,20 +387,20 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                float s;
                if(g_race_qualifying)
                {
-                       s = PlayerScore_Add(e, SP_RACE_FASTEST, 0);
+                       s = GameRules_scoring_add(e, RACE_FASTEST, 0);
                        if(!s || t < s)
-                               PlayerScore_Add(e, SP_RACE_FASTEST, t - s);
+                               GameRules_scoring_add(e, RACE_FASTEST, t - s);
                }
                else
                {
-                       s = PlayerScore_Add(e, SP_RACE_FASTEST, 0);
+                       s = GameRules_scoring_add(e, RACE_FASTEST, 0);
                        if(!s || t < s)
-                               PlayerScore_Add(e, SP_RACE_FASTEST, t - s);
+                               GameRules_scoring_add(e, RACE_FASTEST, t - s);
 
-                       s = PlayerScore_Add(e, SP_RACE_TIME, 0);
+                       s = GameRules_scoring_add(e, RACE_TIME, 0);
                        snew = TIME_ENCODE(time - game_starttime);
-                       PlayerScore_Add(e, SP_RACE_TIME, snew - s);
-                       l = PlayerTeamScore_Add(e, SP_RACE_LAPS, ST_RACE_LAPS, 1);
+                       GameRules_scoring_add(e, RACE_TIME, snew - s);
+                       l = GameRules_scoring_add_team(e, RACE_LAPS, 1);
 
                        if(autocvar_fraglimit)
                                if(l >= autocvar_fraglimit)
@@ -485,7 +486,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                entity oth = race_checkpoint_lastplayers[cp];
                if(oth)
                {
-                       mylaps = PlayerScore_Add(e, SP_RACE_LAPS, 0);
+                       mylaps = GameRules_scoring_add(e, RACE_LAPS, 0);
                        lother = race_checkpoint_lastlaps[cp];
                        othtime = race_checkpoint_lasttimes[cp];
                }
@@ -1177,7 +1178,7 @@ float race_GetFractionalLapCount(entity e)
        // links on CP entities)
 
        float l;
-       l = PlayerScore_Add(e, SP_RACE_LAPS, 0);
+       l = GameRules_scoring_add(e, RACE_LAPS, 0);
        if(CS(e).race_completed)
                return l; // not fractional
 
index fc4c19602727a34b54454836aa720c9294e8a5e4..79b65299f41e1bfa2c01d5a09e528011d5a560cd 100644 (file)
@@ -65,11 +65,6 @@ float TeamScore_GetCompareValue(float t);
  */
 float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score);
 
-/**
- * Adds to the generic score fields for both the player and the team.
- */
-#define PlayerTeamScore_AddScore(p, s) PlayerTeamScore_Add(p, SP_SCORE, ST_SCORE, s)
-
 /**
  * Set the label of a team score item, as well as the scoring flags.
  */
index 97e80409cce87cc98805b1d458f3b575c82e94da..2b539c999668bbcc5acca5304ef53100f7e37285 100644 (file)
@@ -4,6 +4,7 @@
 #include <server/miscfunctions.qh>
 #include "client.qh"
 #include "scores.qh"
+#include <common/gamemodes/rules.qh>
 
 int ScoreRules_teams;
 
@@ -57,17 +58,13 @@ void ScoreRules_basics_end()
 }
 void ScoreRules_generic()
 {
-       if(teamplay)
-       {
+    int teams = 0;
+       if (teamplay) {
                CheckAllowedTeams(NULL);
-               int teams = 0;
-               if(c1 >= 0) teams |= BIT(0);
-               if(c2 >= 0) teams |= BIT(1);
-               if(c3 >= 0) teams |= BIT(2);
-               if(c4 >= 0) teams |= BIT(3);
-               ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
+               if (c1 >= 0) teams |= BIT(0);
+               if (c2 >= 0) teams |= BIT(1);
+               if (c3 >= 0) teams |= BIT(2);
+               if (c4 >= 0) teams |= BIT(3);
        }
-       else
-               ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
-       ScoreRules_basics_end();
+       GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {});
 }
index 254e799eebfb082deb3e4a1ec2eaae3fb8a8b3f4..cd393b64196a1cbab9f0128623f3ef8be7adc612 100644 (file)
@@ -83,14 +83,15 @@ void relocate_spawnpoint(entity this)
         this.maxs = PL_MAX_CONST;
         if (!move_out_of_solid(this))
             objerror(this, "could not get out of solid at all!");
-        LOG_INFO("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));
-        LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
-        LOG_INFO(" ", ftos(this.origin.y - o.y));
-        LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+        LOG_INFOF(
+            "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
+            vtos(o - '0 0 1'),
+            vtos(this.origin - o)
+        );
         if (autocvar_g_spawnpoints_auto_move_out_of_solid)
         {
             if (!spawnpoint_nag)
-                LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
+                LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)");
             spawnpoint_nag = 1;
         }
         else
index 74dce96a2bc9a23a03a06e9a68f6d3ba34bdc6eb..1a5c8e5511420bbd00c066e37f9a641660f4ad69 100644 (file)
@@ -184,7 +184,6 @@ void StartFrame()
        if(time > client_cefc_accumulatortime + 1)
        {
                float t = client_cefc_accumulator / (time - client_cefc_accumulatortime);
-               LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
                int c_seeing = 0;
                int c_seen = 0;
                FOREACH_CLIENT(true, {
@@ -193,9 +192,11 @@ void StartFrame()
                        if(IS_PLAYER(it))
                                ++c_seen;
                });
-               LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
-               LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
-
+               LOG_INFO(
+                   "CEFC time: ", ftos(t * 1000), "ms; ",
+            "CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ",
+            "CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0')
+        );
                client_cefc_accumulatortime = time;
                client_cefc_accumulator = 0;
        }
index 793a227b897bb1d6b92a5c438184568f44e0b564..e93a03201a9ddf4233b229126b69d15bca035de6 100644 (file)
@@ -37,13 +37,6 @@ void default_delayedinit(entity this)
                ScoreRules_generic();
 }
 
-void ActivateTeamplay()
-{
-       serverflags |= SERVERFLAG_TEAMPLAY;
-       teamplay = 1;
-       cvar_set("teamplay", "2");  // DP needs this for sending proper getstatus replies.
-}
-
 void InitGameplayMode()
 {
        VoteReset();
@@ -59,13 +52,11 @@ void InitGameplayMode()
        max_shot_distance = min(230000, vlen(world.maxs - world.mins));
 
        MapInfo_LoadMapSettings(mapname);
-       serverflags &= ~SERVERFLAG_TEAMPLAY;
-       teamplay = 0;
-       cvar_set("teamplay", "0");  // DP needs this for sending proper getstatus replies.
+       GameRules_teams(false);
 
        if (!cvar_value_issafe(world.fog))
        {
-               LOG_INFO("The current map contains a potentially harmful fog setting, ignored\n");
+               LOG_INFO("The current map contains a potentially harmful fog setting, ignored");
                world.fog = string_null;
        }
        if(MapInfo_Map_fog != "")
index 127ac7a6d30caffc887e9571c40104148813eadb..8d0ea9cb8ae6d846c326fd59b66732295bf7ee6e 100644 (file)
@@ -18,8 +18,6 @@ void LogTeamchange(float player_id, float team_number, float type);
 
 void default_delayedinit(entity this);
 
-void ActivateTeamplay();
-
 void InitGameplayMode();
 
 string GetClientVersionMessage(entity this);
index b94b2533f3441a1e5955a13f54214b142e94a398..f69faa03a324de3e93d3136610a2835d9bbc781e 100644 (file)
@@ -84,14 +84,14 @@ void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this)
        this.takedamage = DAMAGE_NO;
        this.event_damage = func_null;
 
+       MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker);
+
        if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner)
        {
                this.owner = attacker;
                this.realowner = attacker;
        }
 
-       MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker);
-
        // do not explode NOW but in the NEXT FRAME!
        // because recursive calls to RadiusDamage are not allowed
        this.nextthink = time;
index 791d65915be989f9982b9d080024a860d13fab43..776d8d8d0f43800999a3b10829cb3c9c20cc2d93 100644 (file)
@@ -290,7 +290,7 @@ void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponent
 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity)
 {
        float w;
-       w = W_GetCycleWeapon(this, this.cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
+       w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
        if(w > 0)
                W_SwitchWeapon(this, Weapons_from(w), weaponentity);
 }
@@ -303,7 +303,7 @@ void W_NextWeapon(entity this, int list, .entity weaponentity)
        else if(list == 1)
                W_CycleWeapon(this, this.weaponorder_byimpulse, -1, weaponentity);
        else if(list == 2)
-               W_CycleWeapon(this, this.cvar_cl_weaponpriority, -1, weaponentity);
+               W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity);
 }
 
 // prev weapon
@@ -314,7 +314,7 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity)
        else if(list == 1)
                W_CycleWeapon(this, this.weaponorder_byimpulse, +1, weaponentity);
        else if(list == 2)
-               W_CycleWeapon(this, this.cvar_cl_weaponpriority, +1, weaponentity);
+               W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity);
 }
 
 // previously used if exists and has ammo, (second) best otherwise
index ea580e9118671e128bd03d45795e4dba6625e87c..eea33ddb7b98e71c762a7fc09f9d7f41856c7558 100644 (file)
@@ -12,7 +12,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam
 .int weaponcomplainindex;
 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
 
-#define w_getbestweapon(ent,wepent) Weapons_from(W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true, wepent))
+#define w_getbestweapon(ent,wepent) Weapons_from(W_GetCycleWeapon(ent, CS(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
 
 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
 
index f657789f8cc5f8a920f2fb096b89b7476405dcf7..bf272a01a94e02d75041436a36b2c7ce1846ddad 100644 (file)
@@ -30,7 +30,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
        float oldsolid = ent.dphitcontentsmask;
        if(!IS_CLIENT(ent))
                antilag = false; // no antilag for non-clients!
-       if (IS_PLAYER(ent) && ent.(weaponentity).m_weapon == WEP_RIFLE)
+       if (IS_PLAYER(ent) && (ent.(weaponentity).m_weapon.spawnflags & WEP_FLAG_PENETRATEWALLS))
                ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
        else
                ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
@@ -122,7 +122,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
                                        if (trace_ent == CS(ent).cursor_trace_ent)
                                                w_shotdir = normalize(CS(ent).cursor_trace_ent.origin - w_shotorg);
                                        else
-                                               LOG_INFO("antilag fail\n");
+                                               LOG_INFO("antilag fail");
                                }
                        }
                }
@@ -185,7 +185,7 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p
        #if 0
        mspercallsum += gettime(GETTIME_HIRES);
        mspercallcount += 1;
-       LOG_INFO("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
+       LOG_INFO("avg: ", ftos(mspercallcount / mspercallsum), " per sec");
        #endif
 
        proj.velocity = W_CalculateProjectileVelocity(proj.owner, proj.owner.velocity, pSpeed * dir, forceAbsolute);
index a71abe70f347f780f9c8189e7e21501ee785d50a..296d10fa6bd0bef9b26f857c6e86ed4db684b9f7 100644 (file)
@@ -49,21 +49,21 @@ void WeaponStats_ready(entity fh, entity pass, float status)
                case URL_READY_CANREAD:
                        // url_fclose is processing, we got a response for writing the data
                        // this must come from HTTP
-                       LOG_INFO("Got response from weapon stats server:\n");
+                       LOG_INFO("Got response from weapon stats server:");
                        while((s = url_fgets(fh)))
-                               LOG_INFO("  ", s, "\n");
-                       LOG_INFO("End of response.\n");
+                               LOG_INFO("  ", s);
+                       LOG_INFO("End of response.");
                        url_fclose(fh);
                        break;
                case URL_READY_CLOSED:
                        // url_fclose has finished
-                       LOG_INFO("Weapon stats written\n");
+                       LOG_INFO("Weapon stats written");
                        buf_del(weaponstats_buffer);
                        weaponstats_buffer = -1;
                        break;
                case URL_READY_ERROR:
                default:
-                       LOG_INFO("Weapon stats writing failed: ", ftos(status), "\n");
+                       LOG_INFO("Weapon stats writing failed: ", ftos(status));
                        buf_del(weaponstats_buffer);
                        weaponstats_buffer = -1;
                        break;
index 4c75471971f37b19a45c13a81e3c83be1fe4d308..bfd9808fbb13e2029972cb4c36e36114e55a1f75 100644 (file)
@@ -2,7 +2,6 @@ models/ok_nade_counter/ok_nade_counter_01
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_01"
@@ -13,7 +12,6 @@ models/ok_nade_counter/ok_nade_counter_02
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_02"
@@ -24,7 +22,6 @@ models/ok_nade_counter/ok_nade_counter_03
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_03"
@@ -35,7 +32,6 @@ models/ok_nade_counter/ok_nade_counter_04
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_04"
@@ -46,7 +42,6 @@ models/ok_nade_counter/ok_nade_counter_05
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_05"
@@ -57,7 +52,6 @@ models/ok_nade_counter/ok_nade_counter_06
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_06"
@@ -68,7 +62,6 @@ models/ok_nade_counter/ok_nade_counter_07
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_07"
@@ -79,7 +72,6 @@ models/ok_nade_counter/ok_nade_counter_08
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_08"
@@ -90,7 +82,6 @@ models/ok_nade_counter/ok_nade_counter_09
 {
        dpnoshadow
        deformVertexes autosprite
-       dppolygonoffset -6000
        nopicmip
        {
                map "models/ok_nade_counter/ok_nade_counter_09"