]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into bones_was_here/q3compat
authorbones_was_here <bones_was_here@xa.org.au>
Wed, 23 Sep 2020 11:48:29 +0000 (21:48 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Wed, 23 Sep 2020 11:48:29 +0000 (21:48 +1000)
89 files changed:
.tx/merge-base
common.de.po
common.de_CH.po
common.eo.po
common.es.po
common.fr.po
common.gd.po
common.gl.po
common.ja_JP.po
common.ms.po
common.pt_BR.po
common.ru.po
languages.txt
qcsrc/client/hud/crosshair.qc
qcsrc/client/shownames.qc
qcsrc/client/view.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/gamemodes/gamemode/race/sv_race.qc
qcsrc/common/mapobjects/trigger/relay.qc
qcsrc/common/mapobjects/triggers.qc
qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/okhmg.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/oknex.qc
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/common/mutators/mutator/overkill/okshotgun.qc
qcsrc/common/mutators/mutator/sandbox/sv_sandbox.qc
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/playerstats.qc
qcsrc/common/sounds/all.qh
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/calculations.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/dpdefs/upstream/dpextensions.qc
qcsrc/dpdefs/upstream/menudefs.qc
qcsrc/ecs/systems/sv_physics.qc
qcsrc/lib/cvar.qh
qcsrc/lib/spawnfunc.qh
qcsrc/server/_mod.inc
qcsrc/server/_mod.qh
qcsrc/server/autocvars.qh
qcsrc/server/bot/default/navigation.qc
qcsrc/server/campaign.qc
qcsrc/server/cheats.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/sv_cmd.qh
qcsrc/server/command/vote.qc
qcsrc/server/damage.qc
qcsrc/server/elimination.qc [new file with mode: 0644]
qcsrc/server/elimination.qh [new file with mode: 0644]
qcsrc/server/gamelog.qc
qcsrc/server/hook.qc
qcsrc/server/hook.qh
qcsrc/server/intermission.qc [new file with mode: 0644]
qcsrc/server/intermission.qh [new file with mode: 0644]
qcsrc/server/items/items.qh
qcsrc/server/main.qc
qcsrc/server/main.qh
qcsrc/server/mapvoting.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/race.qc
qcsrc/server/scores.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/utils.qh
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponstats.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/server/world.qc
qcsrc/server/world.qh

index 5b64a38bc7e59eac8e624319a97e068b5540a022..1ee7cdb840b5e5535b405de0d0d8c246c5c47b00 100644 (file)
@@ -1 +1 @@
-Sun Aug  9 07:25:00 CEST 2020
+Tue Aug 25 07:23:38 CEST 2020
index 9f14f751f7aa778b45a239b9e925f2f7ade16042..9109dbaa476bc26e24834e45e083932a7b96e2d0 100644 (file)
@@ -15,7 +15,7 @@
 # Larson März <larson@protonmail.ch>, 2016
 # Larson März <larson@protonmail.ch>, 2016
 # afba88cf42cbdff57149d4a6d53a94f9, 2018
-# Mirio <opivy@hotmail.de>, 2014-2017,2019
+# Mirio <opivy@hotmail.de>, 2014-2017,2019-2020
 # Robert Katzinsky <hbmctextures.unknown@gmail.com>, 2020
 # divVerent <divVerent@xonotic.org>, 2011
 # Sless <sless@gmx.net>, 2014
@@ -28,8 +28,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-20 23:59+0000\n"
+"Last-Translator: Mirio <opivy@hotmail.de>\n"
 "Language-Team: German (http://www.transifex.com/team-xonotic/xonotic/"
 "language/de/)\n"
 "Language: de\n"
@@ -8667,7 +8667,7 @@ msgstr "Nur in Nicht-Teamspielen"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "Nur in Duell"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
index 52204e2a924ccb4945947df8a46ceb4d2dafe3d2..cfcf015a8dd40aecd6262f7b9debf5be17dc16cc 100644 (file)
@@ -15,7 +15,7 @@
 # Larson März <larson@protonmail.ch>, 2016
 # Larson März <larson@protonmail.ch>, 2016
 # afba88cf42cbdff57149d4a6d53a94f9, 2018
-# Mirio <opivy@hotmail.de>, 2014-2017,2019
+# Mirio <opivy@hotmail.de>, 2014-2017,2019-2020
 # Robert Katzinsky <hbmctextures.unknown@gmail.com>, 2020
 # divVerent <divVerent@xonotic.org>, 2011
 # Sless <sless@gmx.net>, 2014
@@ -28,8 +28,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-20 23:59+0000\n"
+"Last-Translator: Mirio <opivy@hotmail.de>\n"
 "Language-Team: German (http://www.transifex.com/team-xonotic/xonotic/"
 "language/de/)\n"
 "Language: de\n"
@@ -8668,7 +8668,7 @@ msgstr "Nur in Nicht-Teamspielen"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "Nur in Duell"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
index fcd54161ae74fd8ae03a50cf6def84d7b8c9e139..955d568e91b9486d63833bb75e52d45e7b3bb085 100644 (file)
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-06-07 05:23+0000\n"
+"PO-Revision-Date: 2020-08-09 05:23+0000\n"
 "Last-Translator: divVerent <divVerent@xonotic.org>\n"
 "Language-Team: Esperanto (http://www.transifex.com/team-xonotic/xonotic/"
 "language/eo/)\n"
index 27ce4e39b7d6efd80284adaf63197c599e553707..1fc7f4b111d4af2f8f74855af8074cd33285eb95 100644 (file)
@@ -30,8 +30,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-24 11:18+0000\n"
+"Last-Translator: LegendGuard\n"
 "Language-Team: Spanish (http://www.transifex.com/team-xonotic/xonotic/"
 "language/es/)\n"
 "Language: es\n"
@@ -109,7 +109,7 @@ msgstr "^1Pulsa ^3%s^1 o ^3%s^1 para ver el jugador siguiente o anterior"
 #: qcsrc/client/hud/panel/infomessages.qc:110
 #: qcsrc/client/hud/panel/infomessages.qc:114
 msgid "next weapon"
-msgstr "arma siguiente"
+msgstr "siguiente arma"
 
 #: qcsrc/client/hud/panel/infomessages.qc:110
 #: qcsrc/client/hud/panel/infomessages.qc:114
@@ -8649,7 +8649,7 @@ msgstr "Sólo en modos de juego sin equipo"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "Sólo en Duelo"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
index 3ea4ee3341c2dbbbb398b2d92cf1d7579f6c8cbd..2fe55a8ecd23b10a1e72b2e95b471868343dd42c 100644 (file)
@@ -19,8 +19,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-09 08:32+0000\n"
+"Last-Translator: Yannick Le Guen <leguen.yannick@gmail.com>\n"
 "Language-Team: French (http://www.transifex.com/team-xonotic/xonotic/"
 "language/fr/)\n"
 "Language: fr\n"
@@ -8655,7 +8655,7 @@ msgstr "Dans les modes sans équipe uniquement"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "Seulement en Duel"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
index b27aae03c91f26e59427b9416516861fb50b1237..425d993fe74b1d71d033cc00c0f0e8e8bd8dc71f 100644 (file)
@@ -11,7 +11,7 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-06-07 05:23+0000\n"
+"PO-Revision-Date: 2020-08-09 05:23+0000\n"
 "Last-Translator: divVerent <divVerent@xonotic.org>\n"
 "Language-Team: Gaelic, Scottish (http://www.transifex.com/team-xonotic/"
 "xonotic/language/gd/)\n"
index feab45dfb1dbd86d7dfb222068ea22dea4ba9376..10687db2918f17eac892cbacaa7a2e13558bcc1f 100644 (file)
@@ -10,8 +10,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-24 11:27+0000\n"
+"Last-Translator: LegendGuard\n"
 "Language-Team: Galician (http://www.transifex.com/team-xonotic/xonotic/"
 "language/gl/)\n"
 "Language: gl\n"
@@ -23,17 +23,17 @@ msgstr ""
 #: qcsrc/client/hud/hud_config.qc:80
 #, c-format
 msgid "^2Successfully exported to %s! (Note: It's saved in data/data/)"
-msgstr ""
+msgstr "^2Exportado con éxito a %s! (Nota: Está gardado en data/data/)"
 
 #: qcsrc/client/hud/hud_config.qc:84
 #, c-format
 msgid "^1Couldn't write to %s"
-msgstr ""
+msgstr "^1Non se puido escribir a %s"
 
 #: qcsrc/client/hud/panel/centerprint.qc:173
 #, c-format
 msgid "^3Countdown message at time %s, seconds left: ^COUNT"
-msgstr ""
+msgstr "^3Mensaxe de conta atrás á hora %s, segundos restantes: ^COUNT"
 
 #: qcsrc/client/hud/panel/centerprint.qc:175
 #, c-format
@@ -41,11 +41,13 @@ msgid ""
 "^1Multiline message at time %s that\n"
 "^1lasts longer than normal"
 msgstr ""
+"^1Mensaxe de múltiples liñas á hora %s que\n"
+"^1dura máis do normal"
 
 #: qcsrc/client/hud/panel/centerprint.qc:177
 #, c-format
 msgid "Message at time %s"
-msgstr ""
+msgstr "Mensaxe á hora %s"
 
 #: qcsrc/client/hud/panel/centerprint.qc:182
 msgid "Generic message"
@@ -62,12 +64,12 @@ msgstr "FPS: %.*f"
 
 #: qcsrc/client/hud/panel/infomessages.qc:95
 msgid "^1Observing"
-msgstr ""
+msgstr "^1Observando"
 
 #: qcsrc/client/hud/panel/infomessages.qc:97
 #, c-format
 msgid "^1Spectating: ^7%s"
-msgstr ""
+msgstr "^1Espectando: ^7%s"
 
 #: qcsrc/client/hud/panel/infomessages.qc:108
 #, c-format
@@ -77,47 +79,47 @@ msgstr ""
 #: qcsrc/client/hud/panel/infomessages.qc:108
 #: qcsrc/menu/xonotic/keybinder.qc:47
 msgid "primary fire"
-msgstr "tiro principal"
+msgstr "disparo primario"
 
 #: qcsrc/client/hud/panel/infomessages.qc:110
 #, c-format
 msgid "^1Press ^3%s^1 or ^3%s^1 for next or previous player"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 ou ^3%s^1 para ver o xogador seguinte ou anterior"
 
 #: qcsrc/client/hud/panel/infomessages.qc:110
 #: qcsrc/client/hud/panel/infomessages.qc:114
 msgid "next weapon"
-msgstr ""
+msgstr "seguinte arma"
 
 #: qcsrc/client/hud/panel/infomessages.qc:110
 #: qcsrc/client/hud/panel/infomessages.qc:114
 msgid "previous weapon"
-msgstr ""
+msgstr "arma anterior"
 
 #: qcsrc/client/hud/panel/infomessages.qc:114
 #, c-format
 msgid "^1Use ^3%s^1 or ^3%s^1 to change the speed"
-msgstr ""
+msgstr "^1Usa ^3%s^1 ou ^3%s^1 para cambiar a velocidade"
 
 #: qcsrc/client/hud/panel/infomessages.qc:116
 #, c-format
 msgid "^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 para observar ou ^3%s^1 para cambiar o modo de cámara"
 
 #: qcsrc/client/hud/panel/infomessages.qc:116
 #: qcsrc/common/vehicles/cl_vehicles.qc:190
 msgid "drop weapon"
-msgstr ""
+msgstr "soltar arma"
 
 #: qcsrc/client/hud/panel/infomessages.qc:116
 #: qcsrc/menu/xonotic/keybinder.qc:48
 msgid "secondary fire"
-msgstr "tiro secundario"
+msgstr "disparo secundario"
 
 #: qcsrc/client/hud/panel/infomessages.qc:119
 #, c-format
 msgid "^1Press ^3%s^1 for gamemode info"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 para mostrar información do modo de xogo"
 
 #: qcsrc/client/hud/panel/infomessages.qc:119
 #: qcsrc/menu/xonotic/keybinder.qc:103
@@ -127,7 +129,7 @@ msgstr "información do servidor"
 #: qcsrc/client/hud/panel/infomessages.qc:131
 #, c-format
 msgid "^1Press ^3%s^1 to join"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 para unirche"
 
 #: qcsrc/client/hud/panel/infomessages.qc:131
 #: qcsrc/common/notifications/all.qh:430
@@ -137,16 +139,16 @@ msgstr "saltar"
 #: qcsrc/client/hud/panel/infomessages.qc:140
 #, c-format
 msgid "^1Game starts in ^3%d^1 seconds"
-msgstr ""
+msgstr "^1O xogo comeza en ^3%d^1 segundos"
 
 #: qcsrc/client/hud/panel/infomessages.qc:146
 msgid "^2Currently in ^1warmup^2 stage!"
-msgstr ""
+msgstr "^2Actualmente en etapa de ^1quecemento^2!"
 
 #: qcsrc/client/hud/panel/infomessages.qc:161
 #, c-format
 msgid "%sPress ^3%s%s to end warmup"
-msgstr ""
+msgstr "%sPulsa  ^3%s%s para terminar o quecemento"
 
 #: qcsrc/client/hud/panel/infomessages.qc:161
 #: qcsrc/client/hud/panel/infomessages.qc:163
index 7d80e1494a329902b928a3e2603954dc9f462172..4b2da01fe10e29c6450473030a7684e8b4d86626 100644 (file)
@@ -12,8 +12,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-21 21:35+0000\n"
+"Last-Translator: LegendGuard\n"
 "Language-Team: Japanese (Japan) (http://www.transifex.com/team-xonotic/"
 "xonotic/language/ja_JP/)\n"
 "Language: ja_JP\n"
@@ -8536,7 +8536,7 @@ msgstr "非チームプレイモードのみ"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "決闘でのみ"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
index ea7d11fd06a0a807f77a928edc3295b12dc09dec..fd461288fe8f3c65ceb8805e3d3c62973b0aa3ee 100644 (file)
@@ -3,7 +3,8 @@
 # This file is distributed under the same license as the PACKAGE package.
 #
 # Translators:
-# Muhammad Nur Hidayat Yasuyoshi <mnh48mail@gmail.com>, 2018
+# 4b0721bd8a44304c1fd21d8581e7aba4_e088d28 <64a9a0c5da22e761316957ae436b6281_676465>, 2018
+# 4b0721bd8a44304c1fd21d8581e7aba4_e088d28 <64a9a0c5da22e761316957ae436b6281_676465>, 2018
 msgid ""
 msgstr ""
 "Project-Id-Version: Xonotic\n"
index 53abaf9c65307b64df815bc1fe886bfb24567275..194b9d0b4714b82f7a80fd6024fd49b3dc884fc3 100644 (file)
@@ -14,8 +14,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-21 01:30+0000\n"
+"Last-Translator: Jean Trindade Pereira <jean_trindade2@hotmail.com>\n"
 "Language-Team: Portuguese (Brazil) (http://www.transifex.com/team-xonotic/"
 "xonotic/language/pt_BR/)\n"
 "Language: pt_BR\n"
@@ -281,7 +281,7 @@ msgstr "Bate-papo de equipe"
 
 #: qcsrc/client/hud/panel/quickmenu.qc:799
 msgid "QMCMD^strength soon"
-msgstr ""
+msgstr "Força em breve"
 
 #: qcsrc/client/hud/panel/quickmenu.qc:800
 msgid "QMCMD^free item %x^7 (l:%y^7)"
@@ -441,7 +441,7 @@ msgstr "Som do bate-papo"
 
 #: qcsrc/client/hud/panel/quickmenu.qc:836
 msgid "QMCMD^Change spectator camera"
-msgstr ""
+msgstr "Alterar câmera de espectador"
 
 #: qcsrc/client/hud/panel/quickmenu.qc:841
 #: qcsrc/client/hud/panel/quickmenu.qc:845
@@ -2958,7 +2958,7 @@ msgstr "O ponto de controle %s^BG da equipe ^TC^TT^BG foi destruído por %s"
 #: qcsrc/common/notifications/all.inc:407
 #, c-format
 msgid "^TC^TT^BG team control point has been destroyed by %s"
-msgstr ""
+msgstr "O ponto de controle da equipe ^TC^TT^BG foi destruído por %s"
 
 #: qcsrc/common/notifications/all.inc:408
 msgid "^TC^TT^BG generator has been destroyed"
@@ -3996,7 +3996,7 @@ msgstr "^BGPorta destrancada!"
 #: qcsrc/common/notifications/all.inc:667
 #, c-format
 msgid "^F2Extra lives taken: ^K1%s"
-msgstr ""
+msgstr "^F2Vidas extras tomadas: ^K1%s"
 
 #: qcsrc/common/notifications/all.inc:669
 #, c-format
@@ -4015,7 +4015,7 @@ msgstr "^K3Você foi ressuscitado por ^BG%s"
 #: qcsrc/common/notifications/all.inc:672
 #, c-format
 msgid "^K3You were automatically revived after %s seconds"
-msgstr ""
+msgstr "^K3Você foi automaticamente ressuscitado após %s segundos"
 
 #: qcsrc/common/notifications/all.inc:674
 msgid "^BGThe generator is under attack!"
@@ -4155,7 +4155,7 @@ msgstr "Nível %s: "
 #: qcsrc/common/notifications/all.inc:721
 #, c-format
 msgid "^BGPress ^F2%s^BG to enter the game"
-msgstr ""
+msgstr "^BGAperte ^F2%s^BG para entrar no jogo"
 
 #: qcsrc/common/notifications/all.inc:724
 #, c-format
@@ -6909,6 +6909,8 @@ msgid ""
 "Enable dodging (quick acceleration in a given direction). Double-tap a "
 "directional key to dodge"
 msgstr ""
+"Ativa a esquiva (aceleração rápida em uma determinada direção). Aperte duas "
+"vezes uma tecla direcional para esquivar."
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:168
 msgid "An explosion occurs when two players collide"
@@ -6923,6 +6925,8 @@ msgid ""
 "Enable buff pickups (random bonuses like Medic, Invisible, etc.) on the maps "
 "that support it"
 msgstr ""
+"Ativa itens coletáveis de bônus (bônus aleatórios como Médico, Invisível "
+"etc.) nos mapas que são compatíveis com este recurso."
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:181
 msgid "Only possible to inflict damage on your enemy while they're airborne"
@@ -6937,10 +6941,14 @@ msgid ""
 "Amount of health below which players start bleeding out (health rots and "
 "they can't jump)"
 msgstr ""
+"Quantidade de saúde abaixo em que os jogadores começam a sangrar (a saúde "
+"cai e os jogadores não podem pular)"
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:199
 msgid "Make things fall to the ground slower (percentage of normal gravity)"
 msgstr ""
+"Faz com que as coisas caiam no chão mais devagar (porcentagem da gravidade "
+"normal)."
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:208
 msgid "Weapon & item mutators:"
@@ -6965,12 +6973,16 @@ msgid ""
 "Projectiles can't be destroyed. However, you can still explode Electro orbs "
 "with the Electro primary fire"
 msgstr ""
+"Os projéteis não podem ser destruídos. Entretanto, ainda é possível destruir "
+"os orbes da Electro com o disparo primário dela."
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:225
 msgid ""
 "Some weapon spawns will be randomly replaced with new weapons: Heavy Laser "
 "Assault Cannon, Mine Layer, Rifle, T.A.G. Seeker"
 msgstr ""
+"Alguns surgimentos de arma serão aleatoriamente substituídos por novas "
+"armas: Heavy Laser Assault Cannon, Mine Layer, Rifle, T.A.G. Seeker."
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:230
 msgid ""
@@ -6978,6 +6990,10 @@ msgid ""
 "delay). This allows players to fire and detonate a Devastator rocket while "
 "in the air for a strong mid-air boost even while moving fast"
 msgstr ""
+"Os foguetes do Devastador podem ser detonados instantaneamente (caso "
+"contrário, há um pequeno atraso). Isso permite aos jogadores atirarem e "
+"detonarem um foguete de Devastador enquanto estiverem no ar para ganharem um "
+"forte impulso, mesmo que em rápida velocidade."
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:235
 msgid "Players will drop all weapons they possessed when they are killed"
@@ -7378,6 +7394,8 @@ msgstr "Permitir que as estatísticas de jogadores usem o seu apelido"
 #: qcsrc/menu/xonotic/dialog_multiplayer_profile.qc:136
 msgid "Allow player statistics to rank you in leaderboards"
 msgstr ""
+"Permitir que as estatísticas de jogador classifiquem você no placar de "
+"líderes"
 
 #: qcsrc/menu/xonotic/dialog_multiplayer_profile.qc:152
 msgid "Country"
@@ -7926,7 +7944,7 @@ msgstr "Evitar compressão de texturas com perdas"
 
 #: qcsrc/menu/xonotic/dialog_settings_effects.qc:129
 msgid "Disable sky for performance and visibility"
-msgstr ""
+msgstr "Desativar céu para ganhar desempenho e visibilidade"
 
 #: qcsrc/menu/xonotic/dialog_settings_effects.qc:129
 msgid "Show sky"
@@ -8607,7 +8625,7 @@ msgstr "Apenas em modos de jogo que não sejam de equipes"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "Somente em Duelo"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
@@ -9745,7 +9763,7 @@ msgstr "arrastar objeto (sandbox)"
 
 #: qcsrc/menu/xonotic/keybinder.qc:135
 msgid "waypoint editor menu"
-msgstr ""
+msgstr "menu do editor de ponto de interesse"
 
 #: qcsrc/menu/xonotic/mainwindow.qc:96 qcsrc/menu/xonotic/mainwindow.qc:99
 msgid "Do not press this button again!"
@@ -9785,7 +9803,7 @@ msgstr "Remover favorito"
 
 #: qcsrc/menu/xonotic/serverlist.qc:257
 msgid "Remove the currently highlighted server from bookmarks"
-msgstr ""
+msgstr "Remove dos favoritos o servidor atualmente destacado"
 
 #: qcsrc/menu/xonotic/serverlist.qc:261
 msgid "SERVER^Favorite"
index a6159ed4ea0371afeac861b54c8a0167695c64f7..edc15150439c4057a5ba5931287eb32d22dbddc1 100644 (file)
@@ -19,8 +19,8 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-09 07:31+0000\n"
+"Last-Translator: Andrei Stepanov <adem4ik@gmail.com>\n"
 "Language-Team: Russian (http://www.transifex.com/team-xonotic/xonotic/"
 "language/ru/)\n"
 "Language: ru\n"
@@ -8576,7 +8576,7 @@ msgstr "В некомандных режимах"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
 msgid "Only in Duel"
-msgstr ""
+msgstr "Только в дуэли"
 
 #: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
 msgid "Body fading:"
index 040f35aee77d43f985e77f7bfe79bf2c65a5620e..5c1a1ba78d8be0d415336da8dacba9ef4dc73e18 100644 (file)
@@ -1,26 +1,28 @@
 ast   "Asturian" "Asturianu" 64%
-de    "German" "Deutsch" 99%
-de_CH "German (Switzerland)" "Deutsch (Schweiz)" 99%
+de    "German" "Deutsch" 100%
+de_CH "German (Switzerland)" "Deutsch (Schweiz)" 100%
 en    "English" "English" 100%
 en_AU "English (Australia)" "English (Australia)" 75%
-es    "Spanish" "Español" 99%
-fr    "French" "Français" 99%
+es    "Spanish" "Español" 100%
+fr    "French" "Français" 100%
 ga    "Irish" "Irish" 32%
 it    "Italian" "Italiano" 99%
 hu    "Hungarian" "Magyar" 47%
 nl    "Dutch" "Nederlands" 62%
 pl    "Polish" "Polski" 72%
 pt    "Portuguese" "Português" 84%
-pt_BR "Portuguese (Brazil)" "Português (Brasil)" 99%
+pt_BR "Portuguese (Brazil)" "Português (Brasil)" 100%
 ro    "Romanian" "Romana" 74%
 fi    "Finnish" "Suomi" 99%
+tr    "Turkish" "Türkçe" 30%
+cs    "Czech" "Čeština" 30%
 el    "Greek" "Ελληνική" 47%
 be    "Belarusian" "Беларуская" 54%
 bg    "Bulgarian" "Български" 63%
-ru    "Russian" "Русский" 99%
+ru    "Russian" "Русский" 100%
 sr    "Serbian" "Српски" 64%
 uk    "Ukrainian" "Українська" 50%
 zh_CN "Chinese (China)" "中文" 57%
 zh_TW "Chinese (Taiwan)" "國語" 61%
-ja_JP "Japanese" "日本語" 99%
+ja_JP "Japanese" "日本語" 100%
 ko    "Korean" "한국의" 29%
index c2dd9a1fbb5a0a30c0d1923b8fa89a2e4ca53f71..6bf0bb5772d2b91f70c133ca3ca6e5f3c1e5650c 100644 (file)
@@ -361,7 +361,7 @@ void HUD_Crosshair(entity this)
                // todo: make crosshair hit indication dependent on damage dealt
                if(autocvar_crosshair_hitindication)
                {
-                       vector hitindication_color = ((autocvar_crosshair_color_special == 1) ? stov(autocvar_crosshair_hitindication_per_weapon_color) : stov(autocvar_crosshair_hitindication_color));
+                       vector col = ((autocvar_crosshair_color_special == 1) ? stov(autocvar_crosshair_hitindication_per_weapon_color) : stov(autocvar_crosshair_hitindication_color));
 
                        if(unaccounted_damage)
                        {
@@ -374,9 +374,9 @@ void HUD_Crosshair(entity this)
                                hitindication_crosshair_size = 0;
 
                        wcross_scale += sin(hitindication_crosshair_size) * autocvar_crosshair_hitindication;
-                       wcross_color.x += sin(hitindication_crosshair_size) * hitindication_color.x;
-                       wcross_color.y += sin(hitindication_crosshair_size) * hitindication_color.y;
-                       wcross_color.z += sin(hitindication_crosshair_size) * hitindication_color.z;
+                       wcross_color.x += sin(hitindication_crosshair_size) * col.x;
+                       wcross_color.y += sin(hitindication_crosshair_size) * col.y;
+                       wcross_color.z += sin(hitindication_crosshair_size) * col.z;
                }
 
                // no effects needed for targeting enemies, this can't possibly span all valid targets!
@@ -455,58 +455,53 @@ void HUD_Crosshair(entity this)
                                int weapon_clipsize = wepent.clip_size;
 
                                float arc_heat = wepent.arc_heat_percent;
-                               float vcharge = wepent.vortex_charge;
-                               float vchargepool = wepent.vortex_chargepool_ammo;
-                               float oknex_charge_ = wepent.oknex_charge;
-                               float oknex_chargepool_ = wepent.oknex_chargepool_ammo;
 
                                if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
-                                       vortex_charge_movingavg = vcharge;
+                                       vortex_charge_movingavg = wepent.vortex_charge;
 
-                               // handle the values
-                               if (autocvar_crosshair_ring && wepent.activeweapon == WEP_VORTEX && vcharge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
+                               float charge = 0;
+                               float chargepool = 0;
+                               bool ring_vortex_enabled = false;
+                               if (autocvar_crosshair_ring && autocvar_crosshair_ring_vortex)
                                {
-                                       if (vchargepool || use_vortex_chargepool) {
-                                               use_vortex_chargepool = 1;
-                                               ring_inner_value = vchargepool;
-                                       } else {
-                                               vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * vcharge;
-                                               ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (vcharge - vortex_charge_movingavg), 1);
+                                       if (wepent.activeweapon == WEP_VORTEX)
+                                       {
+                                               charge = wepent.vortex_charge;
+                                               chargepool = wepent.vortex_chargepool_ammo;
                                        }
-
-                                       ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
-                                       ring_inner_rgb = vec3(autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_blue);
-                                       ring_inner_image = "gfx/crosshair_ring_inner.tga";
-
-                                       // draw the outer ring to show the current charge of the weapon
-                                       ring_value = vcharge;
-                                       ring_alpha = autocvar_crosshair_ring_vortex_alpha;
-                                       ring_rgb = wcross_color;
-                                       ring_image = "gfx/crosshair_ring_nexgun.tga";
+                                       else if (wepent.activeweapon == WEP_OVERKILL_NEX)
+                                       {
+                                               charge = wepent.oknex_charge;
+                                               chargepool = wepent.oknex_chargepool_ammo;
+                                       }
+                                       if (charge)
+                                               ring_vortex_enabled = true;
                                }
-                               else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_NEX) && oknex_charge_ && autocvar_crosshair_ring_vortex)
+
+                               if (ring_vortex_enabled)
                                {
-                                       if (oknex_chargepool_ || use_vortex_chargepool) {
+                                       if (chargepool || use_vortex_chargepool) {
                                                use_vortex_chargepool = 1;
-                                               ring_inner_value = oknex_chargepool_;
+                                               ring_inner_value = chargepool;
                                        } else {
-                                               vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * oknex_charge_;
-                                               ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (oknex_charge_ - vortex_charge_movingavg), 1);
+                                               float rate = autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate;
+                                               vortex_charge_movingavg = (1 - rate) * vortex_charge_movingavg + rate * charge;
+                                               ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (charge - vortex_charge_movingavg), 1);
                                        }
 
                                        ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
-                                       ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
+                                       ring_inner_rgb = vec3(autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_blue);
                                        ring_inner_image = "gfx/crosshair_ring_inner.tga";
 
                                        // draw the outer ring to show the current charge of the weapon
-                                       ring_value = oknex_charge_;
+                                       ring_value = charge;
                                        ring_alpha = autocvar_crosshair_ring_vortex_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring_nexgun.tga";
                                }
                                else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
                                {
-                                       ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
+                                       ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1);
                                        ring_alpha = autocvar_crosshair_ring_minelayer_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
