]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/RandomStartWeapons
authorLyberta <lyberta@lyberta.net>
Sun, 27 Aug 2017 22:54:21 +0000 (01:54 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 27 Aug 2017 22:54:21 +0000 (01:54 +0300)
148 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
defaultClient.cfg
defaultOverkill.cfg
defaultServer.cfg
defaultXonotic.cfg
mutators.cfg
qcsrc/client/bgmscript.qc
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
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/view.qc
qcsrc/common/command/generic.qc
qcsrc/common/command/rpn.qc
qcsrc/common/debug.qh
qcsrc/common/effects/effectinfo.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/minigames/minigame/bd.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/damagetext/cl_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/waypoints/waypointsprites.qc
qcsrc/common/notifications/all.qc
qcsrc/common/notifications/all.qh
qcsrc/common/physics/player.qc
qcsrc/common/playerstats.qc
qcsrc/common/t_items.qc
qcsrc/common/t_items.qh
qcsrc/common/triggers/func/button.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.qh
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/config.qc
qcsrc/common/util.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/calculations.qc
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/machinegun.qh
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/lib/csqcmodel/cl_player.qc
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/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/command/banning.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/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/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/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/tracing.qc
qcsrc/server/weapons/weaponstats.qc

index 5d525a4c5773a647cd82ee8e27bd338b927153f0..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=662ab75eeb91d25c2d86ebb81ce8dc02
+    - 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 79617880b8efe86598f799fd09402daa662be54f..28100182ea5fe41b0b1d028b020a93503228c9f5 100644 (file)
@@ -121,7 +121,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
@@ -130,7 +130,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
@@ -141,7 +141,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 e64a19e5f4e25fa90645b4c8146a0e60e42f2a92..3a321ce53d461b2eca19452f5ad420975f9f2c12 100644 (file)
@@ -121,7 +121,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
@@ -130,7 +130,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
@@ -141,7 +141,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 4b579f0fd8b460ff687fb854555d2dc6ab27f7c2..48c68d81be66e77c96cf8f55c417fd4b8565fe0f 100644 (file)
@@ -121,7 +121,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
@@ -130,7 +130,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
@@ -141,7 +141,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 66a92403d79c0878e6a4d3c450cf8d9921d477a0..562506283c44ad965d5d7d0f641a96a910aa11d3 100644 (file)
@@ -121,7 +121,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
@@ -130,7 +130,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
@@ -141,7 +141,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 a1fd084e6c98bd575da77985c21af44b2bde63c8..32924a72d2cee7cca9d636330661abe49047f404 100644 (file)
@@ -121,7 +121,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
@@ -130,7 +130,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
@@ -141,7 +141,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 4b3cfb91d2fe5fe7dbaa007ff3b32a13b0085c17..6901eda28a8c130622dc43db632f7475965050d3 100644 (file)
@@ -121,7 +121,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
@@ -130,7 +130,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
@@ -141,7 +141,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 c12f69feeb86b881f59ebff7d52fda05d4445946..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"
index 634943c581dfd85e7c94b2fef04bc0f3b704ad93..1dc68c70de1a085b438bc79d4cf7a947ae5e4d1c 100644 (file)
@@ -8,6 +8,13 @@ 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 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 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 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 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 3a11bdb1e7f0085aba298ff439644428dfc7e253..8e0d0f057695d8e237fbcbe2816b11298c6fce89 100644 (file)
@@ -295,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"
@@ -346,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
@@ -475,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)
@@ -514,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)
                        {
@@ -529,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)
@@ -539,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)
                {
@@ -548,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)
                {
@@ -557,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 7ad10879f7ac23b05a69a96ae7d4f7441ea51c2d..ae624ef85c88c1a7c2b6a09d0fb7617629cfb089 100644 (file)
@@ -97,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
 
        {
@@ -414,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);
        }
@@ -826,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;
@@ -836,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;
                }
        }
@@ -846,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;
@@ -886,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?");
@@ -908,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);
 }
 
@@ -935,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 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 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 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 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 9992a37f4ce032faa7f25549728ff5d3303846a2..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;
@@ -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 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 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 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..53042b8ef2779199c1a8412c138eacc2ab9c59bf 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) {
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 ae1bbff6525cac70a7348eb46bc4049ae81c76a7..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)
                {
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 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 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 79552505ad961f0267958cc7533b3b7485e4662e..0f1e621610521eaa3141179c930e96819c2ba389 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);
@@ -665,7 +699,8 @@ void GivePlayerResource(entity player, .float resource_type, float amount)
                                autocvar_g_balance_health_limit);
                        // Correct code:
                        //player.health = bound(player.health, player.health + amount,
-                       //      min(autocvar_g_balance_health_limit, ITEM_COUNT_HARD_LIMIT));
+                       //      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;
@@ -680,7 +715,7 @@ void GivePlayerResource(entity player, .float resource_type, float amount)
                        // Correct code:
                        //player.armorvalue = bound(player.armorvalue, player.armorvalue +
                        //      amount, min(autocvar_g_balance_armor_limit,
-                       //      ITEM_COUNT_HARD_LIMIT));
+                       //      RESOURCE_AMOUNT_HARD_LIMIT));
                        player.pauserotarmor_finished = max(player.pauserotarmor_finished,
                                time + autocvar_g_balance_pause_armor_rot);
                        return;