index bee9a2b454880597402cfcc09145f62e53c7c501..7c126f10fa95778931b8290ecea12a0607adf365 100644 (file)
@@ -156,7 +156,7 @@ void Draw_ShowNames(entity this)
                myPos.y += (mySize.y / resize - mySize.y);
                // this is where the origin of the string
                float namewidth = mySize.x;
-               if (autocvar_hud_shownames_status && this.sameteam)
+               if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
                {
                        vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
                        vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
index d7dc3996f8913615e7f0707c0e30e6dfdf5b9af2..ee9164bae1a279b4c0038441b7b595c637c4a26f 100644 (file)
@@ -1307,9 +1307,17 @@ void View_PostProcessing()
 
 void View_Lock()
 {
-       int lock_type = (!autocvar_hud_cursormode && ((autocvar__hud_configure && spectatee_status <= 0) || intermission > 1 || QuickMenu_IsOpened()));
-       if (lock_type == 0)
-               lock_type = autocvar_cl_lockview;
+       int lock_type = autocvar_cl_lockview;
+
+       if (!autocvar_hud_cursormode
+               && ((autocvar__hud_configure && spectatee_status <= 0)
+                       || intermission > 1
+                       || HUD_Radar_Clickable()
+                       || HUD_MinigameMenu_IsOpened()
+                       || QuickMenu_IsOpened()
+               )
+       )
+               lock_type = 1;
 
        // lock_type 1: lock origin and angles
        // lock_type 2: lock only origin
index afc366ba0c2796bba55a73860224bf8c420a861c..8e671b17d755c574d72c8eac4c0b997567154cca 100644 (file)
                                {
                                        if (voicetype == VOICETYPE_AUTOTAUNT)
                                        {
-                                               if (!sv_autotaunt) break;
+                                               if (!autocvar_sv_autotaunt) break;
                                        }
                                        else if (IS_PLAYER(this) && !IS_DEAD(this))
                                                animdecide_setaction(this, ANIMACTION_TAUNT, true);
 
-                                       if (!sv_taunt) break;
+                                       if (!autocvar_sv_taunt) break;
                                        if (autocvar_sv_gentle) break;
                                        float tauntrand = 0;
                                        if (voicetype == VOICETYPE_AUTOTAUNT) tauntrand = random();
index f6420b85261b7efaa9435db2ae1e8b90e091e0e8..78526bc262b5dba7f885cb154ae63cbbac3f3321 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <common/mutators/base.qh>
+#include <server/elimination.qh>
 #include <server/round_handler.qh>
 #include <server/miscfunctions.qh>
 #include <server/command/sv_cmd.qh>
index 7e436665953388366df74999cbcb7f2bdc5dbe3b..ffde264b9545bd4cc53f237716a6f019bcc8a0d8 100644 (file)
@@ -7,6 +7,7 @@
 #include <server/command/vote.qh>
 #include <server/client.qh>
 #include <server/gamelog.qh>
+#include <server/intermission.qh>
 #include <server/damage.qh>
 #include <server/world.qh>
 #include <server/items/items.qh>
index 1550c8e8927878d1320270d8ee3e7470217a4a3d..08c4f84be2dfe53b0ab5f0f33f31edfeed0e1cda 100644 (file)
@@ -4,6 +4,7 @@
 #include <server/race.qh>
 #include <server/world.qh>
 #include <server/gamelog.qh>
+#include <server/intermission.qh>
 #include <server/items/spawning.qh>
 #include <server/weapons/common.qh>
 #include <common/mapobjects/triggers.qh>
index 360dc7a4ea8bb1f15ca4274c6ad2225a9625cf75..5378fb346abf9793aa38e76cbc16dc100cf09d8e 100644 (file)
@@ -1,5 +1,6 @@
 #include "sv_freezetag.qh"
 
+#include <server/elimination.qh>
 #include <server/resources.qh>
 
 float autocvar_g_freezetag_frozen_maxtime;
index 5c6e52f397389e8b4e6f03b4b08d029d1a6819a6..39c72a4593a9878fbe755f1211c977ff8ffd83cb 100644 (file)
@@ -3,6 +3,7 @@
 #include <server/client.qh>
 #include <server/world.qh>
 #include <server/gamelog.qh>
+#include <server/intermission.qh>
 #include <server/race.qh>
 #include <common/ent_cs.qh>
 #include <common/mapobjects/triggers.qh>
index f99d364aec5bdb560d9c1f51f5d92b3f8e77d714..da4664c9d28a10287ba921424d221d751e9b27ad 100644 (file)
@@ -23,4 +23,13 @@ spawnfunc(target_relay)
 {
        spawnfunc_trigger_relay(this);
 }
+
+spawnfunc(target_delay)
+{
+       if(!this.wait)
+               this.wait = 1;
+       if(!this.delay)
+               this.delay = this.wait; // fall back to quake 3 field
+       spawnfunc_trigger_relay(this);
+}
 #endif
index 29b00d5dbcc7f34932ae1154438d88688d1b6d14..54550dcb263e33b66e520b5434246e5600474335 100644 (file)
@@ -1,5 +1,37 @@
 #include "triggers.qh"
 
+bool isPushable(entity e)
+{
+       if(e.pushable)
+               return true;
+#ifdef SVQC
+       if(IS_VEHICLE(e))
+               return false;
+       if(e.iscreature)
+               return true;
+       if (Item_IsLoot(e))
+       {
+               return true;
+       }
+       switch(e.classname)
+       {
+               case "body":
+                       return true;
+               case "bullet": // antilagged bullets can't hit this either
+                       return false;
+       }
+       if (e.projectiledeathtype)
+               return true;
+#endif
+#ifdef CSQC
+       if(e.flags & FL_PROJECTILE)
+               return true;
+       if(e.isplayermodel)
+               return true;
+#endif
+       return false;
+}
+
 void SUB_DontUseTargets(entity this, entity actor, entity trigger) { }
 
 void SUB_UseTargets(entity this, entity actor, entity trigger);
index 0e0aa13fd0404412f13e612743d648bc1d436cca..38d28a4494e2217e480249f6ecc8fc35ac100d5c 100644 (file)
@@ -17,6 +17,7 @@ MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
     int deathtype = M_ARGV(5, int);
     float potential_damage = M_ARGV(6, float);
     if(DEATH_WEAPONOF(deathtype) == WEP_VAPORIZER) return;
+    if(deathtype == DEATH_FIRE.m_id || deathtype == DEATH_BUFF.m_id) return; // TODO: exclude damage over time and thorn effects
     FOREACH_CLIENT(IS_REAL_CLIENT(it), {
         if (
             (SV_DAMAGETEXT_ALL()) ||
index bd539aa8e68bf84451c76eab1ec82276e98c4e37..64c67bd5434d912d4712ad6c051466708dd831db 100644 (file)
@@ -1208,7 +1208,7 @@ void nades_CheckThrow(entity this)
                        _force /= autocvar_g_nades_nade_lifetime;
                        _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
                        vector dir = (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05);
-                       dir = W_CalculateSpread(dir, autocvar_g_nades_spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
+                       dir = W_CalculateSpread(dir, autocvar_g_nades_spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
                        toss_nade(this, true, dir * _force, 0);
                }
        }
@@ -1252,7 +1252,7 @@ CLASS(NadeOffhand, OffhandWeapon)
                                _force /= autocvar_g_nades_nade_lifetime;
                                _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
                                vector dir = (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1);
-                               dir = W_CalculateSpread(dir, autocvar_g_nades_spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
+                               dir = W_CalculateSpread(dir, autocvar_g_nades_spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
                                toss_nade(player, false, dir * _force, 0);
                        }
                }
index 31db0c4db92e2663a54f0b3a9f0069220a8848a8..210b77ec4afdef8804de3e0bb71cf2d579421700 100644 (file)
@@ -73,7 +73,7 @@ METHOD(OverkillHeavyMachineGun, wr_think, void(entity thiswep, entity actor, .en
                        FOREACH_CLIENT(true, LAMBDA(
                                if (it == actor || (IS_SPEC(it) && it.enemy == actor))
                                {
-                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
                                }
                        ));
                        animdecide_setaction(actor, ANIMACTION_SHOOT, true);
index 9ce9a2901856e313dd6d2c07f06f3412fb6a7e7d..597d17e2e1ea87f3732bd5ea63ad9737fd537268 100644 (file)
@@ -67,7 +67,7 @@ METHOD(OverkillMachineGun, wr_think, void(entity thiswep, entity actor, .entity
                        FOREACH_CLIENT(true, LAMBDA(
                                if (it == actor || (IS_SPEC(it) && it.enemy == actor))
                                {
-                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
                                }
                        ));
                        animdecide_setaction(actor, ANIMACTION_SHOOT, true);
index 55afbe45c1112e4f2fdf04632f62dd71becdbbb5..3ece45bdee273998fd29d8cff20fdf556e33064e 100644 (file)
@@ -154,7 +154,7 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                        FOREACH_CLIENT(true, LAMBDA(
                                if (it == actor || (IS_SPEC(it) && it.enemy == actor))
                                {
-                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
                                }
                        ));
                        animdecide_setaction(actor, ANIMACTION_SHOOT, true);
index 25704934f6fc0d73512b780c58f794284a456134..ea700a9ca37a3a85fc27780223d0d67561bd26cb 100644 (file)
@@ -148,7 +148,7 @@ METHOD(OverkillRocketPropelledChainsaw, wr_think, void(entity thiswep, entity ac
                        FOREACH_CLIENT(true, LAMBDA(
                                if (it == actor || (IS_SPEC(it) && it.enemy == actor))
                                {
-                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
                                }
                        ));
                        animdecide_setaction(actor, ANIMACTION_SHOOT, true);
index da4c4749d04763e4fab32d8624e00ab11e1430d3..627c14f20d47142047b98680bad575d35d20548f 100644 (file)
@@ -28,7 +28,7 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea
                        FOREACH_CLIENT(true, LAMBDA(
                                if (it == actor || (IS_SPEC(it) && it.enemy == actor))
                                {
-                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
                                }
                        ));
                        animdecide_setaction(actor, ANIMACTION_SHOOT, true);
index 9458189fd0ed20a448b9da906b3f654c12632452..a9c2d3ef0a69df95e0122727080c39027d1bde1c 100644 (file)
@@ -1,5 +1,7 @@
 #include "sv_sandbox.qh"
 
+#include <server/intermission.qh>
+
 string autocvar_g_sandbox;
 int autocvar_g_sandbox_info;
 bool autocvar_g_sandbox_readonly;
index 5a72ce47ec461aa3a13030ffda5412d0b21599d0..e238c40c229a1dfd3680993f765ba30639294e8d 100644 (file)
@@ -424,9 +424,6 @@ bool PlayerJump(entity this)
        SET_JUMP_HELD(this);
 
 #ifdef SVQC
-
-       this.oldvelocity_z = this.velocity_z;
-
        animdecide_setaction(this, ANIMACTION_JUMP, true);
 
        if (autocvar_g_jump_grunt)
@@ -653,7 +650,7 @@ void PM_check_hitground(entity this)
 void PM_Footsteps(entity this)
 {
 #ifdef SVQC
-       if (!g_footsteps) return;
+       if (!autocvar_g_footsteps) return;
        if (IS_DUCKED(this)) return;
        if (time >= this.lastground + 0.2) return;
        if (vdist(this.velocity, <=, autocvar_sv_maxspeed * 0.6)) return;
index da45243b63ae0b3f6b9738a71b418e40cbea92a4..5d2fcf7263afd1d8dad0c75e8658eba1eed5d21f 100644 (file)
@@ -190,7 +190,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
        #define IS_CLIENT(s)                        (((s).isplayermodel & ISPLAYER_CLIENT) || (s) == csqcplayer)
        #define IS_PLAYER(s)                        ((s).isplayermodel & ISPLAYER_PLAYER)
        #define IS_NOT_A_CLIENT(s)                  (!(s).isplayermodel && (s) != csqcplayer)
-       #define isPushable(s)                       ((s).isplayermodel || (s).pushable || ((s).flags & FL_PROJECTILE))
 
        //float player_multijump;
        //float player_jumpheight;
index 3b8c97c4b81626f6d292155e1831269540559b36..0202adb1dad10ccf9346176861585a8b297b65f0 100644 (file)
@@ -8,6 +8,7 @@
     #include <server/client.qh>
     #include "../server/anticheat.qh"
     #include <common/stats.qh>
+    #include <server/intermission.qh>
     #include "../server/scores.qh"
        #include <server/world.qh>
     #include "../server/weapons/accuracy.qh"
index 6d011e21ad0b3f9cb29102fc438fca1e47233b7c..2a0d7ac4f04645600541ede6d9d8c704ab45b70d 100644 (file)
@@ -2,6 +2,28 @@
 
 #include "sound.qh"
 
+#ifdef SVQC
+void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
+
+void stopsoundto(float _dest, entity e, float chan);
+
+void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch);
+
+bool sound_allowed(int dest, entity e);
+
+float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
+
+void play2(entity e, string filename);
+
+void play2all(string samp);
+
+void play2team(float t, string filename);
+
+void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float _pitch);
+
+void stopsound(entity e, float chan);
+#endif
+
 REGISTRY(Sounds, BITS(9))
 REGISTER_REGISTRY(Sounds)
 
index 631aaf11b51c2a910229cac79426cb986c98f6c1..606090db315cedf59e314fd29f411ddb1ea8b087 100644 (file)
 #elif defined(MENUQC)
 #elif defined(SVQC)
        #include <common/items/_mod.qh>
-    #include <lib/warpzone/anglestransform.qh>
-    #include <lib/warpzone/common.qh>
-    #include <lib/warpzone/util_server.qh>
-    #include <lib/warpzone/server.qh>
-    #include "../constants.qh"
-    #include "../stats.qh"
-    #include "../teams.qh"
-    #include <common/util.qh>
-    #include "../monsters/_mod.qh"
-    #include "config.qh"
-    #include <server/weapons/common.qh>
-    #include <server/weapons/csqcprojectile.qh>
-    #include <server/weapons/tracing.qh>
-    #include <server/items/spawning.qh>
-    #include <server/autocvars.qh>
-    #include "../notifications/all.qh"
-    #include "../deathtypes/all.qh"
-    #include <server/mutators/_mod.qh>
-    #include "../mapinfo.qh"
-    #include <server/command/_mod.qh>
-    #include <lib/csqcmodel/sv_model.qh>
-    #include <server/portals.qh>
-    #include <server/hook.qh>
+       #include <lib/warpzone/anglestransform.qh>
+       #include <lib/warpzone/common.qh>
+       #include <lib/warpzone/util_server.qh>
+       #include <lib/warpzone/server.qh>
+       #include "../constants.qh"
+       #include "../stats.qh"
+       #include "../teams.qh"
+       #include <common/util.qh>
+       #include "../monsters/_mod.qh"
+       #include "config.qh"
+       #include <server/weapons/common.qh>
+       #include <server/weapons/csqcprojectile.qh>
+       #include <server/weapons/tracing.qh>
+       #include <server/items/spawning.qh>
+       #include <server/autocvars.qh>
+       #include "../notifications/all.qh"
+       #include "../deathtypes/all.qh"
+       #include <server/mutators/_mod.qh>
+       #include "../mapinfo.qh"
+       #include <server/command/_mod.qh>
+       #include <lib/csqcmodel/sv_model.qh>
+       #include <server/portals.qh>
+#include <server/hook.qh>
 #endif
 #ifdef GAMEQC
        #include "calculations.qc"
@@ -159,12 +159,9 @@ float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass)
        Weapon e2 = REGISTRY_GET(Weapons, sj);
        int d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10;
        if (d != 0) return -d;  // high impulse first!
-       return strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),
-               sprintf(" %d ", si), 0)
-              -
-              strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),
-               sprintf(" %d ", sj), 0)
-       ;  // low char index first!
+       string s = strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " ");
+       return strstrofs(s, sprintf(" %d ", si), 0)
+               - strstrofs(s, sprintf(" %d ", sj), 0); // low char index first!
 }
 string W_FixWeaponOrder_BuildImpulseList(string o)
 {
@@ -508,7 +505,7 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim)
                        int idx = 0;
                        // v_ model attached to invisible h_ model
                        if (this.weaponchild
-                           && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
+                               && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
                        {
                                this.spawnorigin = gettaginfo(this.weaponchild, idx);
                        }
@@ -574,12 +571,10 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim)
        int compressed_shotorg = compressShotOrigin(this.movedir);
        // make them match perfectly
 #ifdef SVQC
-    // null during init
-    if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
-       this.movedir = decompressShotOrigin(compressed_shotorg);
-#else
-       this.movedir = decompressShotOrigin(compressed_shotorg);
+       // null during init
+       if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
 #endif
+       this.movedir = decompressShotOrigin(compressed_shotorg);
 
        this.spawnorigin += this.view_ofs;  // offset the casings origin by the same amount
 
@@ -600,7 +595,7 @@ NET_HANDLE(wframe, bool isNew)
 {
        WFRAME fr = ReadByte();
        float t = ReadFloat();
-    int slot = ReadByte();
+       int slot = ReadByte();
        bool restartanim = ReadByte();
        entity wepent = viewmodels[slot];
        if(fr == WFRAME_IDLE)
@@ -629,9 +624,9 @@ NET_HANDLE(wframe, bool isNew)
                case WS_DROP:
                        wepent.weapon_switchdelay = wepent.activeweapon.switchdelay_drop;
                        break;
-        default:
-            wepent.weapon_switchdelay = 0;
-            break;
+               default:
+                       wepent.weapon_switchdelay = 0;
+                       break;
        }
        return true;
 }
@@ -809,11 +804,11 @@ NET_HANDLE(w_muzzleflash, bool isNew)
 {
        return = true;
        int weapon_id = ReadByte();
-    int slot = ReadByte();
-    vector sv_shotorg = ReadVector();
+       int slot = ReadByte();
+       vector sv_shotorg = ReadVector();
 
        Weapon thiswep = REGISTRY_GET(Weapons, weapon_id);
-    vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
+       vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
        vector forward, right, up;
        MAKE_VECTORS(viewangles, forward, right, up);
 
@@ -824,7 +819,7 @@ NET_HANDLE(w_muzzleflash, bool isNew)
                pointparticles(thiswep.m_muzzleeffect, sv_shotorg, forward * 1000, 1);
                return;
        }
-    if(!autocvar_r_drawviewmodel) return;
+       if(!autocvar_r_drawviewmodel) return;
 
        entity wepent = viewmodels[slot];
        // get the local player entity to calculate shot origin
index 3323d8e36a5372eb6041e2348010a735b5f6e251..cd2d925bc56004223c86899c0c1b66e07db0c8f5 100644 (file)
@@ -189,7 +189,7 @@ vector W_CalculateSpread(vector forward, float spread, float spreadfactor, float
        float sigma;
        vector v1 = '0 0 0', v2;
        float dx, dy, r;
-       spread *= spreadfactor; //g_weaponspreadfactor;
+       spread *= spreadfactor; //autocvar_g_weaponspreadfactor;
        if(spread <= 0)
                return forward;
 
index 5f79c8ccfa58d622c4607dc5129e73783399b103..3af9a18da5af96e9e5cac254beebc099e60d45a4 100644 (file)
@@ -931,9 +931,7 @@ void Draw_ArcBeam(entity this)
                if(!v_shot_idx || this.beam_usevieworigin != 2)
                {
                        this.beam_shotorigin = wepent.movedir;
-                       origin_offset =
-                                right * -this.beam_shotorigin.y
-                               + up * this.beam_shotorigin.z;
+                       origin_offset = right * -this.beam_shotorigin.y + up * this.beam_shotorigin.z;
                }
                else
                        this.beam_shotorigin = '0 0 0';
index abed4209f7241959ea5fc82aeafbdd4844f078e1..5458a2496b92e9ab241660b0079fdcad09324092 100644 (file)
@@ -357,7 +357,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity)
                        s.y = v_forward.x;
                        s.z = v_forward.y;
                }
-               s = s * WEP_CVAR_PRI(crylink, spread) * g_weaponspreadfactor;
+               s = s * WEP_CVAR_PRI(crylink, spread) * autocvar_g_weaponspreadfactor;
                W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, false);
                settouch(proj, W_Crylink_Touch);
 
@@ -471,12 +471,12 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
                                s.y = v_forward.x;
                                s.z = v_forward.y;
                        }
-                       s = s * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor;
+                       s = s * WEP_CVAR_SEC(crylink, spread) * autocvar_g_weaponspreadfactor;
                        s = w_shotdir + right * s.y + up * s.z;
                }
                else
                {
-                       s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor);
+                       s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * autocvar_g_weaponspreadfactor);
                }
 
                W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, false);
@@ -505,7 +505,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
                proj.flags = FL_PROJECTILE;
                IL_PUSH(g_projectiles, proj);
                IL_PUSH(g_bot_dodge, proj);
-        proj.missile_flags = MIF_SPLASH;
+               proj.missile_flags = MIF_SPLASH;
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
index edbdecf0f0d00619c39057f449b330dbabb2e0ca..2796438378d94ad6c26813be2efcb5e5ad5c89e6 100644 (file)
@@ -165,7 +165,7 @@ void W_Fireball_Attack1(entity actor, .entity weaponentity)
        proj.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, proj);
        IL_PUSH(g_bot_dodge, proj);
-    proj.missile_flags = MIF_SPLASH | MIF_PROXY;
+       proj.missile_flags = MIF_SPLASH | MIF_PROXY;
 
        CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
 
@@ -297,7 +297,7 @@ void W_Fireball_Attack2(entity actor, .entity weaponentity)
        proj.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, proj);
        IL_PUSH(g_bot_dodge, proj);
-    proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
+       proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
 
        CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
 
index 73cb2b8b97afbe57ed97dc22255f5118b8a86eba..bfda2124de9119b3c7d87804a25f895a88786510 100644 (file)
@@ -221,7 +221,7 @@ void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponen
                // per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
                spread_pershot = ((shots - 1) / (WEP_CVAR_SEC(hagar, load_max) - 1));
                spread_pershot = (1 - (spread_pershot * WEP_CVAR_SEC(hagar, load_spread_bias)));
-               spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * g_weaponspreadfactor);
+               spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * autocvar_g_weaponspreadfactor);
 
                // pattern spread calculation
                s = '0 0 0';