@@ -697,7 +732,7 @@ void GivePlayerResource(entity player, .float resource_type, float amount)
                case ammo_fuel:
                {
                        player.ammo_fuel = bound(player.ammo_fuel, player.ammo_fuel +
-                               amount, min(g_pickup_fuel_max, ITEM_COUNT_HARD_LIMIT));
+                               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;
@@ -721,7 +756,7 @@ void GivePlayerAmmo(entity player, .float ammotype, float amount)
        {
                return;
        }
-       float maxvalue = ITEM_COUNT_HARD_LIMIT;
+       float maxvalue = RESOURCE_AMOUNT_HARD_LIMIT;
        switch (ammotype)
        {
                case ammo_shells:
@@ -751,7 +786,7 @@ void GivePlayerAmmo(entity player, .float ammotype, float amount)
                }
        }
        player.(ammotype) = min(player.(ammotype) + amount,
-               min(maxvalue, ITEM_COUNT_HARD_LIMIT));
+               min(maxvalue, RESOURCE_AMOUNT_HARD_LIMIT));
 }
 
 void GivePlayerFuel(entity player, float amount)
index af7d91758dd4afd0bbbfa69fc8fc155433f71609..f633148f9b95658b2e830407b53ca57195aaaaaa 100644 (file)
@@ -4,8 +4,8 @@
 #include <server/defs.qh>
 #endif
 
-/// \brief Unconditional maximum amount of items the player can have.
-const int ITEM_COUNT_HARD_LIMIT = 999;
+/// \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
 
@@ -70,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
 
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 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);
index 8bd0b14b712c21a833d777951dc815a104af4efc..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;
         }
     }
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 a5a23f93780768e7a51f542bfdc2eb278ed3ad61..effabeac275ded29fed4b17d370f6e56e7cd5fb2 100644 (file)
@@ -50,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;
        });
 
@@ -60,7 +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 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
        {
index 0d595dff47154f2af587a1158a9b20c92cc0d10c..afbf79eb54777d0e2852366e9d44956ff69c3966 100644 (file)
@@ -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 6e618c88ec22eda2d70197423a21b751d7b8afaf..88d50f80a021eb01dadb77cb867a4bd7a85611fa 100644 (file)
@@ -489,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
index 66a7cb674f07069f57c507c836c844df613de826..5cd912a2aef278f800a2c86cc2b578ef36037ef6 100644 (file)
@@ -3,7 +3,7 @@
 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);
+/* 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");
index b190cce69f11271046de2ba7cb21a1df957f7dfb..bc9e94767a45177e35b3dd788f283f3beeeb7c00 100644 (file)
@@ -110,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
@@ -397,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))
@@ -460,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
                        }
                }
@@ -549,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
                        }
                }
@@ -584,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;
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 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 5bc86b84e14ca350c18d75493500cf7ca55da63a..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
@@ -684,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 bb06092cc25462ee9d1bc58d31ef01e7200a143b..1997b8e5776d887fd26f804585845b04a70f550e 100644 (file)
@@ -1191,7 +1191,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)));
@@ -1240,7 +1243,6 @@ void ClientConnect(entity this)
        }
 
        CS(this).jointime = time;
-       CS(this).allowed_timeouts = autocvar_sv_timeout_number;
 
        if (IS_REAL_CLIENT(this))
        {
@@ -1662,16 +1664,16 @@ 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 haelth and armor don't go beyond hard limit.
+       // 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 > ITEM_COUNT_HARD_LIMIT)
+       if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
        {
-               this.health = ITEM_COUNT_HARD_LIMIT;
+               this.health = RESOURCE_AMOUNT_HARD_LIMIT;
        }
-       if (this.armorvalue > ITEM_COUNT_HARD_LIMIT)
+       if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
        {
-               this.armorvalue = ITEM_COUNT_HARD_LIMIT;
+               this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
        }
        // End hack.
 }
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 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 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 4a851b18d08f76b25f2b73b00c5f449185f6352c..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...");
        }
 }
 
@@ -532,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;
@@ -597,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();
@@ -653,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
@@ -674,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
                }
@@ -759,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;
@@ -846,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);
@@ -1438,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);
 
@@ -1454,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)
@@ -1469,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)
@@ -1480,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)
@@ -1491,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)
@@ -1500,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)
@@ -1905,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;
@@ -2131,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
@@ -2139,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");
@@ -2204,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 a8b272f4c8a6cff8517c3eb5d2ffdbbd0e31113e..56ea478ae2624ed9e766e77e2a8a318412d6a106 100644 (file)
@@ -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 62be9cbbe1701e9a20c455b978582caac75fad58..ac2ed7159559a17e43197af9b2003860124affc2 100644 (file)
@@ -1136,7 +1136,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 c6fdeb244148177b306989260bf1474244b60f5e..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"
 
index bd88131d31b2ddfa6e6e2a81aac0e55c63a7ec37..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)
@@ -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 8ec353c1dae376e1060d6978835c09517bf24ff9..1b8b77ae078158e566fb34a87c754701436175d3 100644 (file)
@@ -346,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;
@@ -430,10 +430,10 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
 
                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);
                }
@@ -560,10 +560,13 @@ 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.
@@ -573,14 +576,7 @@ void invasion_DelayedInit(entity this) // Do this check with a delay so we can w
 
        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;
index 98322bcac0fcbcbb0ebfc570ff9c61b6449c3f9b..0ea0e82c4c8266ad31bff1db48f2ceeb6be03416 100644 (file)
@@ -11,37 +11,19 @@ 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);
                }
-       }
-
-       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.
-       }
+        GameRules_limit_score(autocvar_g_invasion_point_limit);
 
-       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;
 }
 
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 931ef826d9931f8889855b54dc89265520a1a8c7..44a877791b19673f539ac4dd065ffe5eaafa032f 100644 (file)
@@ -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 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 8eaa0280a7588fcee50c53a49e73fb23de79c2cc..bf272a01a94e02d75041436a36b2c7ce1846ddad 100644 (file)
@@ -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;