@@ -233,7 +233,7 @@ void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponen
                        s.y = v_forward.x;
                        s.z = v_forward.y;
                }
-               s = s * WEP_CVAR_SEC(hagar, load_spread) * g_weaponspreadfactor;
+               s = s * WEP_CVAR_SEC(hagar, load_spread) * autocvar_g_weaponspreadfactor;
 
                W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, false);
 
index 3bc2258207990046fa27fc71cc8428e45b00c709..f3a0463cc007052cf9425d3a20f2b34c5beb0a3e 100644 (file)
@@ -21,14 +21,13 @@ void W_HLAC_Touch(entity this, entity toucher)
 void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 {
        entity missile;
-    float spread;
 
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(hlac, ammo), weaponentity);
 
-    spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
-    spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
-    if(IS_DUCKED(actor))
-        spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
+       float spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
+       spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
+       if(IS_DUCKED(actor))
+               spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
 
        W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage), thiswep.m_id);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
@@ -42,7 +41,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
 
-    missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
+       missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
 
        set_movetype(missile, MOVETYPE_FLY);
        PROJECTILE_MAKETRIGGER(missile);
@@ -56,7 +55,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        settouch(missile, W_HLAC_Touch);
        setthink(missile, SUB_Remove);
 
-    missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
+       missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
 
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
@@ -72,13 +71,10 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
 {
        entity missile;
-    float spread;
+       float spread = WEP_CVAR_SEC(hlac, spread);
 
-    spread = WEP_CVAR_SEC(hlac, spread);
-
-
-    if(IS_DUCKED(actor))
-        spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
+       if(IS_DUCKED(actor))
+               spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
 
        W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage), thiswep.m_id | HITTYPE_SECONDARY);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
@@ -87,7 +83,7 @@ void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        missile.owner = missile.realowner = actor;
        missile.bot_dodge = true;
 
-    missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
+       missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
 
        set_movetype(missile, MOVETYPE_FLY);
        PROJECTILE_MAKETRIGGER(missile);
@@ -101,7 +97,7 @@ void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        settouch(missile, W_HLAC_Touch);
        setthink(missile, SUB_Remove);
 
-    missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
+       missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
 
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
@@ -137,7 +133,7 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int
                ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(hlac, refire) * W_WeaponRateFactor(actor);
                W_HLAC_Attack(thiswep, actor, weaponentity);
                actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
-        weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame);
+               weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame);
        }
        else
        {
@@ -147,12 +143,10 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int
 
 void W_HLAC_Attack2_Frame(Weapon thiswep, entity actor, .entity weaponentity)
 {
-    float i;
-
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hlac, ammo), weaponentity);
 
-    for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
-        W_HLAC_Attack2(thiswep, actor, weaponentity);
+       for(float i = WEP_CVAR_SEC(hlac, shots); i > 0; --i)
+               W_HLAC_Attack2(thiswep, actor, weaponentity);
 
        if(!autocvar_g_norecoil)
        {
index 9f4bdc15e63d1ba3c6ef9e14177ce084952f97d7..3efa61102d76eecaaf2b29c81a239b127f54622b 100644 (file)
@@ -22,10 +22,10 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo
                fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pHeadshotDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK));
 
        if(autocvar_g_casings >= 2)
-    {
-        makevectors(actor.v_angle); // for some reason, this is lost
+       {
+               makevectors(actor.v_angle); // for some reason, this is lost
                SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor, weaponentity);
-    }
+       }
 }
 
 void W_Rifle_Attack(Weapon thiswep, entity actor, .entity weaponentity)
index 1f3fcc32f297f7032f1583884711e28eb0683804..bc1ce89479b4390b67dcf02ed87fd0468a02a3bf 100644 (file)
@@ -18,7 +18,7 @@ void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float
 
        for(int sc = 0;sc < bullets;sc = sc + 1)
                fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, 0, force, thiswep.m_id, bullet_trail_effect, false);
-       
+
        if(lag && bullets > 0)
                antilag_restore_all(actor);
 
index 5a1cd1a9200469c801d85576596ec7bf43117761..b20f6bda375d4e31f00166e20656960402358604 100644 (file)
@@ -51,8 +51,8 @@ void SendCSQCVortexBeamParticle(float charge) {
 NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
 {
        float charge;
-    vector shotorg = ReadVector();
-    vector endpos = ReadVector();
+       vector shotorg = ReadVector();
+       vector endpos = ReadVector();
        charge = ReadByte() / 255.0;
 
        //pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
@@ -112,9 +112,9 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
        myforcehalflife = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_forcehalflife);
        myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
 
-    float dtype = thiswep.m_id;
-    if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
-        dtype |= HITTYPE_ARMORPIERCE;
+       float dtype = thiswep.m_id;
+       if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
+               dtype |= HITTYPE_ARMORPIERCE;
 
        float flying;
        flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
@@ -152,7 +152,7 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
        actor.vortex_lasthit = damage_goodhits;
 
        //beam done on client
-    vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+       vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
        SendCSQCVortexBeamParticle(charge);
 
index 43dd56cb6a929736f055c4ed000f850d72846f6e..1aeecfafd62f242f84e857b4da6950ce94d04773 100644 (file)
@@ -2619,10 +2619,10 @@ float MOVETYPE_USER_LAST = 191;
 
 //idea: eukara
 //darkplaces implementation: Cloudwalk
-// Do NOT use in production yet.
-string __fullspawndata;
+//Do NOT use in production yet. Uncomment if you intend to use it
+//string __fullspawndata;
 //description:
-// http://icculus.org/finger/marco?date=2019-01-25&time=05-38-02
+//http://icculus.org/finger/marco?date=2019-01-25&time=05-38-02
 
 //DP_QC_FS_SEARCH_PACKFILE
 //idea: Mario
index 36cedec4f2fdfd1b96e935f1f5f91b84b230fd53..63d2c6388e8447e90e46445abbe65506e93e074b 100644 (file)
@@ -159,7 +159,7 @@ float OS_MAC                = 2;
 //////////////////////////////////////////////////
 // AK FIXME: Create perhaps a special builtin file for the common cmds
 
-void   checkextension(string ext)      = #1;
+float  checkextension(string ext)      = #1;
 
 // error cmds
 void   error(string err,...)           = #2;
@@ -542,7 +542,7 @@ void coverage() = #642;  // Reports a coverage event. The engine counts for each
 //idea: Mario
 //darkplaces implementation: Mario
 //builtin definitions:
-float(string pattern, float caseinsensitive, float quiet, string packfile) search_packfile_begin = #444;
+float(string pattern, float caseinsensitive, float quiet, string packfile) search_packfile_begin = #74;
 //description:
 //extension to search_begin (DP_QC_FS_SEARCH), performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
 //only searches for files within the specified packfile, which is expected to match the results of whichpack().
index 175c57c4844de5206959de1031ad4adff23577fa..31304012607b96c6f12169559489402042953d5b 100644 (file)
@@ -22,7 +22,7 @@ void sys_phys_monitor(entity this, float dt)
 {
        int buttons = PHYS_INPUT_BUTTON_MASK(this);
        anticheat_physics(this);
-       if (sv_maxidle > 0) {
+       if (autocvar_sv_maxidle > 0) {
                if (buttons != CS(this).buttons_old
                    || CS(this).movement != CS(this).movement_old
                    || this.v_angle != CS(this).v_angle_old) { CS(this).parm_idlesince = time; }
index 4b292a3a5b20a614b7d2fc3f9326c9e79758a8bf..d5b47ce43ee70bfdda9f758b3d2d36969bdd9ccb 100644 (file)
@@ -30,6 +30,76 @@ string MakeConsoleSafe(string input)
        return input;
 }
 
+/**
+ * Evaluate an expression of the form: [+ | -]? [var[op]val | [op]var | val | var] ...
+ * +: all must match. this is the default
+ * -: one must NOT match
+ *
+ * var>x
+ * var<x
+ * var>=x
+ * var<=x
+ * var==x
+ * var!=x
+ * var===x
+ * var!==x
+ */
+ERASEABLE
+bool expr_evaluate(string s)
+{
+    bool ret = false;
+    if (str2chr(s, 0) == '+') {
+        s = substring(s, 1, -1);
+    } else if (str2chr(s, 0) == '-') {
+        ret = true;
+        s = substring(s, 1, -1);
+    }
+    bool expr_fail = false;
+    for (int i = 0, n = tokenize_console(s); i < n; ++i) {
+        int o;
+        string k, v;
+        s = argv(i);
+        #define X(expr) \
+            if (expr) \
+                continue; \
+            expr_fail = true; \
+            break;
+
+        #define BINOP(op, len, expr) \
+            if ((o = strstrofs(s, op, 0)) >= 0) { \
+                k = substring(s, 0, o); \
+                v = substring(s, o + len, -1); \
+                X(expr); \
+            }
+        BINOP(">=", 2, cvar(k) >= stof(v));
+        BINOP("<=", 2, cvar(k) <= stof(v));
+        BINOP(">",  1, cvar(k) >  stof(v));
+        BINOP("<",  1, cvar(k) <  stof(v));
+        BINOP("==", 2, cvar(k) == stof(v));
+        BINOP("!=", 2, cvar(k) != stof(v));
+        BINOP("===", 3, cvar_string(k) == v);
+        BINOP("!==", 3, cvar_string(k) != v);
+        {
+            k = s;
+            bool b = true;
+            if (str2chr(k, 0) == '!') {
+                k = substring(s, 1, -1);
+                b = false;
+            }
+            float f = stof(k);
+            bool isnum = ftos(f) == k;
+            X(boolean(isnum ? f : cvar(k)) == b);
+        }
+        #undef BINOP
+        #undef X
+    }
+    if (!expr_fail) {
+        ret = !ret;
+    }
+    // now ret is true if we want to keep the item, and false if we want to get rid of it
+    return ret;
+}
+
 ERASEABLE
 void RegisterCvars_Set(string name, string def, string desc, bool archive, string file)
 {
index bed384ec69697b1bbf6f0df42b84fc2db2f94f9d..3f0f42c6c42bedfe3f2d551bbf216b93b9fc9447 100644 (file)
@@ -6,6 +6,8 @@
 /** If this global exists, only functions with spawnfunc_ name prefix qualify as spawn functions */
 noref bool require_spawnfunc_prefix;
 .bool spawnfunc_checked;
+/** Not for production use, provides access to a dump of the entity's fields when it is parsed from map data */
+//noref string __fullspawndata;
 
 .string fullspawndata;
 
index fed18941bee69f191fcb44346d55989d3617ab4f..cdd7d0d26389ba51ef98a5f761f432734d4581c2 100644 (file)
@@ -6,10 +6,12 @@
 #include <server/client.qc>
 #include <server/clientkill.qc>
 #include <server/damage.qc>
+#include <server/elimination.qc>
 #include <server/gamelog.qc>
 #include <server/handicap.qc>
 #include <server/hook.qc>
 #include <server/impulse.qc>
+#include <server/intermission.qc>
 #include <server/ipban.qc>
 #include <server/main.qc>
 #include <server/mapvoting.qc>
index d8679eb8aefe77dfefd848e3a9456a3bbb9c208a..7d1728f80f32965131c5848c47ce93140a6b458e 100644 (file)
@@ -6,10 +6,12 @@
 #include <server/client.qh>
 #include <server/clientkill.qh>
 #include <server/damage.qh>
+#include <server/elimination.qh>
 #include <server/gamelog.qh>
 #include <server/handicap.qh>
 #include <server/hook.qh>
 #include <server/impulse.qh>
+#include <server/intermission.qh>
 #include <server/ipban.qh>
 #include <server/main.qh>
 #include <server/mapvoting.qh>
index 16a8b91aa4bb218eae56c3a40f9ab40e06494747..28d08befe600655e24b7983b580f58db954e8344 100644 (file)
@@ -533,3 +533,22 @@ bool autocvar_g_weaponswitch_debug;
 bool autocvar_g_weaponswitch_debug_alternate;
 bool autocvar_g_allow_checkpoints;
 bool autocvar_sv_q3compat_changehitbox;
+int autocvar_sv_clones;
+bool autocvar_g_footsteps;
+float autocvar_sv_maxidle;
+bool autocvar_sv_maxidle_spectatorsareidle;
+int autocvar_sv_maxidle_slots;
+bool autocvar_sv_maxidle_slots_countbots;
+bool autocvar_sv_autotaunt;
+bool autocvar_g_warmup_allguns;
+bool autocvar_g_warmup_allow_timeout;
+float autocvar_g_weaponspreadfactor;
+float autocvar_g_weaponforcefactor;
+float autocvar_g_weapondamagefactor;
+float autocvar_g_weaponratefactor;
+float autocvar_g_weaponspeedfactor;
+float autocvar_sv_foginterval;
+bool autocvar_sv_ready_restart_repeatable;
+bool autocvar_g_jetpack;
+bool autocvar_sv_taunt;
+bool autocvar_sv_ready_restart;
index cf7cd99c2199f6e49b1761d5c060404b51dde7ad..ff361388b297b988548dffa4c1c125817f79eb91 100644 (file)
@@ -1462,8 +1462,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition)
                this.wp_goal_prev0 = e;
        }
 
-       if(g_jetpack)
-       if(e==this.navigation_jetpack_goal)
+       if((this.items & IT_JETPACK) && e == this.navigation_jetpack_goal)
                return true;
 
        // if it can reach the goal there is nothing more to do
index de46e57d508f12fcdb37a95f38da8ebee27da7ac..3153ff111fab853de015b24c90a3b0da9b0dcf23 100644 (file)
@@ -4,6 +4,7 @@
 #include <common/stats.qh>
 
 #include "cheats.qh"
+#include <server/intermission.qh>
 #include "miscfunctions.qh"
 #include "world.qh"
 
index 9d5cc1d42e3a051760ad5c528382d6448b465a2a..eb0b95e078ec6d2a1ca47cc411291fc6615cc3fb 100644 (file)
@@ -72,7 +72,7 @@ float CheatsAllowed(entity this, float i, int argc, float fr) // the cheat gets
                return 0;
 
        if(i == CHIMPULSE_CLONE_MOVING.impulse || i == CHIMPULSE_CLONE_STANDING.impulse)
-               if(this.lip < sv_clones)
+               if(this.lip < autocvar_sv_clones)
                        return 1;
 
        // haha
index 9454d5e36c779d5935e722f00a32cd0f79b9dfdb..22427fa243aa4a6f72a170834fad14c3331de28c 100644 (file)
@@ -16,6 +16,7 @@
 #include "damage.qh"
 #include "handicap.qh"
 #include "hook.qh"
+#include <server/intermission.qh>
 #include "command/common.qh"
 #include "command/vote.qh"
 #include "clientkill.qh"
@@ -83,6 +84,8 @@
 
 #include <common/weapons/weapon/vortex.qh>
 
+#define CHAT_NOSPECTATORS() ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
+
 STATIC_METHOD(Client, Add, void(Client this, int _team))
 {
     ClientConnect(this);
@@ -242,7 +245,7 @@ void setplayermodel(entity e, string modelname)
 /** putting a client as observer in the server */
 void PutObserverInServer(entity this)
 {
-    bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
+       bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
        PlayerState_detach(this);
 
        if (IS_PLAYER(this))
@@ -259,35 +262,33 @@ void PutObserverInServer(entity this)
                        if (vote_called) { VoteCount(false); }
                        ReadyCount();
                }
-    }
+       }
 
-    {
-        entity spot = SelectSpawnPoint(this, true);
-        if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
-        this.angles = vec2(spot.angles);
-        this.fixangle = true;
-        // offset it so that the spectator spawns higher off the ground, looks better this way
-        setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
-        if (IS_REAL_CLIENT(this))
-        {
-            msg_entity = this;
-            WriteByte(MSG_ONE, SVC_SETVIEW);
-            WriteEntity(MSG_ONE, this);
-        }
-        // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
-        // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
-        if(!autocvar_g_debug_globalsounds)
-        {
-               // needed for player sounds
-               this.model = "";
-               FixPlayermodel(this);
-        }
-        setmodel(this, MDL_Null);
-        setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
-        this.view_ofs = '0 0 0';
-    }
+       entity spot = SelectSpawnPoint(this, true);
+       if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
+       this.angles = vec2(spot.angles);
+       this.fixangle = true;
+       // offset it so that the spectator spawns higher off the ground, looks better this way
+       setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
+       if (IS_REAL_CLIENT(this))
+       {
+               msg_entity = this;
+               WriteByte(MSG_ONE, SVC_SETVIEW);
+               WriteEntity(MSG_ONE, this);
+       }
+       // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
+       // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
+       if(!autocvar_g_debug_globalsounds)
+       {
+               // needed for player sounds
+               this.model = "";
+               FixPlayermodel(this);
+       }
+       setmodel(this, MDL_Null);
+       setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
+       this.view_ofs = '0 0 0';
 
-    RemoveGrapplingHooks(this);
+       RemoveGrapplingHooks(this);
        Portal_ClearAll(this);
        Unfreeze(this, false);
        SetSpectatee(this, NULL);
@@ -303,12 +304,8 @@ void PutObserverInServer(entity this)
 
        WaypointSprite_PlayerDead(this);
 
-       if (CS(this).killcount != FRAGS_SPECTATOR)
-       {
-               if(!game_stopped)
-               if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2))
-                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
-       }
+       if (CS(this).killcount != FRAGS_SPECTATOR && !game_stopped && CHAT_NOSPECTATORS())
+               Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
 
        accuracy_resend(this);
 
@@ -319,7 +316,7 @@ void PutObserverInServer(entity this)
        if(this.monster_attack)
                IL_REMOVE(g_monster_targets, this);
        this.monster_attack = false;
-    STAT(HUD, this) = HUD_NORMAL;
+       STAT(HUD, this) = HUD_NORMAL;
        TRANSMUTE(Observer, this);
        this.iscreature = false;
        this.teleportable = TELEPORT_SIMPLE;
@@ -865,7 +862,7 @@ void ClientInit_misc(entity this)
        WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[2]));
        WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[3]));
 
-       if(sv_foginterval && world.fog != "")
+       if(autocvar_sv_foginterval && world.fog != "")
                WriteString(channel, world.fog);
        else
                WriteString(channel, "");
@@ -938,7 +935,7 @@ void DecodeLevelParms(entity this)
                CS(this).parm_idlesince = time;
 
        // whatever happens, allow 60 seconds of idling directly after connect for map loading
-       CS(this).parm_idlesince = max(CS(this).parm_idlesince, time - sv_maxidle + 60);
+       CS(this).parm_idlesince = max(CS(this).parm_idlesince, time - autocvar_sv_maxidle + 60);
 
        MUTATOR_CALLHOOK(DecodeLevelParms);
 }
@@ -1051,7 +1048,7 @@ string getwelcomemessage(entity this)
                modifications = strcat(modifications, ", Low gravity");
        if(g_weapon_stay && !g_cts)
                modifications = strcat(modifications, ", Weapons stay");
-       if(g_jetpack)
+       if(autocvar_g_jetpack)
                modifications = strcat(modifications, ", Jet pack");
        if(autocvar_g_powerups == 0)
                modifications = strcat(modifications, ", No powerups");
@@ -1170,7 +1167,7 @@ void ClientConnect(entity this)
                        stuffcmd(this, "cl_cmd settemp chase_active 1\n");
        }
 
-       if (!sv_foginterval && world.fog != "")
+       if (!autocvar_sv_foginterval && world.fog != "")
                stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
 
        if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AvailableTeams() == 2))
@@ -1231,7 +1228,7 @@ void ClientDisconnect(entity this)
        if(IS_SPEC(this))
                SetSpectatee(this, NULL);
 
-    MUTATOR_CALLHOOK(ClientDisconnect, this);
+       MUTATOR_CALLHOOK(ClientDisconnect, this);
 
        strfree(CS(this).netname_previous); // needs to be before the CS entity is removed!
        strfree(CS(this).weaponorder_byimpulse);
@@ -1995,10 +1992,10 @@ bool SpectatePrev(entity this)
        switch (MUTATOR_CALLHOOK(SpectatePrev, this, ent, first))
        {
                case MUT_SPECPREV_FOUND:
-                   ent = M_ARGV(1, entity);
-                   break;
+                       ent = M_ARGV(1, entity);
+                       break;
                case MUT_SPECPREV_RETURN:
-                   return true;
+                       return true;
                case MUT_SPECPREV_CONTINUE:
                default:
                {
@@ -2231,7 +2228,7 @@ bool PlayerThink(entity this)
        }
 
        if (timeout_status == TIMEOUT_ACTIVE) {
-        // don't allow the player to turn around while game is paused
+               // don't allow the player to turn around while game is paused
                // FIXME turn this into CSQC stuff
                this.v_angle = this.lastV_angle;
                this.angles = this.lastV_angle;
@@ -2757,21 +2754,21 @@ void PlayerPostThink (entity this)
 {
        Player_Physics(this);
 
-       if (sv_maxidle > 0)
+       if (autocvar_sv_maxidle > 0)
        if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
        if (IS_REAL_CLIENT(this))
-       if (IS_PLAYER(this) || sv_maxidle_spectatorsareidle)
+       if (IS_PLAYER(this) || autocvar_sv_maxidle_spectatorsareidle)
        {
                int totalClients = 0;
-               if(sv_maxidle_slots > 0)
+               if(autocvar_sv_maxidle_slots > 0)
                {
-                       FOREACH_CLIENT(IS_REAL_CLIENT(it) || sv_maxidle_slots_countbots,
+                       FOREACH_CLIENT(IS_REAL_CLIENT(it) || autocvar_sv_maxidle_slots_countbots,
                        {
                                ++totalClients;
                        });
                }
 
-               if (sv_maxidle_slots > 0 && (maxclients - totalClients) > sv_maxidle_slots)
+               if (autocvar_sv_maxidle_slots > 0 && (maxclients - totalClients) > autocvar_sv_maxidle_slots)
                { /* do nothing */ }
                else if (time - CS(this).parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
                {
@@ -2783,8 +2780,8 @@ void PlayerPostThink (entity this)
                }
                else
                {
-                       float timeleft = ceil(sv_maxidle - (time - CS(this).parm_idlesince));
-                       if (timeleft == min(10, sv_maxidle - 1)) { // - 1 to support sv_maxidle <= 10
+                       float timeleft = ceil(autocvar_sv_maxidle - (time - CS(this).parm_idlesince));
+                       if (timeleft == min(10, autocvar_sv_maxidle - 1)) { // - 1 to support sv_maxidle <= 10
                                if (!CS(this).idlekick_lasttimeleft)
                                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
                        }
@@ -2794,9 +2791,8 @@ void PlayerPostThink (entity this)
                                return;
                        }
                        else if (timeleft <= 10) {
-                               if (timeleft != CS(this).idlekick_lasttimeleft) {
-                                   Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
-                }
+                               if (timeleft != CS(this).idlekick_lasttimeleft)
+                                       Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
                                CS(this).idlekick_lasttimeleft = timeleft;
                        }
                }
@@ -2968,10 +2964,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
        var .float flood_field = floodcontrol_chat;
        if(floodcontrol && source)
        {
-               float flood_spl;
-               float flood_burst;
-               float flood_lmax;
-               float lines;
+               float flood_spl, flood_burst, flood_lmax;
                if(privatesay)
                {
                        flood_spl = autocvar_g_chat_flood_spl_tell;
@@ -3001,7 +2994,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
                {
                        getWrappedLine_remaining = msgstr;
                        msgstr = "";
-                       lines = 0;
+                       int lines = 0;
                        while(getWrappedLine_remaining && (!flood_lmax || lines <= flood_lmax))
                        {
                                msgstr = strcat(msgstr, " ", getWrappedLineLen(82.4289758859709, strlennocol)); // perl averagewidth.pl < gfx/vera-sans.width
@@ -3058,11 +3051,10 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
                sourcecmsgstr = cmsgstr;
        }
 
-       if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer))
+       if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped
+               && (teamsay || CHAT_NOSPECTATORS()))
        {
-               if (!game_stopped)
-               if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
-                       teamsay = -1; // spectators
+               teamsay = -1; // spectators
        }
 
        if(flood)
@@ -3093,11 +3085,10 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
                ret = 1;
        }
 
-       if (privatesay && source && !(IS_PLAYER(source) || source.caplayer))
+       if (privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped
+               && (IS_PLAYER(privatesay) || privatesay.caplayer) && CHAT_NOSPECTATORS())
        {
-               if (!game_stopped)
-               if ((privatesay && (IS_PLAYER(privatesay) || privatesay.caplayer)) && ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)))
-                       ret = -1; // just hide the message completely
+               ret = -1; // just hide the message completely
        }
 
        MUTATOR_CALLHOOK(ChatMessage, source, ret);
index e288bebfcb27ad10248c46fdd8ec2acbb22f1ecd..d074ebe4b5a9b94381770e5d4b022115e80b3518 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "utils.qh"
+#include <server/intermission.qh>
 #include <common/replicate.qh>
 #include <common/sounds/all.qh>
 
@@ -297,12 +298,6 @@ const int SVC_SETVIEW = 5; // TODO: move to dpdefs where this belongs!
 .float pauserotarmor_finished;
 .float pauserotfuel_finished;
 
-// idle kicking
-float sv_maxidle;
-float sv_maxidle_spectatorsareidle;
-int sv_maxidle_slots;
-bool sv_maxidle_slots_countbots;
-
 // g_<gametype>_str:
 // If 0, default is used.
 // If <0, 0 is used.
@@ -322,8 +317,6 @@ void ClientData_Touch(entity e);
 
 int nJoinAllowed(entity this, entity ignore);
 
-void FixIntermissionClient(entity e);
-
 void checkSpectatorBlock(entity this);
 
 void PlayerUseKey(entity this);
index fe92d36673552852495602cd46b6d798450b752f..67ac6d641c5f58bc8c67eaca8dab6b930f28394b 100644 (file)
@@ -384,9 +384,9 @@ void ClientCommand_ready(entity caller, int request)  // todo: anti-spam for tog
                {
                        if (IS_CLIENT(caller))
                        {
-                               if (warmup_stage || sv_ready_restart || g_race_qualifying == 2)
+                               if (warmup_stage || autocvar_sv_ready_restart || g_race_qualifying == 2)
                                {
-                                       if (!readyrestart_happened || sv_ready_restart_repeatable)
+                                       if (!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
                                        {
                                                if (time < game_starttime) // game is already restarting
                                                        return;
index 0f59802dd5960e3bdfb72230a7d2d877584ee00a..01fb5ad48048a6e7605636ffa0c37211a73db5f2 100644 (file)
@@ -720,7 +720,7 @@ void CommonCommand_timeout(int request, entity caller)  // DEAR GOD THIS COMMAND
                                {
                                        print_to(caller, "^7Error: You can not call a timeout while a vote is active.");
                                }
-                               else if (warmup_stage && !g_warmup_allow_timeout)
+                               else if (warmup_stage && !autocvar_g_warmup_allow_timeout)
                                {
                                        print_to(caller, "^7Error: You can not call a timeout in warmup-stage.");
                                }
index 3262974898a1a284858dcf3ef325c6eb393569ec..1cf124ad3c054d5c77999367d6573fea38f222dd 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <common/weapons/_all.qh>
 #include <common/stats.qh>
+#include <server/intermission.qh>
 #include <server/world.qh>
 #include <server/miscfunctions.qh>
 
index 6e73777a0f0321e55bd02ae54749e6f13623d914..4d3992239061fbc6e18937cca9a23e4c2aed1f59 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "../world.qh"
 
+#include <server/intermission.qh>
+
 #include <common/util.qh>
 
 #include <lib/csqcmodel/sv_model.qh>
index 7de740bdde1049fc7b1f8c7c8e4d797ef91df4ae..281297b049e8a90ed2c1ab23f364dc2ba286c8d0 100644 (file)
@@ -16,6 +16,7 @@
 #include "../world.qh"
 #include "../ipban.qh"
 #include "../teamplay.qh"
+#include <server/intermission.qh>
 
 #include "../bot/api.qh"
 
index bf0dafa9cfffe0698723624f29088e4fc2c37c74..8beb8fd5248cbf03807ac6a6f9a5a84b907f38e3 100644 (file)
@@ -7,8 +7,6 @@
 bool shuffleteams_on_reset_map;
 void shuffleteams();
 
-string GotoMap(string m);
-
 void race_deleteTime(string map, float pos);
 
 // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
index ee8a8e8db9a1550ec56cd407d3d2d0e05d6ccede..3d0cb29749baf3501a92360cd4a2014c23a832e4 100644 (file)
@@ -12,6 +12,7 @@
 #include "common.qh"
 
 #include "../damage.qh"
+#include <server/intermission.qh>
 #include "../world.qh"
 #include "../teamplay.qh"
 #include "../race.qh"
index f799e96f7451b3fcd7ee563afdab5199388ed5f2..02a795bba4c3d0e328ad025af3e0259e13163b91 100644 (file)
@@ -686,11 +686,11 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
 
                if (!DEATH_ISSPECIAL(deathtype))
                {
-                       damage *= g_weapondamagefactor;
-                       mirrordamage *= g_weapondamagefactor;
-                       complainteamdamage *= g_weapondamagefactor;
-                       force = force * g_weaponforcefactor;
-                       mirrorforce *= g_weaponforcefactor;
+                       damage *= autocvar_g_weapondamagefactor;
+                       mirrordamage *= autocvar_g_weapondamagefactor;
+                       complainteamdamage *= autocvar_g_weapondamagefactor;
+                       force = force * autocvar_g_weaponforcefactor;
+                       mirrorforce *= autocvar_g_weaponforcefactor;
                }
 
                // should this be changed at all? If so, in what way?
diff --git a/qcsrc/server/elimination.qc b/qcsrc/server/elimination.qc
new file mode 100644 (file)
index 0000000..8024c9a
--- /dev/null
@@ -0,0 +1,36 @@
+#include "elimination.qh"
+
+#include <common/net_linked.qh>
+#include <server/utils.qh>
+
+.float(entity) isEliminated;
+bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
+{
+       Stream out = MSG_ENTITY;
+       WriteHeader(out, ENT_CLIENT_ELIMINATEDPLAYERS);
+       serialize(byte, out, sendflags);
+       if (sendflags & 1) {
+               for (int i = 1; i <= maxclients; i += 8) {
+                       int f = 0;
+                       entity e = edict_num(i);
+                       for (int b = 0; b < 8; ++b, e = nextent(e)) {
+                               if (eliminatedPlayers.isEliminated(e)) {
+                                       f |= BIT(b);
+                               }
+                       }
+                       serialize(byte, out, f);
+               }
+       }
+       return true;
+}
+
+void EliminatedPlayers_Init(float(entity) isEliminated_func)
+{
+       if(eliminatedPlayers)
+       {
+               backtrace("Can't spawn eliminatedPlayers again!");
+               return;
+       }
+       Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
+       eliminatedPlayers.isEliminated = isEliminated_func;
+}
diff --git a/qcsrc/server/elimination.qh b/qcsrc/server/elimination.qh
new file mode 100644 (file)
index 0000000..5a50beb
--- /dev/null
@@ -0,0 +1,4 @@
+#pragma once
+
+entity eliminatedPlayers;
+void EliminatedPlayers_Init(float(entity) isEliminated_func);
index 2c61419c51a142aa7066d64d739f794d221315c7..a3e747cab6419a307034b227ca63bbbaf421d6f1 100644 (file)
@@ -1,7 +1,7 @@
 #include "gamelog.qh"
 
 #include <server/autocvars.qh>
-#include <server/miscfunctions.qh>
+#include <server/main.qh>
 
 string GameLog_ProcessIP(string s)
 {
index 6042a48e1a61edae4c6bd572d3564f051e959017..a84a37fc3d894cb7fe61b7af88341271365f6ce5 100644 (file)
@@ -414,7 +414,8 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
        Net_LinkEntity(missile, false, 0, GrapplingHookSend);
 }
 
-void GrappleHookInit()
+// NOTE: using PRECACHE here to make sure it's called after everything else
+PRECACHE(GrappleHookInit)
 {
        if(g_grappling_hook)
        {
index 1ed78e2745d9d4a4cdfff18792f9399af50fb7e6..3be5d6716bff1375ed3214404f4c3c079d0a2dcf 100644 (file)
@@ -18,6 +18,5 @@ const float HOOK_WAITING_FOR_RELEASE = BIT(4);
 .float hook_state;
 .int state;
 
-void GrappleHookInit();
 vector hook_shotorigin[4];
 
diff --git a/qcsrc/server/intermission.qc b/qcsrc/server/intermission.qc
new file mode 100644 (file)
index 0000000..fe2e0de
--- /dev/null
@@ -0,0 +1,479 @@
+#include "mapvoting.qh"
+
+#include <common/mapinfo.qh>
+#include <common/util.qh>
+#include <server/bot/api.qh>
+#include <server/campaign.qh>
+#include <server/client.qh>
+#include <server/mapvoting.qh>
+#include <server/scores_rules.qh>
+#include <server/world.qh>
+
+string GetGametype()
+{
+       return MapInfo_Type_ToString(MapInfo_LoadedGametype);
+}
+
+string GetMapname()
+{
+       return mapname;
+}
+
+float Map_Count, Map_Current;
+string Map_Current_Name;
+
+// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
+int GetMaplistPosition()
+{
+       string map = GetMapname();
+       int idx = autocvar_g_maplist_index;
+
+       if(idx >= 0)
+       {
+               if(idx < Map_Count)
+               {
+                       if(map == argv(idx))
+                       {
+                               return idx;
+                       }
+               }
+       }
+
+       for(int pos = 0; pos < Map_Count; ++pos)
+       {
+               if(map == argv(pos))
+                       return pos;
+       }
+
+       // resume normal maplist rotation if current map is not in g_maplist
+       return idx;
+}
+
+bool MapHasRightSize(string map)
+{
+       int minplayers = max(0, floor(autocvar_minplayers));
+       if (teamplay)
+               minplayers = max(0, floor(autocvar_minplayers_per_team) * AvailableTeams());
+       if (autocvar_g_maplist_check_waypoints
+               && (currentbots || autocvar_bot_number || player_count < minplayers))
+       {
+               string checkwp_msg = strcat("checkwp ", map);
+               if(!fexists(strcat("maps/", map, ".waypoints")))
+               {
+                       LOG_TRACE(checkwp_msg, ": no waypoints");
+                       return false;
+               }
+               LOG_TRACE(checkwp_msg, ": has waypoints");
+       }
+
+       if(autocvar_g_maplist_ignore_sizes)
+               return true;
+
+       // open map size restriction file
+       string opensize_msg = strcat("opensize ", map);
+       float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
+       int player_limit = ((autocvar_g_maplist_sizes_count_maxplayers) ? GetPlayerLimit() : 0);
+       int pcount = ((player_limit > 0) ? min(player_count, player_limit) : player_count); // bind it to the player limit so that forced spectators don't influence the limits
+       if(!autocvar_g_maplist_sizes_count_bots)
+               pcount -= currentbots;
+       if(fh >= 0)
+       {
+               opensize_msg = strcat(opensize_msg, ": ok, ");
+               int mapmin = stoi(fgets(fh));
+               int mapmax = stoi(fgets(fh));
+               fclose(fh);
+               if(pcount < mapmin)
+               {
+                       LOG_TRACE(opensize_msg, "not enough");
+                       return false;
+               }
+               if(mapmax && pcount > mapmax)
+               {
+                       LOG_TRACE(opensize_msg, "too many");
+                       return false;
+               }
+               LOG_TRACE(opensize_msg, "right size");
+               return true;
+       }
+       LOG_TRACE(opensize_msg, ": not found");
+       return true;
+}
+
+string Map_Filename(int position)
+{
+       return strcat("maps/", argv(position), ".bsp");
+}
+
+void Map_MarkAsRecent(string m)
+{
+       cvar_set("g_maplist_mostrecent", strwords(cons(m, autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
+}
+
+bool Map_IsRecent(string m)
+{
+       return strhasword(autocvar_g_maplist_mostrecent, m);
+}
+
+bool Map_Check(int position, float pass)
+{
+       string filename;
+       string map_next;
+       map_next = argv(position);
+       if(pass <= 1)
+       {
+               if(Map_IsRecent(map_next))
+                       return false;
+       }
+       filename = Map_Filename(position);
+       if(MapInfo_CheckMap(map_next))
+       {
+               if(pass == 2)
+                       return true;
+               if(MapHasRightSize(map_next))
+                       return true;
+               return false;
+       }
+       else
+               LOG_DEBUG( "Couldn't select '", filename, "'..." );
+
+       return false;
+}
+
+void Map_Goto_SetStr(string nextmapname)
+{
+       if(getmapname_stored != "")
+               strunzone(getmapname_stored);
+       if(nextmapname == "")
+               getmapname_stored = "";
+       else
+               getmapname_stored = strzone(nextmapname);
+}
+
+void Map_Goto_SetFloat(float position)
+{
+       cvar_set("g_maplist_index", ftos(position));
+       Map_Goto_SetStr(argv(position));
+}
+
+void Map_Goto(float reinit)
+{
+       MapInfo_LoadMap(getmapname_stored, reinit);
+}
+
+// return codes of map selectors:
+//   -1 = temporary failure (that is, try some method that is guaranteed to succeed)
+//   -2 = permanent failure
+float MaplistMethod_Iterate() // usual method
+{
+       float pass, i;
+
+       LOG_TRACE("Trying MaplistMethod_Iterate");
+
+       for(pass = 1; pass <= 2; ++pass)
+       {
+               for(i = 1; i < Map_Count; ++i)
+               {
+                       float mapindex;
+                       mapindex = (i + Map_Current) % Map_Count;
+                       if(Map_Check(mapindex, pass))
+                               return mapindex;
+               }
+       }
+       return -1;
+}
+
+float MaplistMethod_Repeat() // fallback method
+{
+       LOG_TRACE("Trying MaplistMethod_Repeat");
+
+       if(Map_Check(Map_Current, 2))
+               return Map_Current;
+       return -2;
+}
+
+float MaplistMethod_Random() // random map selection
+{
+       float i, imax;
+
+       LOG_TRACE("Trying MaplistMethod_Random");
+
+       imax = 42;
+
+       for(i = 0; i <= imax; ++i)
+       {
+               float mapindex;
+               mapindex = (Map_Current + floor(random() * (Map_Count - 1) + 1)) % Map_Count; // any OTHER map
+               if(Map_Check(mapindex, 1))
+                       return mapindex;
+       }
+       return -1;
+}
+
+float MaplistMethod_Shuffle(float exponent) // more clever shuffling
+// the exponent sets a bias on the map selection:
+// the higher the exponent, the less likely "shortly repeated" same maps are
+{
+       float i, j, imax, insertpos;
+
+       LOG_TRACE("Trying MaplistMethod_Shuffle");
+
+       imax = 42;
+
+       for(i = 0; i <= imax; ++i)
+       {
+               string newlist;
+
+               // now reinsert this at another position
+               insertpos = (random() ** (1 / exponent));       // ]0, 1]
+               insertpos = insertpos * (Map_Count - 1);       // ]0, Map_Count - 1]
+               insertpos = ceil(insertpos) + 1;               // {2, 3, 4, ..., Map_Count}
+               LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
+
+               // insert the current map there
+               newlist = "";
+               for(j = 1; j < insertpos; ++j)                 // i == 1: no loop, will be inserted as first; however, i == 1 has been excluded above
+                       newlist = strcat(newlist, " ", argv(j));
+               newlist = strcat(newlist, " ", argv(0));       // now insert the just selected map
+               for(j = insertpos; j < Map_Count; ++j)         // i == Map_Count: no loop, has just been inserted as last
+                       newlist = strcat(newlist, " ", argv(j));
+               newlist = substring(newlist, 1, strlen(newlist) - 1);
+               cvar_set("g_maplist", newlist);
+               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+
+               // NOTE: the selected map has just been inserted at (insertpos-1)th position
+               Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
+               if(Map_Check(Map_Current, 1))
+                       return Map_Current;
+       }
+       return -1;
+}
+
+void Maplist_Init()
+{
+       float i = Map_Count = 0;
+       if(autocvar_g_maplist != "")
+       {
+               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+               for (i = 0; i < Map_Count; ++i)
+               {
+                       if (Map_Check(i, 2))
+                               break;
+               }
+       }
+
+       if (i == Map_Count)
+       {
+               bprint( "Maplist contains no usable maps!  Resetting it to default map list.\n" );
+               cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST));
+               if(autocvar_g_maplist_shuffle)
+                       ShuffleMaplist();
+               if(!server_is_dedicated)
+                       localcmd("\nmenu_cmd sync\n");
+               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+       }
+       if(Map_Count == 0)
+               error("empty maplist, cannot select a new map");
+       Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1);
+
+       strcpy(Map_Current_Name, argv(Map_Current)); // will be automatically freed on exit thanks to DP
+       // this may or may not be correct, but who cares, in the worst case a map
+       // isn't chosen in the first pass that should have been
+}
+
+string GetNextMap()
+{
+       Maplist_Init();
+       float nextMap = -1;
+
+       if(nextMap == -1)
+               if(autocvar_g_maplist_shuffle > 0)
+                       nextMap = MaplistMethod_Shuffle(autocvar_g_maplist_shuffle + 1);
+
+       if(nextMap == -1)
+               if(autocvar_g_maplist_selectrandom)
+                       nextMap = MaplistMethod_Random();
+
+       if(nextMap == -1)
+               nextMap = MaplistMethod_Iterate();
+
+       if(nextMap == -1)
+               nextMap = MaplistMethod_Repeat();
+
+       if(nextMap >= 0)
+       {
+               Map_Goto_SetFloat(nextMap);
+               return getmapname_stored;
+       }
+
+       return "";
+}
+
+float DoNextMapOverride(float reinit)
+{
+       if(autocvar_g_campaign)
+       {
+               CampaignPostIntermission();
+               alreadychangedlevel = true;
+               return true;
+       }
+       if(autocvar_quit_when_empty)
+       {
+               if(player_count <= currentbots)
+               {
+                       localcmd("quit\n");
+                       alreadychangedlevel = true;
+                       return true;
+               }
+       }
+       if(autocvar_quit_and_redirect != "")
+       {
+               redirection_target = strzone(autocvar_quit_and_redirect);
+               alreadychangedlevel = true;
+               return true;
+       }
+       if (!reinit && autocvar_samelevel) // if samelevel is set, stay on same level
+       {
+               localcmd("restart\n");
+               alreadychangedlevel = true;
+               return true;
+       }
+       if(autocvar_nextmap != "")
+       {
+               string m;
+               m = GameTypeVote_MapInfo_FixName(autocvar_nextmap);
+               cvar_set("nextmap",m);
+
+               if(!m || gametypevote)
+                       return false;
+               if(autocvar_sv_vote_gametype)
+               {
+                       Map_Goto_SetStr(m);
+                       return false;
+               }
+
+               if(MapInfo_CheckMap(m))
+               {
+                       Map_Goto_SetStr(m);
+                       Map_Goto(reinit);
+                       alreadychangedlevel = true;
+                       return true;
+               }
+       }
+       if(!reinit && autocvar_lastlevel)
+       {
+               cvar_settemp_restore();
+               localcmd("set lastlevel 0\ntogglemenu 1\n");
+               alreadychangedlevel = true;
+               return true;
+       }
+       return false;
+}
+
+void GotoNextMap(float reinit)
+{
+       //string nextmap;
+       //float n, nummaps;
+       //string s;
+       if (alreadychangedlevel)
+               return;
+       alreadychangedlevel = true;
+
+       string nextMap = GetNextMap();
+       if(nextMap == "")
+               error("Everything is broken - cannot find a next map. Please report this to the developers.");
+       Map_Goto(reinit);
+}
+
+void ShuffleMaplist()
+{
+       cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
+}
+
+string GotoMap(string m)
+{
+       m = GameTypeVote_MapInfo_FixName(m);
+       if (!m)
+               return "The map you suggested is not available on this server.";
+       if (!autocvar_sv_vote_gametype)
+       if(!MapInfo_CheckMap(m))
+               return "The map you suggested does not support the current game mode.";
+       cvar_set("nextmap", m);
+       cvar_set("timelimit", "-1");
+       if(mapvote_initialized || alreadychangedlevel)
+       {
+               if(DoNextMapOverride(0))
+                       return "Map switch initiated.";
+               else
+                       return "Hm... no. For some reason I like THIS map more.";
+       }
+       else
+               return "Map switch will happen after scoreboard.";
+}
+
+
+/*
+============
+IntermissionThink
+
+When the player presses attack or jump, change to the next level
+============
+*/
+.float autoscreenshot;
+void IntermissionThink(entity this)
+{
+       FixIntermissionClient(this);
+
+       float server_screenshot = (autocvar_sv_autoscreenshot && CS(this).cvar_cl_autoscreenshot);
+       float client_screenshot = (CS(this).cvar_cl_autoscreenshot == 2);
+
+       if( (server_screenshot || client_screenshot)
+               && ((this.autoscreenshot > 0) && (time > this.autoscreenshot)) )
+       {
+               this.autoscreenshot = -1;
+               if(IS_REAL_CLIENT(this)) { stuffcmd(this, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(false, "%s"))); }
+               return;
+       }
+
+       if (time < intermission_exittime)
+               return;
+
+       if(!mapvote_initialized)
+               if (time < intermission_exittime + 10 && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this)))
+                       return;
+
+       MapVote_Start();
+}
+
+void FixIntermissionClient(entity e)
+{
+       if(!e.autoscreenshot) // initial call
+       {
+               e.autoscreenshot = time + 0.8;  // used for autoscreenshot
+               SetResourceExplicit(e, RES_HEALTH, -2342);
+               // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
+               for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+               {
+                   .entity weaponentity = weaponentities[slot];
+                       if(e.(weaponentity))
+                       {
+                               e.(weaponentity).effects = EF_NODRAW;
+                               if (e.(weaponentity).weaponchild)
+                                       e.(weaponentity).weaponchild.effects = EF_NODRAW;
+                       }
+               }
+               if(IS_REAL_CLIENT(e))
+               {
+                       stuffcmd(e, "\nscr_printspeed 1000000\n");
+                       RandomSelection_Init();
+                       FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, {
+                               RandomSelection_AddString(it, 1, 1);
+                       });
+                       if (RandomSelection_chosen_string != "")
+                       {
+                               stuffcmd(e, sprintf("\ncd loop %s\n", RandomSelection_chosen_string));
+                       }
+                       msg_entity = e;
+                       WriteByte(MSG_ONE, SVC_INTERMISSION);
+               }
+       }
+}
diff --git a/qcsrc/server/intermission.qh b/qcsrc/server/intermission.qh
new file mode 100644 (file)
index 0000000..03458eb
--- /dev/null
@@ -0,0 +1,31 @@
+#pragma once
+
+float intermission_running;
+float intermission_exittime;
+float alreadychangedlevel;
+
+string GetGametype();
+
+string GetMapname();
+
+void IntermissionThink(entity this);
+
+void FixIntermissionClient(entity e);
+
+void GotoNextMap(float reinit);
+
+bool Map_IsRecent(string m);
+
+string GetNextMap();
+
+void ShuffleMaplist();
+
+void Map_Goto_SetStr(string nextmapname);
+
+void Map_Goto(float reinit);
+
+void Map_MarkAsRecent(string m);
+
+float DoNextMapOverride(float reinit);
+
+string GotoMap(string m);
index 8dbb47283d59532ba96cc952dfbc6b503923eb61..49fea39d092e0bb74b2336acaba73e99cba57921 100644 (file)
@@ -112,3 +112,6 @@ float GiveItems(entity e, float beginarg, float endarg);
 
 IntrusiveList g_items;
 STATIC_INIT(g_items) { g_items = IL_NEW(); }
+
+#define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
+#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
index 737f63aa7870d6da5d48ff05b8b46f28528cf39e..3859ffa6f7e0b750452b5098db1fcf1232fa4bc2 100644 (file)
@@ -173,6 +173,62 @@ void SV_PausedTic(float elapsedtime)
        if (!server_is_dedicated) Pause_TryPause(false);
 }
 
+void dedicated_print(string input)
+{
+       if (server_is_dedicated) print(input);
+}
+
+void make_safe_for_remove(entity e)
+{
+    if (e.initialize_entity)
+    {
+        entity ent, prev = NULL;
+        for (ent = initialize_entity_first; ent; )
+        {
+            if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e)))
+            {
+                //print("make_safe_for_remove: getting rid of initializer ", etos(ent), "\n");
+                // skip it in linked list
+                if (prev)
+                {
+                    prev.initialize_entity_next = ent.initialize_entity_next;
+                    ent = prev.initialize_entity_next;
+                }
+                else
+                {
+                    initialize_entity_first = ent.initialize_entity_next;
+                    ent = initialize_entity_first;
+                }
+            }
+            else
+            {
+                prev = ent;
+                ent = ent.initialize_entity_next;
+            }
+        }
+    }
+}
+
+void remove_except_protected(entity e)
+{
+       if(e.remove_except_protected_forbidden)
+               error("not allowed to remove this at this point");
+       builtin_remove(e);
+}
+
+void remove_unsafely(entity e)
+{
+    if(e.classname == "spike")
+        error("Removing spikes is forbidden (crylink bug), please report");
+    builtin_remove(e);
+}
+
+void remove_safely(entity e)
+{
+    make_safe_for_remove(e);
+    builtin_remove(e);
+}
+
 /*
 =============
 StartFrame
@@ -266,75 +322,6 @@ void StartFrame()
 .string gametypefilter;
 .string cvarfilter;
 
-/**
- * Evaluate an expression of the form: [+ | -]? [var[op]val | [op]var | val | var] ...
- * +: all must match. this is the default
- * -: one must NOT match
- *
- * var>x
- * var<x
- * var>=x
- * var<=x
- * var==x
- * var!=x
- * var===x
- * var!==x
- */
-bool expr_evaluate(string s)
-{
-    bool ret = false;
-    if (str2chr(s, 0) == '+') {
-        s = substring(s, 1, -1);
-    } else if (str2chr(s, 0) == '-') {
-        ret = true;
-        s = substring(s, 1, -1);
-    }
-    bool expr_fail = false;
-    for (int i = 0, n = tokenize_console(s); i < n; ++i) {
-        int o;
-        string k, v;
-        s = argv(i);
-        #define X(expr) \
-            if (expr) \
-                continue; \
-            expr_fail = true; \
-            break;
-
-        #define BINOP(op, len, expr) \
-            if ((o = strstrofs(s, op, 0)) >= 0) { \
-                k = substring(s, 0, o); \
-                v = substring(s, o + len, -1); \
-                X(expr); \
-            }
-        BINOP(">=", 2, cvar(k) >= stof(v));
-        BINOP("<=", 2, cvar(k) <= stof(v));
-        BINOP(">",  1, cvar(k) >  stof(v));
-        BINOP("<",  1, cvar(k) <  stof(v));
-        BINOP("==", 2, cvar(k) == stof(v));
-        BINOP("!=", 2, cvar(k) != stof(v));
-        BINOP("===", 3, cvar_string(k) == v);
-        BINOP("!==", 3, cvar_string(k) != v);
-        {
-            k = s;
-            bool b = true;
-            if (str2chr(k, 0) == '!') {
-                k = substring(s, 1, -1);
-                b = false;
-            }
-            float f = stof(k);
-            bool isnum = ftos(f) == k;
-            X(boolean(isnum ? f : cvar(k)) == b);
-        }
-        #undef BINOP
-        #undef X
-    }
-    if (!expr_fail) {
-        ret = !ret;
-    }
-    // now ret is true if we want to keep the item, and false if we want to get rid of it
-    return ret;
-}
-
 void SV_OnEntityPreSpawnFunction(entity this)
 {
        if (this)
index dc3d80dbea81f83548c0cd977a68fcd75d6e70bb..a8c86fe2f2f304c5b4fe0c9ac4c42cea17232244 100644 (file)
@@ -1,5 +1,15 @@
 #pragma once
 
+/** print(), but only print if the server is not local */
+void dedicated_print(string input);
+
+.float remove_except_protected_forbidden;
+void remove_except_protected(entity e);
+
+void remove_safely(entity e);
+
+void remove_unsafely(entity e);
+
 bool expr_evaluate(string s);
 
 #ifdef PROFILING
index ac64f630ff1d5181372a33c21fb4e67bde03588a..bdd563b81c99156f632a47ce1be21e9087e1d418 100644 (file)
@@ -4,6 +4,7 @@
 #include <common/weapons/_all.qh>
 #include <common/stats.qh>
 #include <server/gamelog.qh>
+#include <server/intermission.qh>
 #include <server/miscfunctions.qh>
 #include "world.qh"
 #include "command/cmd.qh"
index c74637c07e6b5f886f5fa8dd3b7af8fbc16ee9cc..7da78ca0212baa6274886ec256f69b53ec00a8b6 100644 (file)
@@ -8,6 +8,7 @@
 #include "world.qh"
 #include <server/gamelog.qh>
 #include "ipban.qh"
+#include <server/intermission.qh>
 #include <server/items/items.qh>
 #include <server/mutators/_mod.qh>
 #include <server/spawnpoints.qh>
@@ -87,11 +88,6 @@ void WarpZone_crosshair_trace(entity pl)
        WarpZone_traceline_antilag(pl, CS(pl).cursor_trace_start, CS(pl).cursor_trace_start + normalize(CS(pl).cursor_trace_endpos - CS(pl).cursor_trace_start) * max_shot_distance, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl));
 }
 
-void dedicated_print(string input)
-{
-       if (server_is_dedicated) print(input);
-}
-
 entity findnearest(vector point, bool checkitems, vector axismod)
 {
     vector dist;
@@ -719,7 +715,7 @@ void readplayerstartcvars()
                warmup_start_weapons_default = '0 0 0';
                warmup_start_weapons_defaultmask = '0 0 0';
                FOREACH(Weapons, it != WEP_Null, {
-                       int w = want_weapon(it, g_warmup_allguns);
+                       int w = want_weapon(it, autocvar_g_warmup_allguns);
                        WepSet s = it.m_wepset;
                        if(w & 1)
                                warmup_start_weapons |= s;
@@ -730,7 +726,7 @@ void readplayerstartcvars()
                });
        }
 
-       if (g_jetpack)
+       if (autocvar_g_jetpack)
                start_items |= ITEM_Jetpack.m_itemid;
 
        MUTATOR_CALLHOOK(SetStartItems);
@@ -842,59 +838,6 @@ PRECACHE(PlayerModels)
     }
 }
 
-
-void make_safe_for_remove(entity e)
-{
-    if (e.initialize_entity)
-    {
-        entity ent, prev = NULL;
-        for (ent = initialize_entity_first; ent; )
-        {
-            if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e)))
-            {
-                //print("make_safe_for_remove: getting rid of initializer ", etos(ent), "\n");
-                // skip it in linked list
-                if (prev)
-                {
-                    prev.initialize_entity_next = ent.initialize_entity_next;
-                    ent = prev.initialize_entity_next;
-                }
-                else
-                {
-                    initialize_entity_first = ent.initialize_entity_next;
-                    ent = initialize_entity_first;
-                }
-            }
-            else
-            {
-                prev = ent;
-                ent = ent.initialize_entity_next;
-            }
-        }
-    }
-}
-
-.float remove_except_protected_forbidden;
-void remove_except_protected(entity e)
-{
-       if(e.remove_except_protected_forbidden)
-               error("not allowed to remove this at this point");
-       builtin_remove(e);
-}
-
-void remove_unsafely(entity e)
-{
-    if(e.classname == "spike")
-        error("Removing spikes is forbidden (crylink bug), please report");
-    builtin_remove(e);
-}
-
-void remove_safely(entity e)
-{
-    make_safe_for_remove(e);
-    builtin_remove(e);
-}
-
 void InitializeEntity(entity e, void(entity this) func, int order)
 {
     entity prev, cur;
@@ -966,41 +909,6 @@ void InitializeEntitiesRun()
     delete_fn = remove_unsafely;
 }
 
-.float(entity) isEliminated;
-bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
-{
-       Stream out = MSG_ENTITY;
-       WriteHeader(out, ENT_CLIENT_ELIMINATEDPLAYERS);
-       serialize(byte, out, sendflags);
-       if (sendflags & 1) {
-               for (int i = 1; i <= maxclients; i += 8) {
-                       int f = 0;
-                       entity e = edict_num(i);
-                       for (int b = 0; b < 8; ++b, e = nextent(e)) {
-                               if (eliminatedPlayers.isEliminated(e)) {
-                                       f |= BIT(b);
-                               }
-                       }
-                       serialize(byte, out, f);
-               }
-       }
-       return true;
-}
-
-void EliminatedPlayers_Init(float(entity) isEliminated_func)
-{
-       if(eliminatedPlayers)
-       {
-               backtrace("Can't spawn eliminatedPlayers again!");
-               return;
-       }
-       Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
-       eliminatedPlayers.isEliminated = isEliminated_func;
-}
-
-
-
-
 void adaptor_think2use_hittype_splash(entity this) // for timed projectile detonation
 {
        if(!(IS_ONGROUND(this))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
@@ -1422,31 +1330,6 @@ float LostMovetypeFollow(entity ent)
        return 0;
 }
 
-.bool pushable;
-bool isPushable(entity e)
-{
-       if(e.pushable)
-               return true;
-       if(IS_VEHICLE(e))
-               return false;
-       if(e.iscreature)
-               return true;
-       if (Item_IsLoot(e))
-       {
-               return true;
-       }
-       switch(e.classname)
-       {
-               case "body":
-                       return true;
-               case "bullet": // antilagged bullets can't hit this either
-                       return false;
-       }
-       if (e.projectiledeathtype)
-               return true;
-       return false;
-}
-
 string GetField_fullspawndata(entity e, string f, ...)
 /* Retrieves the value of a map entity field from fullspawndata
  * This bypasses field value changes made by the engine,
index 8a2406316cc9038549fc15f38fa303a40c349245..0f37cfac73a32df98095a984de87d97bb53d0db8 100644 (file)
@@ -5,6 +5,7 @@
 #include <server/client.qh>
 #include <server/world.qh>
 
+#include <server/intermission.qh>
 #include <server/items/items.qh>
 
 #include <server/mutators/_mod.qh>
 
 .vector dropped_origin;
 
-entity eliminatedPlayers;
-void EliminatedPlayers_Init(float(entity) isEliminated_func);
-
 void write_recordmarker(entity pl, float tstart, float dt);
 
-void play2all(string samp);
-
-void play2team(float t, string filename);
-
 void GetCvars_handleFloat(entity this, entity store, string thisname, float f, .float field, string name);
 
-float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
-
 void GetCvars_handleString(entity this, entity store, string thisname, float f, .string field, string name);
 
 void precache_all_playermodels(string pattern);
 
-void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
-
 void InitializeEntitiesRun();
 
-void stopsoundto(float _dest, entity e, float chan);
-void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch);
-
 void droptofloor(entity this);
 
 float trace_hits_box_1d(float end, float thmi, float thma);
@@ -61,15 +48,8 @@ void follow_sameorigin(entity e, entity to);
 
 string formatmessage(entity this, string msg);
 
-/** print(), but only print if the server is not local */
-void dedicated_print(string input);
-
 void GetCvars(entity this, entity store, int f);
 
-string GetMapname();
-
-float isPushable(entity e);
-
 float LostMovetypeFollow(entity ent);
 
 string uid2name(string myuid);
@@ -80,20 +60,10 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
 
 string NearestLocation(vector p);
 
-void play2(entity e, string filename);
-
 string playername(entity p, bool team_colorize);
 
-void remove_safely(entity e);
-
-void remove_unsafely(entity e);
-
 void SetMovetypeFollow(entity ent, entity e);
 
-void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float _pitch);
-
-void stopsound(entity e, float chan);
-
 float tracebox_hits_box(vector start, vector mi, vector ma, vector end, vector thmi, vector thma);
 
 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
@@ -102,41 +72,11 @@ void WarpZone_crosshair_trace(entity pl);
 
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
 
-#define IS_DEAD(s) ((s).deadflag != DEAD_NO)
-
-
-#define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
-#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
-
 #define PROJECTILE_TOUCH(e,t) MACRO_BEGIN if (WarpZone_Projectile_Touch(e,t)) return; MACRO_END
 
-#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
-
 // copies a string to a tempstring (so one can strunzone it)
 string strcat1(string s) = #115; // FRIK_FILE
 
-/*
-// NOTE: DO NOT USE THIS FUNCTION TOO OFTEN.
-// IT WILL MOST PROBABLY DESTROY _ALL_ OTHER TEMP
-// STRINGS AND TAKE QUITE LONG. haystack and needle MUST
-// BE CONSTANT OR strzoneD!
-float strstrofs(string haystack, string needle, float offset)
-{
-       float len, endpos;
-       string found;
-       len = strlen(needle);
-       endpos = strlen(haystack) - len;
-       while(offset <= endpos)
-       {
-               found = substring(haystack, offset, len);
-               if(found == needle)
-                       return offset;
-               offset = offset + 1;
-       }
-       return -1;
-}
-*/
-
 const float NUM_NEAREST_ENTITIES = 4;
 entity nearest_entity[NUM_NEAREST_ENTITIES];
 float nearest_length[NUM_NEAREST_ENTITIES];
@@ -155,11 +95,6 @@ float g_weaponarena;
 WepSet g_weaponarena_weapons;
 float g_weaponarena_random; // TODO
 string g_weaponarena_list;
-float g_weaponspeedfactor;
-float g_weaponratefactor;
-float g_weapondamagefactor;
-float g_weaponforcefactor;
-float g_weaponspreadfactor;
 
 WepSet start_weapons;
 WepSet start_weapons_default;
@@ -183,7 +118,7 @@ float start_armorvalue;
 WepSet warmup_start_weapons;
 WepSet warmup_start_weapons_default;
 WepSet warmup_start_weapons_defaultmask;
-#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
+#define WARMUP_START_WEAPONS ((autocvar_g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
 float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
@@ -197,45 +132,20 @@ float g_weapon_stay;
 float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done?
 void readplayerstartcvars();
 
-float sv_autotaunt;
-float sv_taunt;
-
-float g_footsteps, g_grappling_hook;
-float g_warmup_allguns;
-float g_warmup_allow_timeout;
+float g_grappling_hook;
 float warmup_stage;
-float g_jetpack;
 
-bool sv_ready_restart;
 bool sv_ready_restart_after_countdown;
-bool sv_ready_restart_repeatable;
-
-float sv_clones;
-float sv_foginterval;
 
 void readlevelcvars()
 {
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
 
-       sv_clones = cvar("sv_clones");
-       sv_foginterval = cvar("sv_foginterval");
-       g_footsteps = cvar("g_footsteps");
-       g_jetpack = cvar("g_jetpack");
-       sv_maxidle = cvar("sv_maxidle");
-       sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
-       sv_maxidle_slots = cvar("sv_maxidle_slots");
-       sv_maxidle_slots_countbots = cvar("sv_maxidle_slots_countbots");
-       sv_autotaunt = cvar("sv_autotaunt");
-       sv_taunt = cvar("sv_taunt");
-       sv_ready_restart = cvar("sv_ready_restart");
        sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown");
-       sv_ready_restart_repeatable = cvar("sv_ready_restart_repeatable");
 
        warmup_stage = cvar("g_warmup");
        warmup_limit = cvar("g_warmup_limit");
-       g_warmup_allguns = cvar("g_warmup_allguns");
-       g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
 
        if(cvar("g_campaign"))
                warmup_stage = 0; // no warmup during campaign
@@ -255,12 +165,6 @@ void readlevelcvars()
        g_pickup_respawntimejitter_long = cvar("g_pickup_respawntimejitter_long");
        g_pickup_respawntimejitter_powerup = cvar("g_pickup_respawntimejitter_powerup");
 
-       g_weaponspeedfactor = cvar("g_weaponspeedfactor");
-       g_weaponratefactor = cvar("g_weaponratefactor");
-       g_weapondamagefactor = cvar("g_weapondamagefactor");
-       g_weaponforcefactor = cvar("g_weaponforcefactor");
-       g_weaponspreadfactor = cvar("g_weaponspreadfactor");
-
        g_pickup_shells = cvar("g_pickup_shells");
        g_pickup_shells_max = cvar("g_pickup_shells_max");
        g_pickup_nails = cvar("g_pickup_nails");
@@ -332,11 +236,6 @@ const int INITPRIO_LAST            = 99;
 .entity initialize_entity_next;
 entity initialize_entity_first;
 
-
-
-
-
-bool sound_allowed(int dest, entity e);
 void InitializeEntity(entity e, void(entity this) func, int order);
 
 IntrusiveList g_ctrace_changed;
index e9792b6197df307976ecdedd7ff0885344de60e0..0c5e93954418498d0dc0ae0aed2f2d3659e952f4 100644 (file)
@@ -3,6 +3,7 @@
 #include <common/weapons/_all.qh>
 #include <common/stats.qh>
 #include <server/damage.qh>
+#include <server/intermission.qh>
 #include <server/world.qh>
 #include <server/miscfunctions.qh>
 #include <server/weapons/common.qh>
index e4e1d236aba4c11690c06c50dc99a03bd9dcb0c1..7bd776989b6d0cc5a8e73e5c93d829f84285b506 100644 (file)
@@ -3,6 +3,7 @@
 #include "command/common.qh"
 #include <common/weapons/_all.qh>
 #include "client.qh"
+#include <server/intermission.qh>
 #include <server/world.qh>
 #include <server/miscfunctions.qh>
 #include <server/mutators/_mod.qh>
index b629ef168449af6f5280a1fd5469ddacc2bc645b..532d631180203e50af27fddbdab40fd8820836ec 100644 (file)
@@ -16,6 +16,7 @@
 #include "../common/util.qh"
 #include "../lib/warpzone/common.qh"
 #include "../lib/warpzone/util_server.qh"
+#include <server/intermission.qh>
 #include <server/utils.qh>
 #include <server/command/vote.qh>
 
index a37029590a220137294fd26392fd0425550d58d2..ae0c284fe5e0c626111fb3fa59415d5615dfc1be 100644 (file)
@@ -23,6 +23,9 @@ const string STR_OBSERVER = "observer";
 #define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
 
 #define IS_MOVABLE(v) ((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v))
+#define IS_DEAD(s) ((s).deadflag != DEAD_NO)
+
+#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
 
 // NOTE: FOR_EACH_CLIENTSLOT deprecated! Use the following instead: FOREACH_CLIENTSLOT(true, { code; });
 // NOTE: FOR_EACH_CLIENT deprecated! Use the following instead: FOREACH_CLIENT(true, { code; });
index f4de0e1bf15996ac12aed1a31e64652493d96822..3e838265266dd4d44e0fdd4fbdc294587eeb1365 100644 (file)
@@ -196,7 +196,7 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p
        mspercallsum -= gettime(GETTIME_HIRES);
        #endif
 
-       dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
+       dir = W_CalculateSpread(dir, spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
 
        #if 0
        mspercallsum += gettime(GETTIME_HIRES);
index 552ab67310b929bb27606b76378519341c042741..02ba234ea990f9a4844473c6f2830a5b5f5dc738 100644 (file)
@@ -1,5 +1,6 @@
 #include "weaponstats.qh"
 
+#include <server/intermission.qh>
 #include <common/weapons/_all.qh>
 #include <common/stats.qh>
 #include <server/miscfunctions.qh>
index 7638813882d306ca3e67544c10290ed80231d866..487154fe36009147d099934de0fd30363517e66f 100644 (file)
@@ -31,8 +31,8 @@
 float W_WeaponRateFactor(entity this)
 {
        float t = 1;
-       if(g_weaponratefactor > 0)
-               t = 1.0 / g_weaponratefactor;
+       if(autocvar_g_weaponratefactor > 0)
+               t = 1.0 / autocvar_g_weaponratefactor;
 
        MUTATOR_CALLHOOK(WeaponRateFactor, t, this);
        t = M_ARGV(0, float);
@@ -42,7 +42,7 @@ float W_WeaponRateFactor(entity this)
 
 float W_WeaponSpeedFactor(entity this)
 {
-       float t = 1.0 * g_weaponspeedfactor;
+       float t = 1.0 * autocvar_g_weaponspeedfactor;
 
        MUTATOR_CALLHOOK(WeaponSpeedFactor, t, this);
        t = M_ARGV(0, float);
@@ -409,7 +409,7 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(
        {
                FOREACH_CLIENT(true, {
                        if(it == actor || (IS_SPEC(it) && it.enemy == actor))
-                               wframe_send(it, this, fr, g_weaponratefactor, restartanim);
+                               wframe_send(it, this, fr, autocvar_g_weaponratefactor, restartanim);
                });
        }
 
index 1883177025be2db4ddaaa21b7c2360d79b52fad8..452d172a9997b4dd56109737a0452819501b3ce5 100644 (file)
@@ -14,6 +14,8 @@
 #include <server/gamelog.qh>
 #include <server/damage.qh>
 #include "ipban.qh"
+#include <server/intermission.qh>
+#include <server/main.qh>
 #include "mapvoting.qh"
 #include <server/mutators/_mod.qh>
 #include "race.qh"
@@ -96,7 +98,6 @@ void PingPLReport_Spawn()
 }
 
 const float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
-string redirection_target;
 float world_initialized;
 
 void SetDefaultAlpha()
@@ -627,7 +628,7 @@ STATIC_INIT_EARLY(maxclients)
        }
 }
 
-void default_delayedinit(entity this)
+void GameplayMode_DelayedInit(entity this)
 {
        if(!scores_initialized)
                ScoreRules_generic();
@@ -677,11 +678,10 @@ void InitGameplayMode()
        cache_mutatormsg = strzone("");
        cache_lastmutatormsg = strzone("");
 
-       InitializeEntity(NULL, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
+       InitializeEntity(NULL, GameplayMode_DelayedInit, INITPRIO_GAMETYPE_FALLBACK);
 }
 
-void Map_MarkAsRecent(string m);
-float world_already_spawned;
+bool world_already_spawned;
 spawnfunc(worldspawn)
 {
        server_is_dedicated = boolean(stof(cvar_defstring("is_dedicated")));
@@ -814,7 +814,6 @@ spawnfunc(worldspawn)
        static_init_late();
        static_init_precache();
        readlevelcvars();
-       GrappleHookInit();
 
        GameRules_limit_fallbacks();
 
@@ -1017,415 +1016,6 @@ spawnfunc(light)
        delete(this);
 }
 
-string GetGametype()
-{
-       return MapInfo_Type_ToString(MapInfo_LoadedGametype);
-}
-
-string GetMapname()
-{
-       return mapname;
-}
-
-float Map_Count, Map_Current;
-string Map_Current_Name;
-
-// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
-int GetMaplistPosition()
-{
-       string map = GetMapname();
-       int idx = autocvar_g_maplist_index;
-
-       if(idx >= 0)
-       {
-               if(idx < Map_Count)
-               {
-                       if(map == argv(idx))
-                       {
-                               return idx;
-                       }
-               }
-       }
-
-       for(int pos = 0; pos < Map_Count; ++pos)
-       {
-               if(map == argv(pos))
-                       return pos;
-       }
-
-       // resume normal maplist rotation if current map is not in g_maplist
-       return idx;
-}
-
-bool MapHasRightSize(string map)
-{
-       int minplayers = max(0, floor(autocvar_minplayers));
-       if (teamplay)
-               minplayers = max(0, floor(autocvar_minplayers_per_team) * AvailableTeams());
-       if (autocvar_g_maplist_check_waypoints
-               && (currentbots || autocvar_bot_number || player_count < minplayers))
-       {
-               string checkwp_msg = strcat("checkwp ", map);
-               if(!fexists(strcat("maps/", map, ".waypoints")))
-               {
-                       LOG_TRACE(checkwp_msg, ": no waypoints");
-                       return false;
-               }
-               LOG_TRACE(checkwp_msg, ": has waypoints");
-       }
-
-       if(autocvar_g_maplist_ignore_sizes)
-               return true;
-
-       // open map size restriction file
-       string opensize_msg = strcat("opensize ", map);
-       float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
-       int player_limit = ((autocvar_g_maplist_sizes_count_maxplayers) ? GetPlayerLimit() : 0);
-       int pcount = ((player_limit > 0) ? min(player_count, player_limit) : player_count); // bind it to the player limit so that forced spectators don't influence the limits
-       if(!autocvar_g_maplist_sizes_count_bots)
-               pcount -= currentbots;
-       if(fh >= 0)
-       {
-               opensize_msg = strcat(opensize_msg, ": ok, ");
-               int mapmin = stoi(fgets(fh));
-               int mapmax = stoi(fgets(fh));
-               fclose(fh);
-               if(pcount < mapmin)
-               {
-                       LOG_TRACE(opensize_msg, "not enough");
-                       return false;
-               }
-               if(mapmax && pcount > mapmax)
-               {
-                       LOG_TRACE(opensize_msg, "too many");
-                       return false;
-               }
-               LOG_TRACE(opensize_msg, "right size");
-               return true;
-       }
-       LOG_TRACE(opensize_msg, ": not found");
-       return true;
-}
-
-string Map_Filename(float position)
-{
-       return strcat("maps/", argv(position), ".bsp");
-}
-
-void Map_MarkAsRecent(string m)
-{
-       cvar_set("g_maplist_mostrecent", strwords(cons(m, autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
-}
-
-float Map_IsRecent(string m)
-{
-       return strhasword(autocvar_g_maplist_mostrecent, m);
-}
-
-float Map_Check(float position, float pass)
-{
-       string filename;
-       string map_next;
-       map_next = argv(position);
-       if(pass <= 1)
-       {
-               if(Map_IsRecent(map_next))
-                       return 0;
-       }
-       filename = Map_Filename(position);
-       if(MapInfo_CheckMap(map_next))
-       {
-               if(pass == 2)
-                       return 1;
-               if(MapHasRightSize(map_next))
-                       return 1;
-               return 0;
-       }
-       else
-               LOG_DEBUG( "Couldn't select '", filename, "'..." );
-
-       return 0;
-}
-
-void Map_Goto_SetStr(string nextmapname)
-{
-       if(getmapname_stored != "")
-               strunzone(getmapname_stored);
-       if(nextmapname == "")
-               getmapname_stored = "";
-       else
-               getmapname_stored = strzone(nextmapname);
-}
-
-void Map_Goto_SetFloat(float position)
-{
-       cvar_set("g_maplist_index", ftos(position));
-       Map_Goto_SetStr(argv(position));
-}
-
-void Map_Goto(float reinit)
-{
-       MapInfo_LoadMap(getmapname_stored, reinit);
-}
-
-// return codes of map selectors:
-//   -1 = temporary failure (that is, try some method that is guaranteed to succeed)
-//   -2 = permanent failure
-float MaplistMethod_Iterate() // usual method
-{
-       float pass, i;
-
-       LOG_TRACE("Trying MaplistMethod_Iterate");
-
-       for(pass = 1; pass <= 2; ++pass)
-       {
-               for(i = 1; i < Map_Count; ++i)
-               {
-                       float mapindex;
-                       mapindex = (i + Map_Current) % Map_Count;
-                       if(Map_Check(mapindex, pass))
-                               return mapindex;
-               }
-       }
-       return -1;
-}
-
-float MaplistMethod_Repeat() // fallback method
-{
-       LOG_TRACE("Trying MaplistMethod_Repeat");
-
-       if(Map_Check(Map_Current, 2))
-               return Map_Current;
-       return -2;
-}
-
-float MaplistMethod_Random() // random map selection
-{
-       float i, imax;
-
-       LOG_TRACE("Trying MaplistMethod_Random");
-
-       imax = 42;
-
-       for(i = 0; i <= imax; ++i)
-       {
-               float mapindex;
-               mapindex = (Map_Current + floor(random() * (Map_Count - 1) + 1)) % Map_Count; // any OTHER map
-               if(Map_Check(mapindex, 1))
-                       return mapindex;
-       }
-       return -1;
-}
-
-float MaplistMethod_Shuffle(float exponent) // more clever shuffling
-// the exponent sets a bias on the map selection:
-// the higher the exponent, the less likely "shortly repeated" same maps are
-{
-       float i, j, imax, insertpos;
-
-       LOG_TRACE("Trying MaplistMethod_Shuffle");
-
-       imax = 42;
-
-       for(i = 0; i <= imax; ++i)
-       {
-               string newlist;
-
-               // now reinsert this at another position
-               insertpos = (random() ** (1 / exponent));       // ]0, 1]
-               insertpos = insertpos * (Map_Count - 1);       // ]0, Map_Count - 1]
-               insertpos = ceil(insertpos) + 1;               // {2, 3, 4, ..., Map_Count}
-               LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
-
-               // insert the current map there
-               newlist = "";
-               for(j = 1; j < insertpos; ++j)                 // i == 1: no loop, will be inserted as first; however, i == 1 has been excluded above
-                       newlist = strcat(newlist, " ", argv(j));
-               newlist = strcat(newlist, " ", argv(0));       // now insert the just selected map
-               for(j = insertpos; j < Map_Count; ++j)         // i == Map_Count: no loop, has just been inserted as last
-                       newlist = strcat(newlist, " ", argv(j));
-               newlist = substring(newlist, 1, strlen(newlist) - 1);
-               cvar_set("g_maplist", newlist);
-               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
-
-               // NOTE: the selected map has just been inserted at (insertpos-1)th position
-               Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
-               if(Map_Check(Map_Current, 1))
-                       return Map_Current;
-       }
-       return -1;
-}
-
-void Maplist_Init()
-{
-       float i = Map_Count = 0;
-       if(autocvar_g_maplist != "")
-       {
-               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
-               for (i = 0; i < Map_Count; ++i)
-               {
-                       if (Map_Check(i, 2))
-                               break;
-               }
-       }
-
-       if (i == Map_Count)
-       {
-               bprint( "Maplist contains no usable maps!  Resetting it to default map list.\n" );
-               cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST));
-               if(autocvar_g_maplist_shuffle)
-                       ShuffleMaplist();
-               if(!server_is_dedicated)
-                       localcmd("\nmenu_cmd sync\n");
-               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
-       }
-       if(Map_Count == 0)
-               error("empty maplist, cannot select a new map");
-       Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1);
-
-       strcpy(Map_Current_Name, argv(Map_Current)); // will be automatically freed on exit thanks to DP
-       // this may or may not be correct, but who cares, in the worst case a map
-       // isn't chosen in the first pass that should have been
-}
-
-string GetNextMap()
-{
-       Maplist_Init();
-       float nextMap = -1;
-
-       if(nextMap == -1)
-               if(autocvar_g_maplist_shuffle > 0)
-                       nextMap = MaplistMethod_Shuffle(autocvar_g_maplist_shuffle + 1);
-
-       if(nextMap == -1)
-               if(autocvar_g_maplist_selectrandom)
-                       nextMap = MaplistMethod_Random();
-
-       if(nextMap == -1)
-               nextMap = MaplistMethod_Iterate();
-
-       if(nextMap == -1)
-               nextMap = MaplistMethod_Repeat();
-
-       if(nextMap >= 0)
-       {
-               Map_Goto_SetFloat(nextMap);
-               return getmapname_stored;
-       }
-
-       return "";
-}
-
-float DoNextMapOverride(float reinit)
-{
-       if(autocvar_g_campaign)
-       {
-               CampaignPostIntermission();
-               alreadychangedlevel = true;
-               return true;
-       }
-       if(autocvar_quit_when_empty)
-       {
-               if(player_count <= currentbots)
-               {
-                       localcmd("quit\n");
-                       alreadychangedlevel = true;
-                       return true;
-               }
-       }
-       if(autocvar_quit_and_redirect != "")
-       {
-               redirection_target = strzone(autocvar_quit_and_redirect);
-               alreadychangedlevel = true;
-               return true;
-       }
-       if (!reinit && autocvar_samelevel) // if samelevel is set, stay on same level
-       {
-               localcmd("restart\n");
-               alreadychangedlevel = true;
-               return true;
-       }
-       if(autocvar_nextmap != "")
-       {
-               string m;
-               m = GameTypeVote_MapInfo_FixName(autocvar_nextmap);
-               cvar_set("nextmap",m);
-
-               if(!m || gametypevote)
-                       return false;
-               if(autocvar_sv_vote_gametype)
-               {
-                       Map_Goto_SetStr(m);
-                       return false;
-               }
-
-               if(MapInfo_CheckMap(m))
-               {
-                       Map_Goto_SetStr(m);
-                       Map_Goto(reinit);
-                       alreadychangedlevel = true;
-                       return true;
-               }
-       }
-       if(!reinit && autocvar_lastlevel)
-       {
-               cvar_settemp_restore();
-               localcmd("set lastlevel 0\ntogglemenu 1\n");
-               alreadychangedlevel = true;
-               return true;
-       }
-       return false;
-}
-
-void GotoNextMap(float reinit)
-{
-       //string nextmap;
-       //float n, nummaps;
-       //string s;
-       if (alreadychangedlevel)
-               return;
-       alreadychangedlevel = true;
-
-       string nextMap = GetNextMap();
-       if(nextMap == "")
-               error("Everything is broken - cannot find a next map. Please report this to the developers.");
-       Map_Goto(reinit);
-}
-
-
-/*
-============
-IntermissionThink
-
-When the player presses attack or jump, change to the next level
-============
-*/
-.float autoscreenshot;
-void IntermissionThink(entity this)
-{
-       FixIntermissionClient(this);
-
-       float server_screenshot = (autocvar_sv_autoscreenshot && CS(this).cvar_cl_autoscreenshot);
-       float client_screenshot = (CS(this).cvar_cl_autoscreenshot == 2);
-
-       if( (server_screenshot || client_screenshot)
-               && ((this.autoscreenshot > 0) && (time > this.autoscreenshot)) )
-       {
-               this.autoscreenshot = -1;
-               if(IS_REAL_CLIENT(this)) { stuffcmd(this, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(false, "%s"))); }
-               return;
-       }
-
-       if (time < intermission_exittime)
-               return;
-
-       if(!mapvote_initialized)
-               if (time < intermission_exittime + 10 && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this)))
-                       return;
-
-       MapVote_Start();
-}
-
 /*
 ===============================================================================
 
@@ -1536,40 +1126,6 @@ void DumpStats(float final)
        }
 }
 
-void FixIntermissionClient(entity e)
-{
-       if(!e.autoscreenshot) // initial call
-       {
-               e.autoscreenshot = time + 0.8;  // used for autoscreenshot
-               SetResourceExplicit(e, RES_HEALTH, -2342);
-               // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
-               for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
-               {
-                   .entity weaponentity = weaponentities[slot];
-                       if(e.(weaponentity))
-                       {
-                               e.(weaponentity).effects = EF_NODRAW;
-                               if (e.(weaponentity).weaponchild)
-                                       e.(weaponentity).weaponchild.effects = EF_NODRAW;
-                       }
-               }
-               if(IS_REAL_CLIENT(e))
-               {
-                       stuffcmd(e, "\nscr_printspeed 1000000\n");
-                       RandomSelection_Init();
-                       FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, {
-                               RandomSelection_AddString(it, 1, 1);
-                       });
-                       if (RandomSelection_chosen_string != "")
-                       {
-                               stuffcmd(e, sprintf("\ncd loop %s\n", RandomSelection_chosen_string));
-                       }
-                       msg_entity = e;
-                       WriteByte(MSG_ONE, SVC_INTERMISSION);
-               }
-       }
-}
-
 /*
 go to the next level for deathmatch
 only called if a time or frag limit has expired
@@ -1710,11 +1266,6 @@ void ClearWinners()
        FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; });
 }
 
-void ShuffleMaplist()
-{
-       cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
-}
-
 int fragsleft_last;
 float WinningCondition_Scores(float limit, float leadlimit)
 {
@@ -2014,27 +1565,6 @@ void CheckRules_World()
        }
 }
 
-string GotoMap(string m)
-{
-       m = GameTypeVote_MapInfo_FixName(m);
-       if (!m)
-               return "The map you suggested is not available on this server.";
-       if (!autocvar_sv_vote_gametype)
-       if(!MapInfo_CheckMap(m))
-               return "The map you suggested does not support the current game mode.";
-       cvar_set("nextmap", m);
-       cvar_set("timelimit", "-1");
-       if(mapvote_initialized || alreadychangedlevel)
-       {
-               if(DoNextMapOverride(0))
-                       return "Map switch initiated.";
-               else
-                       return "Hm... no. For some reason I like THIS map more.";
-       }
-       else
-               return "Map switch will happen after scoreboard.";
-}
-
 bool autocvar_sv_gameplayfix_multiplethinksperframe = true;
 void RunThink(entity this)
 {
@@ -2096,6 +1626,7 @@ void Physics_Frame()
 
        // make a second pass to see if any ents spawned this frame and make
        // sure they run their move/think. this is verified by checking .move_time, which will never be 0 if the entity has moved
+       // MOVETYPE_NONE is also checked as .move_time WILL be 0 with that movetype
        IL_EACH(g_moveables, it.move_qcphysics,
        {
                if(IS_CLIENT(it) || it.move_time || it.move_movetype == MOVETYPE_NONE || it.move_movetype == MOVETYPE_PHYSICS)
index 3bbaad68246e942d4288f379d326686a6cb970ae..3d8ca997300665db47da85ebb49661b320b93cd1 100644 (file)
@@ -22,9 +22,7 @@ string matchid;
 
 .string fog;
 
-float intermission_running;
-float intermission_exittime;
-float alreadychangedlevel;
+string redirection_target;
 
 string cache_mutatormsg;
 string cache_lastmutatormsg;
@@ -44,20 +42,9 @@ const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath
 
 float WinningCondition_Scores(float limit, float leadlimit);
 void SetWinners(.float field, float value);
-void IntermissionThink(entity this);
-void GotoNextMap(float reinit);
 void ReadyRestart();
 
-string GetGametype();
-
 void DumpStats(float final);
-float Map_IsRecent(string m);
-string GetNextMap();
-void ShuffleMaplist();
-void Map_Goto_SetStr(string nextmapname);
-void Map_Goto(float reinit);
-void Map_MarkAsRecent(string m);
-float DoNextMapOverride(float reinit);
 void CheckRules_World();
 float RedirectionThink();