]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into TimePath/csqc_sounds
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 16 Nov 2015 10:34:04 +0000 (21:34 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 16 Nov 2015 10:34:04 +0000 (21:34 +1100)
# Conflicts:
# qcsrc/client/main.qc
# qcsrc/server/cl_player.qh

107 files changed:
gamemodes.cfg
gfx/hud/default/minigames/bd/board.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/boulder.tga [new file with mode: 0644]
gfx/hud/default/minigames/bd/brick1.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/brick2.tga [new file with mode: 0644]
gfx/hud/default/minigames/bd/brick3.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/brick4.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/brick5.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/brick6.tga [new file with mode: 0644]
gfx/hud/default/minigames/bd/delete.tga [new file with mode: 0644]
gfx/hud/default/minigames/bd/dozer.tga [new file with mode: 0644]
gfx/hud/default/minigames/bd/icon.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/icon_notif.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/icon_notif_alpha.jpg [new file with mode: 0644]
gfx/hud/default/minigames/bd/target.tga [new file with mode: 0644]
gfx/hud/default/notify_teamkill_pink.tga [new file with mode: 0644]
gfx/hud/default/notify_teamkill_yellow.tga [new file with mode: 0644]
minigames/bulldozer/storage_level1.txt [new file with mode: 0644]
minigames/bulldozer/storage_level2.txt [new file with mode: 0644]
minigames/bulldozer/storage_level3.txt [new file with mode: 0644]
minigames/bulldozer/storage_level4.txt [new file with mode: 0644]
minigames/bulldozer/storage_level5.txt [new file with mode: 0644]
qcsrc/client/announcer.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/main.qc
qcsrc/common/command/all.qh
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/items/all.qh
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/cl_minigames.qh
qcsrc/common/minigames/minigame/all.qh
qcsrc/common/minigames/minigame/bd.qc [new file with mode: 0644]
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/minigames/sv_minigames.qh
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/buffs/all.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/net_notice.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_rotating.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/subs.qh
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/speaker.qc
qcsrc/common/triggers/trigger/counter.qc
qcsrc/common/triggers/trigger/delay.qc
qcsrc/common/triggers/trigger/flipflop.qc
qcsrc/common/triggers/trigger/gamestart.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/monoflop.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/multi.qh
qcsrc/common/triggers/trigger/relay.qc
qcsrc/common/triggers/trigger/relay_teamcheck.qc
qcsrc/common/turrets/util.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/dpdefs/progsdefs.qh
qcsrc/lib/defer.qh
qcsrc/lib/map.qc
qcsrc/lib/net.qh
qcsrc/lib/registry.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/stats.qh
qcsrc/lib/warpzone/server.qc
qcsrc/menu/item/slider.qc
qcsrc/menu/xonotic/dialog_multiplayer_create.qc
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_subs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/pathlib/debug.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/race.qc
qcsrc/server/t_items.qc
qcsrc/server/t_quake3.qc

index 2d8d54067f17038c15779770e1381e08828c59d1..60b791f0c1c427d0a632d44acdc6a4669a583830 100644 (file)
@@ -257,6 +257,7 @@ set g_ctf 0 "Capture The Flag: take the enemy flag and bring it to yours at your
 set g_ctf_oneflag 1 "Allow oneflag CTF mode on maps that support it"
 set g_ctf_oneflag_reverse 0 "apply reverse mode to oneflag CTF (take flag to enemy bases to cap), overrides g_ctf_reverse only in oneflag, g_ctf_reverse still affects oneflag"
 set g_ctf_flag_return 1 "auto return the flag to base when touched by a teammate"
+set g_ctf_flag_return_carrying 0 "(manual return mode) auto return the flag to base if touched by a flag carrier"
 set g_ctf_flag_return_carried_radius 100 "allow flags to be returned by carrier if base is within this radius"
 set g_ctf_flag_return_time 15
 set g_ctf_flag_return_dropped 100
diff --git a/gfx/hud/default/minigames/bd/board.jpg b/gfx/hud/default/minigames/bd/board.jpg
new file mode 100644 (file)
index 0000000..dfe8914
Binary files /dev/null and b/gfx/hud/default/minigames/bd/board.jpg differ
diff --git a/gfx/hud/default/minigames/bd/boulder.tga b/gfx/hud/default/minigames/bd/boulder.tga
new file mode 100644 (file)
index 0000000..872e6ce
Binary files /dev/null and b/gfx/hud/default/minigames/bd/boulder.tga differ
diff --git a/gfx/hud/default/minigames/bd/brick1.jpg b/gfx/hud/default/minigames/bd/brick1.jpg
new file mode 100644 (file)
index 0000000..cb1eba6
Binary files /dev/null and b/gfx/hud/default/minigames/bd/brick1.jpg differ
diff --git a/gfx/hud/default/minigames/bd/brick2.tga b/gfx/hud/default/minigames/bd/brick2.tga
new file mode 100644 (file)
index 0000000..f8a4385
Binary files /dev/null and b/gfx/hud/default/minigames/bd/brick2.tga differ
diff --git a/gfx/hud/default/minigames/bd/brick3.jpg b/gfx/hud/default/minigames/bd/brick3.jpg
new file mode 100644 (file)
index 0000000..3a6330c
Binary files /dev/null and b/gfx/hud/default/minigames/bd/brick3.jpg differ
diff --git a/gfx/hud/default/minigames/bd/brick4.jpg b/gfx/hud/default/minigames/bd/brick4.jpg
new file mode 100644 (file)
index 0000000..2b6c14f
Binary files /dev/null and b/gfx/hud/default/minigames/bd/brick4.jpg differ
diff --git a/gfx/hud/default/minigames/bd/brick5.jpg b/gfx/hud/default/minigames/bd/brick5.jpg
new file mode 100644 (file)
index 0000000..8867955
Binary files /dev/null and b/gfx/hud/default/minigames/bd/brick5.jpg differ
diff --git a/gfx/hud/default/minigames/bd/brick6.tga b/gfx/hud/default/minigames/bd/brick6.tga
new file mode 100644 (file)
index 0000000..39ba0d1
Binary files /dev/null and b/gfx/hud/default/minigames/bd/brick6.tga differ
diff --git a/gfx/hud/default/minigames/bd/delete.tga b/gfx/hud/default/minigames/bd/delete.tga
new file mode 100644 (file)
index 0000000..f69334c
Binary files /dev/null and b/gfx/hud/default/minigames/bd/delete.tga differ
diff --git a/gfx/hud/default/minigames/bd/dozer.tga b/gfx/hud/default/minigames/bd/dozer.tga
new file mode 100644 (file)
index 0000000..b3a985a
Binary files /dev/null and b/gfx/hud/default/minigames/bd/dozer.tga differ
diff --git a/gfx/hud/default/minigames/bd/icon.jpg b/gfx/hud/default/minigames/bd/icon.jpg
new file mode 100644 (file)
index 0000000..53ee21c
Binary files /dev/null and b/gfx/hud/default/minigames/bd/icon.jpg differ
diff --git a/gfx/hud/default/minigames/bd/icon_notif.jpg b/gfx/hud/default/minigames/bd/icon_notif.jpg
new file mode 100644 (file)
index 0000000..8c4fcbe
Binary files /dev/null and b/gfx/hud/default/minigames/bd/icon_notif.jpg differ
diff --git a/gfx/hud/default/minigames/bd/icon_notif_alpha.jpg b/gfx/hud/default/minigames/bd/icon_notif_alpha.jpg
new file mode 100644 (file)
index 0000000..040990f
Binary files /dev/null and b/gfx/hud/default/minigames/bd/icon_notif_alpha.jpg differ
diff --git a/gfx/hud/default/minigames/bd/target.tga b/gfx/hud/default/minigames/bd/target.tga
new file mode 100644 (file)
index 0000000..355332e
Binary files /dev/null and b/gfx/hud/default/minigames/bd/target.tga differ
diff --git a/gfx/hud/default/notify_teamkill_pink.tga b/gfx/hud/default/notify_teamkill_pink.tga
new file mode 100644 (file)
index 0000000..5406f6c
Binary files /dev/null and b/gfx/hud/default/notify_teamkill_pink.tga differ
diff --git a/gfx/hud/default/notify_teamkill_yellow.tga b/gfx/hud/default/notify_teamkill_yellow.tga
new file mode 100644 (file)
index 0000000..16052a6
Binary files /dev/null and b/gfx/hud/default/notify_teamkill_yellow.tga differ
diff --git a/minigames/bulldozer/storage_level1.txt b/minigames/bulldozer/storage_level1.txt
new file mode 100644 (file)
index 0000000..d82be65
--- /dev/null
@@ -0,0 +1,399 @@
+// bulldozer storage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"
+"n2" 4 "0 0 0"
+"o2" 4 "0 0 0"
+"q2" 4 "0 0 0"
+"f14" 4 "0 0 0"
+"b12" 4 "0 0 0"
+"b11" 4 "0 0 0"
+"b10" 4 "0 0 0"
+"b9" 4 "0 0 0"
+"b8" 4 "0 0 0"
+"b7" 4 "0 0 0"
+"b6" 4 "0 0 0"
+"b5" 4 "0 0 0"
+"b4" 4 "0 0 0"
+"b3" 4 "0 0 0"
+"d2" 4 "0 0 0"
diff --git a/minigames/bulldozer/storage_level2.txt b/minigames/bulldozer/storage_level2.txt
new file mode 100644 (file)
index 0000000..1be5fb6
--- /dev/null
@@ -0,0 +1,247 @@
+// bulldozer storage "level2" last updated 16-11-2015 03:34:13
+nextlevel = "level3"
+"a20" 4 "0 0 0"
+"b20" 4 "0 0 0"
+"c20" 4 "0 0 0"
+"d20" 4 "0 0 0"
+"e20" 4 "0 0 0"
+"r13" 5 "0 0 0"
+"f20" 4 "0 0 0"
+"g20" 4 "0 0 0"
+"c12" 5 "0 0 0"
+"h20" 4 "0 0 0"
+"c13" 5 "0 0 0"
+"i20" 4 "0 0 0"
+"c14" 5 "0 0 0"
+"j20" 4 "0 0 0"
+"c15" 5 "0 0 0"
+"k20" 4 "0 0 0"
+"c16" 5 "0 0 0"
+"l20" 4 "0 0 0"
+"c17" 5 "0 0 0"
+"m20" 4 "0 0 0"
+"c18" 5 "0 0 0"
+"n20" 4 "0 0 0"
+"c19" 5 "0 0 0"
+"o20" 4 "0 0 0"
+"r18" 5 "0 0 0"
+"p20" 4 "0 0 0"
+"r17" 5 "0 0 0"
+"q20" 4 "0 0 0"
+"r12" 5 "0 0 0"
+"r20" 4 "0 0 0"
+"r15" 5 "0 0 0"
+"r14" 5 "0 0 0"
+"s20" 4 "0 0 0"
+"t20" 4 "0 0 0"
+"t19" 4 "0 0 0"
+"t18" 4 "0 0 0"
+"t17" 4 "0 0 0"
+"t16" 4 "0 0 0"
+"t15" 4 "0 0 0"
+"t14" 4 "0 0 0"
+"t13" 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 5 "0 0 0"
+"q5" 5 "0 0 0"
+"q3" 5 "0 0 0"
+"r5" 5 "0 0 0"
+"r4" 5 "0 0 0"
+"s3" 5 "0 0 0"
+"s5" 5 "0 0 0"
+"s6" 5 "0 0 0"
+"s7" 5 "0 0 0"
+"r7" 5 "0 0 0"
+"b6" 4 "0 0 0"
+"b5" 4 "0 0 0"
+"b4" 4 "0 0 0"
diff --git a/minigames/bulldozer/storage_level3.txt b/minigames/bulldozer/storage_level3.txt
new file mode 100644 (file)
index 0000000..7433ae2
--- /dev/null
@@ -0,0 +1,279 @@
+// bulldozer storage "level3" last updated 16-11-2015 04:06:54
+nextlevel = "level4"
+"a20" 4 "0 0 0"
+"a19" 4 "0 0 0"
+"f14" 2 "0 0 0"
+"a18" 4 "0 0 0"
+"a17" 4 "0 0 0"
+"a16" 4 "0 0 0"
+"a15" 4 "0 0 0"
+"f14" 3 "0 0 0"
+"b7" 4 "0 0 0"
+"b5" 4 "0 0 0"
+"b3" 4 "0 0 0"
+"s7" 4 "0 0 0"
+"s5" 4 "0 0 0"
+"s3" 4 "0 0 0"
+"b19" 4 "0 0 0"
+"s19" 4 "0 0 0"
+"a14" 4 "0 0 0"
+"a13" 4 "0 0 0"
+"a12" 4 "0 0 0"
+"a11" 4 "0 0 0"
+"a10" 4 "0 0 0"
+"a9" 4 "0 0 0"
+"a8" 4 "0 0 0"
+"a7" 4 "0 0 0"
+"a6" 4 "0 0 0"
+"a5" 4 "0 0 0"
+"a4" 4 "0 0 0"
+"a3" 4 "0 0 0"
+"a2" 4 "0 0 0"
+"a1" 4 "0 0 0"
+"b1" 4 "0 0 0"
+"c1" 4 "0 0 0"
+"d1" 4 "0 0 0"
+"e1" 4 "0 0 0"
+"f1" 4 "0 0 0"
+"g1" 4 "0 0 0"
+"h1" 4 "0 0 0"
+"i1" 4 "0 0 0"
+"j1" 4 "0 0 0"
+"k1" 4 "0 0 0"
+"l1" 4 "0 0 0"
+"m1" 4 "0 0 0"
+"n1" 4 "0 0 0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"
+"i19" 4 "0 0 0"
+"h19" 4 "0 0 0"
+"g19" 4 "0 0 0"
+"f19" 4 "0 0 0"
+"e19" 4 "0 0 0"
+"d19" 4 "0 0 0"
+"r19" 4 "0 0 0"
+"f15" 5 "0 0 0"
+"f13" 5 "0 0 0"
+"f12" 5 "0 0 0"
+"g12" 5 "0 0 0"
+"g9" 5 "0 0 0"
+"g10" 5 "0 0 0"
+"g11" 5 "0 0 0"
+"h9" 5 "0 0 0"
+"i9" 5 "0 0 0"
+"k9" 5 "0 0 0"
+"l9" 5 "0 0 0"
+"l13" 5 "0 0 0"
+"l12" 5 "0 0 0"
+"l10" 5 "0 0 0"
+"l11" 5 "0 0 0"
+"l15" 5 "0 0 0"
+"l14" 5 "0 0 0"
+"l16" 5 "0 0 0"
+"g15" 5 "0 0 0"
+"h15" 5 "0 0 0"
+"i15" 5 "0 0 0"
+"j15" 5 "0 0 0"
+"k15" 5 "0 0 0"
+"p9" 5 "0 0 0"
+"p10" 5 "0 0 0"
+"q10" 5 "0 0 0"
+"q8" 2 "0 0 0"
+"r8" 2 "0 0 0"
+"r9" 2 "0 0 0"
+"j9" 3 "0 0 0"
+"i13" 2 "0 0 0"
+"k13" 1 "0 -1 0"
+"n13" 3 "0 0 0"
+"n14" 3 "0 0 0"
+"n12" 3 "0 0 0"
diff --git a/minigames/bulldozer/storage_level4.txt b/minigames/bulldozer/storage_level4.txt
new file mode 100644 (file)
index 0000000..596ae6e
--- /dev/null
@@ -0,0 +1,370 @@
+// bulldozer storage "level4" last updated 16-11-2015 05:09:50
+nextlevel = "level5"
+"k10" 9 "0 -1 0"
+"k11" 9 "0 -1 0"
+"k13" 9 "0 -1 0"
+"j14" 9 "0 -1 0"
+"k14" 9 "0 -1 0"
+"k8" 5 "0 -1 0"
+"k9" 5 "0 -1 0"
+"k7" 5 "0 -1 0"
+"m8" 4 "0 -1 0"
+"l14" 9 "0 -1 0"
+"i14" 9 "0 -1 0"
+"m12" 1 "0 -1 0"
+"l11" 2 "0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 0"
+"a12" 4 "0 -1 0"
+"b12" 4 "0 -1 0"
+"c10" 8 "0 -1 0"
+"d12" 4 "0 -1 0"
+"d13" 4 "0 -1 0"
+"c13" 4 "0 -1 0"
+"b13" 4 "0 -1 0"
+"s16" 8 "0 -1 0"
+"a14" 4 "0 -1 0"
+"b14" 4 "0 -1 0"
+"c12" 8 "0 -1 0"
+"d14" 4 "0 -1 0"
+"e14" 4 "0 -1 0"
+"e15" 4 "0 -1 0"
+"d15" 4 "0 -1 0"
+"c15" 4 "0 -1 0"
+"b15" 4 "0 -1 0"
+"s10" 8 "0 -1 0"
+"a16" 4 "0 -1 0"
+"b16" 4 "0 -1 0"
+"c16" 8 "0 -1 0"
+"d16" 4 "0 -1 0"
+"e16" 4 "0 -1 0"
+"e17" 4 "0 -1 0"
+"d17" 4 "0 -1 0"
+"c17" 4 "0 -1 0"
+"b17" 4 "0 -1 0"
+"a17" 4 "0 -1 0"
+"a18" 4 "0 -1 0"
+"b18" 4 "0 -1 0"
+"c18" 4 "0 -1 0"
+"d18" 4 "0 -1 0"
+"e18" 4 "0 -1 0"
+"e19" 4 "0 -1 0"
+"d19" 4 "0 -1 0"
+"c19" 4 "0 -1 0"
+"b19" 4 "0 -1 0"
+"a19" 4 "0 -1 0"
+"a20" 4 "0 -1 0"
+"b20" 4 "0 -1 0"
+"c20" 4 "0 -1 0"
+"d20" 4 "0 -1 0"
+"e20" 4 "0 -1 0"
+"f11" 5 "0 -1 0"
+"c14" 8 "0 -1 0"
+"c8" 8 "0 -1 0"
+"f13" 5 "0 -1 0"
+"g15" 5 "0 -1 0"
+"g16" 5 "0 -1 0"
+"i16" 5 "0 -1 0"
+"j16" 5 "0 -1 0"
+"n15" 5 "0 -1 0"
+"n14" 5 "0 -1 0"
+"h7" 5 "0 -1 0"
diff --git a/minigames/bulldozer/storage_level5.txt b/minigames/bulldozer/storage_level5.txt
new file mode 100644 (file)
index 0000000..42e3186
--- /dev/null
@@ -0,0 +1,307 @@
+// bulldozer storage "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
+"t16" 4 "0 0 0"
+"t15" 4 "0 0 0"
+"s15" 4 "0 0 0"
+"t17" 4 "0 0 0"
+"s17" 4 "0 0 0"
+"b17" 4 "0 0 0"
+"a17" 4 "0 0 0"
+"a18" 4 "0 0 0"
+"b18" 4 "0 0 0"
+"s18" 4 "0 0 0"
+"t18" 4 "0 0 0"
+"t19" 4 "0 0 0"
+"s19" 4 "0 0 0"
+"r19" 4 "0 0 0"
+"q19" 4 "0 0 0"
+"p19" 4 "0 0 0"
+"o19" 4 "0 0 0"
+"n19" 4 "0 0 0"
+"m19" 4 "0 0 0"
+"l19" 4 "0 0 0"
+"k19" 4 "0 0 0"
+"j19" 4 "0 0 0"
+"i19" 4 "0 0 0"
+"h19" 4 "0 0 0"
+"g19" 4 "0 0 0"
+"f19" 4 "0 0 0"
+"e19" 4 "0 0 0"
+"d19" 4 "0 0 0"
+"c19" 4 "0 0 0"
+"b19" 4 "0 0 0"
+"a19" 4 "0 0 0"
+"a20" 4 "0 0 0"
+"b20" 4 "0 0 0"
+"c20" 4 "0 0 0"
+"d20" 4 "0 0 0"
+"e20" 4 "0 0 0"
+"f20" 4 "0 0 0"
+"g20" 4 "0 0 0"
+"h20" 4 "0 0 0"
+"i20" 4 "0 0 0"
+"j20" 4 "0 0 0"
+"k20" 4 "0 0 0"
+"l20" 4 "0 0 0"
+"m20" 4 "0 0 0"
+"n20" 4 "0 0 0"
+"o20" 4 "0 0 0"
+"p20" 4 "0 0 0"
+"q20" 4 "0 0 0"
+"r20" 4 "0 0 0"
+"s20" 4 "0 0 0"
+"t20" 4 "0 0 0"
index fa8f2b0055b51395ed0248ae4129cc1e741d55fa..6fcdbb9d69354114ce2a0f36582b885218600481 100644 (file)
@@ -15,6 +15,8 @@ string AnnouncerOption()
        return ret;
 }
 
+entity announcer_countdown;
+
 void Announcer_Countdown()
 {
        SELFPARAM();
@@ -24,6 +26,7 @@ void Announcer_Countdown()
        {
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP);
                remove(this);
+               announcer_countdown = NULL;
                return;
        }
        if(roundstarttime >= starttime)
@@ -39,6 +42,7 @@ void Announcer_Countdown()
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
                Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
                remove(this);
+               announcer_countdown = NULL;
                return;
        }
        else // countdown is still going
@@ -78,7 +82,6 @@ void Announcer_Gamestart()
        {
                if(time < startTime)
                {
-                       static entity announcer_countdown;
                        if (!announcer_countdown)
                        {
                                announcer_countdown = new(announcer_countdown);
index 7eb672ba5f54d7f0045525d40442398fc6cc419e..51b373fb796c490283333dca934cfd22d661147e 100644 (file)
@@ -168,6 +168,7 @@ void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
 
                // only if this failed, find it out on our own
                entity e = spawn();
+               precache_model(autocvar__cl_playermodel);
                _setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
                forceplayermodels_modelisgoodmodel = fexists(e.model);
                forceplayermodels_model = e.model;
index 4b4f5a68b9f77e35ee5be552708cf7ecec9271a3..f4852ab7f73c9833f181862bd3e4a1e4f2fce63e 100644 (file)
@@ -711,7 +711,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new)
 
 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
-void CSQC_Ent_Update(float bIsNewEntity)
+void CSQC_Ent_Update(bool isnew)
 {
        SELFPARAM();
        this.sourceLocLine = __LINE__;
@@ -732,39 +732,38 @@ void CSQC_Ent_Update(float bIsNewEntity)
        }
 
 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
-       if(this.enttype)
+       if (this.enttype)
        {
-               if(t != this.enttype || bIsNewEntity)
+               if (t != this.enttype || isnew)
                {
                        LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(this), this.entnum, this.enttype, t);
                        Ent_Remove();
                        clearentity(this);
-                       bIsNewEntity = 1;
+                       isnew = true;
                }
        }
        else
        {
-               if(!bIsNewEntity)
+               if (!isnew)
                {
                        LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(this), this.entnum, t);
-                       bIsNewEntity = 1;
+                       isnew = true;
                }
        }
 #endif
        this.enttype = t;
        bool done = false;
        FOREACH(LinkedEntities, it.m_id == t, LAMBDA(
-               if (bIsNewEntity) this.classname = it.netname;
+               if (isnew) this.classname = it.netname;
                if (autocvar_developer_csqcentities)
-            LOG_INFOF("CSQC_Ent_Update(%d) with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", bIsNewEntity, this, this.entnum, this.enttype, it.netname, t);
-               done = it.m_read(this, bIsNewEntity);
+            LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
+               done = it.m_read(this, isnew);
                break;
        ));
        time = savetime;
        if (!done)
        {
-               //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), this.enttype));
-               error(sprintf("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n", this.enttype, num_for_edict(this), this.classname));
+               LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
        }
 }
 
index d1eb3cf76e284bf3b1ddc547366bef69218ac1ef..9e16238d17af8dea6150ee44c210229052ae5227 100644 (file)
@@ -5,7 +5,7 @@
 REGISTRY(GENERIC_COMMANDS, BITS(7))
 #define GENERIC_COMMANDS_from(i) _GENERIC_COMMANDS_from(i, NULL)
 REGISTER_REGISTRY(GENERIC_COMMANDS)
-REGISTRY_SORT(GENERIC_COMMANDS, 0)
+REGISTRY_SORT(GENERIC_COMMANDS)
 
 #define GENERIC_COMMAND(id, description) \
        CLASS(genericcommand_##id, Command) \
index b4becb3979d7b20981ddc01c28ed5b0defa6be66..1850b460c7675a5a9a2499f6652e5f7b43aa9dbe 100644 (file)
@@ -78,10 +78,10 @@ void LogNB(string mode, entity actor)
        GameLogEcho(s);
 }
 
-void ball_restart()
-{SELFPARAM();
-       if(self.owner)
-               DropBall(self, self.owner.origin, '0 0 0');
+void ball_restart(entity this)
+{
+       if(this.owner)
+               DropBall(this, this.owner.origin, '0 0 0');
        ResetBall();
 }
 
@@ -816,7 +816,7 @@ void W_Nexball_Attack2()
        W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
        missile.angles = vectoangles(missile.velocity);
        missile.touch = W_Nexball_Touch;
-       missile.think = SUB_Remove;
+       missile.think = SUB_Remove_self;
        missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
 
        missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
index 04b5a3f7bf0c7ca7ca8537869afb8804b29239eb..ae62e5db797d2a22cb9467fc41ff7e431d2f50e3 100644 (file)
@@ -195,10 +195,10 @@ void ons_CaptureShield_Touch()
        }
 }
 
-void ons_CaptureShield_Reset()
-{SELFPARAM();
-       self.colormap = self.enemy.colormap;
-       self.team = self.enemy.team;
+void ons_CaptureShield_Reset(entity this)
+{
+       this.colormap = this.enemy.colormap;
+       this.team = this.enemy.team;
 }
 
 void ons_CaptureShield_Spawn(entity generator, bool is_generator)
@@ -845,31 +845,31 @@ void ons_ControlPoint_Think()
        CSQCMODEL_AUTOUPDATE(self);
 }
 
-void ons_ControlPoint_Reset()
-{SELFPARAM();
-       if(self.goalentity)
-               remove(self.goalentity);
-
-       self.goalentity = world;
-       self.team = 0;
-       self.colormap = 1024;
-       self.iscaptured = false;
-       self.islinked = false;
-       self.isshielded = true;
-       self.think = ons_ControlPoint_Think;
-       self.ons_toucher = world;
-       self.nextthink = time + ONS_CP_THINKRATE;
-       setmodel_fixsize(self, MDL_ONS_CP_PAD1);
-
-       WaypointSprite_UpdateMaxHealth(self.sprite, 0);
-       WaypointSprite_UpdateRule(self.sprite,self.team,SPRITERULE_TEAMPLAY);
+void ons_ControlPoint_Reset(entity this)
+{
+       if(this.goalentity)
+               remove(this.goalentity);
+
+       this.goalentity = world;
+       this.team = 0;
+       this.colormap = 1024;
+       this.iscaptured = false;
+       this.islinked = false;
+       this.isshielded = true;
+       this.think = ons_ControlPoint_Think;
+       this.ons_toucher = world;
+       this.nextthink = time + ONS_CP_THINKRATE;
+       setmodel_fixsize(this, MDL_ONS_CP_PAD1);
+
+       WaypointSprite_UpdateMaxHealth(this.sprite, 0);
+       WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
 
        onslaught_updatelinks();
 
-       activator = self;
+       activator = this;
        SUB_UseTargets(); // to reset the structures, playerspawns etc.
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 void ons_DelayedControlPoint_Setup()
@@ -1076,27 +1076,27 @@ void ons_GeneratorThink()
        }
 }
 
-void ons_GeneratorReset()
-{SELFPARAM();
-       self.team = self.team_saved;
-       self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
-       self.takedamage = DAMAGE_AIM;
-       self.bot_attack = true;
-       self.iscaptured = true;
-       self.islinked = true;
-       self.isshielded = true;
-       self.event_damage = ons_GeneratorDamage;
-       self.think = ons_GeneratorThink;
-       self.nextthink = time + GEN_THINKRATE;
-
-       Net_LinkEntity(self, false, 0, generator_send);
-
-       self.SendFlags = GSF_SETUP; // just incase
-       self.SendFlags |= GSF_STATUS;
-
-       WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
-       WaypointSprite_UpdateHealth(self.sprite, self.health);
-       WaypointSprite_UpdateRule(self.sprite,self.team,SPRITERULE_TEAMPLAY);
+void ons_GeneratorReset(entity this)
+{
+       this.team = this.team_saved;
+       this.lasthealth = this.max_health = this.health = autocvar_g_onslaught_gen_health;
+       this.takedamage = DAMAGE_AIM;
+       this.bot_attack = true;
+       this.iscaptured = true;
+       this.islinked = true;
+       this.isshielded = true;
+       this.event_damage = ons_GeneratorDamage;
+       this.think = ons_GeneratorThink;
+       this.nextthink = time + GEN_THINKRATE;
+
+       Net_LinkEntity(this, false, 0, generator_send);
+
+       this.SendFlags = GSF_SETUP; // just incase
+       this.SendFlags |= GSF_STATUS;
+
+       WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health);
+       WaypointSprite_UpdateHealth(this.sprite, this.health);
+       WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
 
        onslaught_updatelinks();
 }
index ab86ea6736eaca2b592cb6e212bdc1aa6b42392b..1bd22f660e52264f488a53390d015045dff5d7cd 100644 (file)
@@ -11,7 +11,7 @@ REGISTER_REGISTRY(Items)
 /** If you register a new item, make sure to add it to all.inc */
 #define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
 
-REGISTRY_SORT(Items, 0)
+REGISTRY_SORT(Items)
 REGISTRY_CHECK(Items)
 STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); }
 
index 769b70c3316c80c0bf11b5cb023444afb88c2842..3ea50caad3d0554bb5f1b7b4e389b29bf6052d6b 100644 (file)
@@ -153,8 +153,6 @@ void minigame_player_entremove()
                deactivate_minigame();
 }
 
-vector ReadVector2D() { vector v; v_x = ReadCoord(); v_y = ReadCoord(); v_z = 0; return v; }
-vector ReadVector() { vector v; v_x = ReadCoord(); v_y = ReadCoord(); v_z = ReadCoord(); return v; }
 string() ReadString_Raw = #366;
 string ReadString_Zoned() { return strzone(ReadString_Raw()); }
 #define ReadString ReadString_Zoned
index f21c6e482d10c5b3310557ee6eba9178d6c28c0e..3f10e89e93d09c9627e065af7e6533dde76862f7 100644 (file)
@@ -111,16 +111,16 @@ void HUD_MinigameMenu_CustomEntry(entity parent, string message, string event_ar
        while( (entityvar = findentity(entityvar,owner,active_minigame)) )
 
 
-REGISTRY(Minigames, BITS(3))
+REGISTRY(Minigames, BITS(4))
 #define Minigames_from(i) _Minigames_from(i, NULL)
 REGISTER_REGISTRY(Minigames)
 REGISTRY_CHECK(Minigames)
 #define REGISTER_MINIGAME(name,nicename) \
-    REGISTER(Minigames, MINIGAMEname, m_id, new(minigame_descriptor)); \
+    REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \
     void name##_hud_board(vector, vector); \
     void name##_hud_status(vector, vector); \
     int name##_client_event(entity, string, ...); \
-    REGISTER_INIT_POST(MINIGAMEname) { \
+    REGISTER_INIT_POST(MINIGAME_##name) { \
         make_pure(this); \
         this.netname = strzone(strtolower(#name)); \
         this.message = nicename; \
@@ -128,6 +128,6 @@ REGISTRY_CHECK(Minigames)
                this.minigame_hud_status = name##_hud_status; \
                this.minigame_event = name##_client_event; \
     } \
-    REGISTER_INIT(MINIGAMEname)
+    REGISTER_INIT(MINIGAME_##name)
 
 #endif
index d3874e7aa77cb42b79bc8c42230982cb0a4781f6..f552db98b5f4208ecd104537d785bcdfa4cbfa86 100644 (file)
@@ -68,6 +68,7 @@ that .owner is set to the minigame session entity and .minigame_autoclean is tru
 #include "ps.qc"
 #include "pp.qc"
 #include "snake.qc"
+#include "bd.qc"
 
 /**
  * Set up automatic entity read/write functionality
diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc
new file mode 100644 (file)
index 0000000..6c096a7
--- /dev/null
@@ -0,0 +1,1152 @@
+REGISTER_MINIGAME(bd, "Bulldozer");
+
+const int BD_TURN_MOVE  = 0x0100; // player must move the bulldozer
+const int BD_TURN_WIN   = 0x0200; // victory
+const int BD_TURN_LOSS  = 0x0400; // they did it?!
+const int BD_TURN_EDIT  = 0x0800; // editing mode
+const int BD_TURN_TYPE  = 0x0f00; // turn type mask
+
+const int BD_SF_PLAYERMOVES = MINIG_SF_CUSTOM;
+
+// 240 tiles...
+const int BD_LET_CNT = 20;
+const int BD_NUM_CNT = 20;
+
+const int BD_TILE_SIZE = 20;
+
+const int BD_TEAMS = 1;
+
+.vector bd_dir;
+
+.int bd_moves;
+
+.string bd_levelname;
+.string bd_nextlevel;
+
+#ifdef SVQC
+.bool bd_canedit;
+#endif
+
+.int bd_tiletype;
+const int BD_TILE_DOZER = 1;
+const int BD_TILE_TARGET = 2;
+const int BD_TILE_BOULDER = 3;
+const int BD_TILE_BRICK1 = 4;
+const int BD_TILE_BRICK2 = 5;
+const int BD_TILE_BRICK3 = 6;
+const int BD_TILE_BRICK4 = 7;
+const int BD_TILE_BRICK5 = 8;
+const int BD_TILE_BRICK6 = 9;
+const int BD_TILE_LAST = 9;
+
+string autocvar_sv_minigames_bulldozer_startlevel = "level1";
+
+// find same game piece given its tile name
+entity bd_find_piece(entity minig, string tile, bool check_target)
+{
+       entity e = world;
+       while ( ( e = findentity(e,owner,minig) ) )
+               if ( e.classname == "minigame_board_piece" && e.netname == tile && ((check_target) ? e.bd_tiletype == BD_TILE_TARGET : e.bd_tiletype != BD_TILE_TARGET) )
+                       return e;
+       return world;
+}
+
+// check if the tile name is valid (15x15 grid)
+bool bd_valid_tile(string tile)
+{
+       if ( !tile )
+               return false;
+       int number = minigame_tile_number(tile);
+       int letter = minigame_tile_letter(tile);
+       return 0 <= number && number < BD_NUM_CNT && 0 <= letter && letter < BD_LET_CNT;
+}
+
+entity bd_find_dozer(entity minig)
+{
+       entity e = world;
+       while ( ( e = findentity(e,owner,minig) ) )
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER )
+                       return e;
+       return world;
+}
+
+void bd_check_winner(entity minig)
+{
+       int total = 0, valid = 0;
+       entity e = world;
+       while ( ( e = findentity(e,owner,minig) ) )
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET )
+               {
+                       ++total;
+                       if(bd_find_piece(minig, e.netname, false).bd_tiletype == BD_TILE_BOULDER)
+                               ++valid;
+               }
+
+       if(valid >= total)
+       {
+               minig.minigame_flags = BD_TURN_WIN;
+               minigame_server_sendflags(minig,MINIG_SF_UPDATE);
+       }
+}
+
+bool bd_canfill(int ttype)
+{
+       switch(ttype)
+       {
+               case BD_TILE_BRICK6:
+               case BD_TILE_BRICK5:
+               case BD_TILE_BRICK4:
+               case BD_TILE_BRICK3:
+               case BD_TILE_BRICK2:
+               case BD_TILE_BRICK1: return true;
+       }
+
+       return false;
+}
+
+bool bd_move_dozer(entity minigame, entity dozer)
+{
+       if(!dozer.bd_dir_x && !dozer.bd_dir_y)
+               return false; // nope!
+
+       int myx = minigame_tile_letter(dozer.netname);
+       int myy = minigame_tile_number(dozer.netname);
+
+       myx += dozer.bd_dir_x;
+       myy += dozer.bd_dir_y;
+
+       string newpos = minigame_tile_buildname(myx, myy);
+       entity hit = bd_find_piece(minigame, newpos, false);
+
+       if(!bd_valid_tile(newpos))
+               return false;
+
+       if(hit)
+       switch(hit.bd_tiletype)
+       {
+               case BD_TILE_DOZER: // wtf, but let's do this incase
+               case BD_TILE_BRICK6:
+               case BD_TILE_BRICK5:
+               case BD_TILE_BRICK4:
+               case BD_TILE_BRICK3:
+               case BD_TILE_BRICK2:
+               case BD_TILE_BRICK1: return false;
+               case BD_TILE_BOULDER:
+               {
+                       string testpos;
+                       int tx = minigame_tile_letter(hit.netname);
+                       int ty = minigame_tile_number(hit.netname);
+
+                       tx += dozer.bd_dir_x;
+                       ty += dozer.bd_dir_y;
+
+                       testpos = minigame_tile_buildname(tx, ty);
+                       entity testhit = bd_find_piece(minigame, testpos, false);
+
+                       if(!bd_valid_tile(testpos) || testhit)
+                               return false;
+
+                       if(hit.netname) { strunzone(hit.netname); }
+                       hit.netname = strzone(testpos);
+                       minigame_server_sendflags(hit,MINIG_SF_UPDATE);
+                       break;
+               }
+       }
+
+       if(dozer.netname) { strunzone(dozer.netname); }
+       dozer.netname = strzone(newpos);
+
+       return true;
+}
+
+// make a move
+void bd_move(entity minigame, entity player, string dir)
+{
+       if ( minigame.minigame_flags & BD_TURN_MOVE )
+       if ( dir )
+       {
+               //if ( bd_valid_tile(pos) )
+               //if ( bd_find_piece(minigame, pos, false) )
+               {
+                       entity dozer = bd_find_dozer(minigame);
+                       if(!dozer)
+                       {
+                               LOG_INFO("Dozer wasn't found!\n");
+                               return; // should not happen... TODO: end match?
+                       }
+
+                       int dxs = 0, dys = 0;
+                       string thedir = strtolower(dir);
+                       if(thedir == "up" || thedir == "u") { dxs = 0; dys = 1; }
+                       if(thedir == "down" || thedir == "dn" || thedir == "d") { dxs = 0; dys = -1; }
+                       if(thedir == "left" || thedir == "lt" || thedir == "l") { dxs = -1; dys = 0; }
+                       if(thedir == "right" || thedir == "rt" || thedir == "r") { dxs = 1; dys = 0; }
+
+                       int dx = bound(-1, dxs, 1);
+                       int dy = bound(-1, dys, 1);
+
+                       dozer.bd_dir_x = dx;
+                       dozer.bd_dir_y = dy;
+                       dozer.bd_dir_z = 0;
+
+                       if(bd_move_dozer(minigame, dozer))
+                               player.bd_moves++;
+
+                       bd_check_winner(minigame);
+
+                       minigame_server_sendflags(dozer,MINIG_SF_UPDATE); // update anyway
+                       minigame_server_sendflags(player,BD_SF_PLAYERMOVES);
+                       minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+               }
+       }
+}
+
+// editor
+void bd_editor_place(entity minigame, entity player, string pos, int thetile, string thedir)
+{
+       if ( minigame.minigame_flags & BD_TURN_EDIT )
+       if ( pos && thetile )
+       {
+               if ( bd_valid_tile(pos) )
+               {
+                       entity found_piece = bd_find_piece(minigame, pos, false);
+                       entity targ = bd_find_piece(minigame, pos, true);
+
+                       if(found_piece.bd_tiletype == BD_TILE_DOZER && thedir != "")
+                       {
+                               int dxs = 0, dys = 0;
+                               string newdir = strtolower(thedir);
+                               if(newdir == "up" || newdir == "u") { dxs = 0; dys = 1; }
+                               if(newdir == "down" || newdir == "dn" || newdir == "d") { dxs = 0; dys = -1; }
+                               if(newdir == "left" || newdir == "lt" || newdir == "l") { dxs = -1; dys = 0; }
+                               if(newdir == "right" || newdir == "rt" || newdir == "r") { dxs = 1; dys = 0; }
+
+                               int dx = bound(-1, dxs, 1);
+                               int dy = bound(-1, dys, 1);
+
+                               found_piece.bd_dir_x = dx;
+                               found_piece.bd_dir_y = dy;
+                               found_piece.bd_dir_z = 0;
+                               minigame_server_sendflags(found_piece,MINIG_SF_UPDATE); // update anyway
+                               return;
+                       }
+
+                       entity dozer = bd_find_dozer(minigame);
+                       if(dozer && thetile == BD_TILE_DOZER && pos != dozer.netname)
+                               return; // nice try
+
+                       if(found_piece || (targ && thetile != BD_TILE_BOULDER))
+                       {
+                               entity piece = bd_find_piece(minigame, pos, false);
+                               if(!piece) piece = bd_find_piece(minigame, pos, true);
+                               if(!piece)
+                                       return; // how?!
+
+                               if(piece.netname) { strunzone(piece.netname); }
+                               remove(piece);
+                               minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+                               return;
+                       }
+
+                       entity piece = msle_spawn(minigame,"minigame_board_piece");
+                       piece.team = 1;
+                       piece.netname = strzone(pos);
+                       piece.bd_tiletype = thetile;
+                       piece.bd_dir = '0 -1 0';
+                       minigame_server_sendflags(piece,MINIG_SF_UPDATE);
+
+                       minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+               }
+       }
+}
+
+void bd_do_move(entity minigame, entity player, string dir, string thetile, string thedir)
+{
+       if(minigame.minigame_flags & BD_TURN_MOVE)
+               bd_move(minigame, player, dir);
+
+       if(minigame.minigame_flags & BD_TURN_EDIT)
+               bd_editor_place(minigame, player, dir, stof(thetile), thedir);
+}
+
+void bd_fill_recurse(entity minigame, entity player, int thetype, int letter, int number)
+{
+       string pos = minigame_tile_buildname(letter,number);
+       if(!bd_valid_tile(pos))
+               return;
+       if(bd_find_piece(minigame, pos, false) || bd_find_piece(minigame, pos, true))
+               return;
+
+       bd_editor_place(minigame, player, pos, thetype, "");
+
+       bd_fill_recurse(minigame, player, thetype, letter - 1, number);
+       bd_fill_recurse(minigame, player, thetype, letter + 1, number);
+       bd_fill_recurse(minigame, player, thetype, letter, number - 1);
+       bd_fill_recurse(minigame, player, thetype, letter, number + 1);
+}
+
+void bd_unfill_recurse(entity minigame, entity player, int thetype, int letter, int number)
+{
+       string pos = minigame_tile_buildname(letter,number);
+       if(!bd_valid_tile(pos))
+               return;
+
+       entity targ = bd_find_piece(minigame, pos, true);
+       entity piece = bd_find_piece(minigame, pos, false);
+
+       if(targ && thetype == targ.bd_tiletype)
+       {
+               if(targ.netname) { strunzone(targ.netname); }
+               remove(targ);
+       }
+       else if(piece && thetype == piece.bd_tiletype)
+       {
+               if(piece.netname) { strunzone(piece.netname); }
+               remove(piece);
+       }
+       else return;
+
+       bd_unfill_recurse(minigame, player, thetype, letter - 1, number);
+       bd_unfill_recurse(minigame, player, thetype, letter + 1, number);
+       bd_unfill_recurse(minigame, player, thetype, letter, number - 1);
+       bd_unfill_recurse(minigame, player, thetype, letter, number + 1);
+}
+
+void bd_do_fill(entity minigame, entity player, string dir, string thetile)
+{
+       if(minigame.minigame_flags & BD_TURN_EDIT)
+       {
+               int thetype = stof(thetile);
+
+               entity targ = bd_find_piece(minigame, dir, true);
+               entity piece = bd_find_piece(minigame, dir, false);
+
+               if(!bd_canfill(thetype) || (piece || targ))
+               {
+                       int killtype = 0;
+
+                       if(targ) { killtype = targ.bd_tiletype; }
+                       if(piece) { killtype = piece.bd_tiletype; }
+
+                       if(killtype)
+                       {
+                               int letter = minigame_tile_letter(dir);
+                               int number = minigame_tile_number(dir);
+                               bd_unfill_recurse(minigame, player, killtype, letter, number);
+                       }
+
+                       return;
+               }
+
+               int letter = minigame_tile_letter(dir);
+               int number = minigame_tile_number(dir);
+
+               bd_fill_recurse(minigame, player, thetype, letter, number);
+       }
+}
+
+void bd_reset_moves(entity minigame)
+{
+       entity e;
+#ifdef SVQC
+       for(e = minigame.minigame_players; e; e = e.list_next)
+#elif defined(CSQC)
+       e = world;
+       while( (e = findentity(e,owner,minigame)) )
+               if ( e.classname == "minigame_player" )
+#endif
+               {
+                       e.bd_moves = 0;
+                       minigame_server_sendflags(e,BD_SF_PLAYERMOVES);
+               }
+}
+
+void bd_load_level(entity minigame);
+void bd_setup_pieces(entity minigame)
+{
+       entity e = world;
+       while( (e = findentity(e, owner, minigame)) )
+               if(e.classname == "minigame_board_piece")
+               {
+                       if(e.netname) { strunzone(e.netname); }
+                       remove(e);
+               }
+
+       bd_load_level(minigame);
+}
+
+void bd_do_next_match(entity minigame, entity player)
+{
+       minigame.minigame_flags = BD_TURN_MOVE;
+       minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+
+       if(minigame.bd_nextlevel && minigame.bd_nextlevel != "")
+       {
+               if(minigame.bd_levelname) { strunzone(minigame.bd_levelname); }
+               minigame.bd_levelname = strzone(minigame.bd_nextlevel);
+       }
+
+       bd_setup_pieces(minigame);
+
+       bd_reset_moves(minigame);
+}
+
+void bd_set_next_match(entity minigame, string next)
+{
+       if(minigame.bd_nextlevel) { strunzone(minigame.bd_nextlevel); }
+       minigame.bd_nextlevel = strzone(next);
+}
+
+void bd_next_match(entity minigame, entity player, string next)
+{
+       if(minigame.minigame_flags & BD_TURN_WIN)
+               bd_do_next_match(minigame, player);
+       if(minigame.minigame_flags & BD_TURN_EDIT)
+               bd_set_next_match(minigame, next);
+}
+
+// request a new match
+void bd_restart_match(entity minigame, entity player)
+{
+       minigame.minigame_flags = BD_TURN_MOVE;
+       minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+
+       bd_setup_pieces(minigame);
+
+       bd_reset_moves(minigame);
+}
+
+void bd_activate_editor(entity minigame, entity player)
+{
+#ifdef SVQC
+       if(!player.minigame_players.bd_canedit)
+       {
+               sprint(player.minigame_players, "You're not allowed to edit levels, sorry!\n");
+               return;
+       }
+#endif
+
+       minigame.minigame_flags = BD_TURN_EDIT;
+       minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+
+       bd_reset_moves(minigame);
+
+       bd_setup_pieces(minigame);
+}
+
+string bd_save_piece(entity minigame, entity e)
+{
+       string bd_string = "";
+
+       bd_string = strcat(bd_string, "\"", e.netname, "\" ");
+       bd_string = strcat(bd_string, ftos(e.bd_tiletype), " ");
+       bd_string = strcat(bd_string, sprintf("\"%.9v\"", e.bd_dir));
+
+       return bd_string;
+}
+
+void bd_set_nextlevel(entity minigame, string s)
+{
+       tokenize_console(s);
+
+       if(minigame.bd_nextlevel) { strunzone(minigame.bd_nextlevel); }
+       minigame.bd_nextlevel = strzone(argv(2));
+}
+
+entity bd_load_piece(entity minigame, string s)
+{
+       // separate pieces between the ; symbols
+       string bd_string = s;
+
+       tokenize_console(bd_string);
+
+       entity e = msle_spawn(minigame,"minigame_board_piece");
+       e.team = 1;
+       e.bd_dir = '0 -1 0';
+
+       int argv_num = 0;
+       e.netname = strzone(argv(argv_num)); ++argv_num;
+       e.bd_tiletype = stof(argv(argv_num)); ++argv_num;
+       e.bd_dir = stov(argv(argv_num)); ++argv_num;
+
+       minigame_server_sendflags(e,MINIG_SF_ALL);
+
+       return e;
+}
+
+bool bd_save_level(entity minigame)
+{
+       if(minigame.bd_levelname && minigame.bd_levelname != "")
+       {
+               int target_count = 0, boulder_count = 0;
+               entity piece = world;
+               while((piece = findentity(piece,owner,minigame)))
+               if(piece.classname == "minigame_board_piece")
+                       if(piece.bd_tiletype == BD_TILE_BOULDER)
+                               ++boulder_count;
+                       else if(piece.bd_tiletype == BD_TILE_TARGET)
+                               ++target_count;
+
+               if(boulder_count != target_count)
+               {
+                       LOG_INFO("Not enough targets or boulders, fix your level!\n");
+                       return false;
+               }
+
+               // saves all objects to the database file
+               string file_name;
+               float file_get;
+
+               file_name = strcat("minigames/bulldozer/storage_", minigame.bd_levelname, ".txt");
+               file_get = fopen(file_name, FILE_WRITE);
+               fputs(file_get, strcat("// bulldozer storage \"", minigame.bd_levelname, "\" last updated ", strftime(true, "%d-%m-%Y %H:%M:%S"), "\n"));
+
+               if(minigame.bd_nextlevel && minigame.bd_nextlevel != "" && fexists(strcat("minigames/bulldozer/storage_", minigame.bd_nextlevel, ".txt")))
+                       fputs(file_get, strcat("nextlevel = \"", minigame.bd_nextlevel, "\"\n"));
+
+               entity e = world;
+               while ( ( e = findentity(e,owner,minigame) ) )
+               if ( e.classname == "minigame_board_piece" )
+               {
+                       // use a line of text for each object, listing all properties
+                       fputs(file_get, strcat(bd_save_piece(minigame, e), "\n"));
+               }
+               fclose(file_get);
+
+               return true;
+       }
+
+       return false;
+}
+
+void bd_load_level(entity minigame)
+{
+       // loads all items from the database file
+       string file_read, file_name;
+       float file_get;
+
+       file_name = strcat("minigames/bulldozer/storage_", minigame.bd_levelname, ".txt");
+       file_get = fopen(file_name, FILE_READ);
+       if(file_get < 0)
+       {
+               LOG_INFO("^3BULLDOZER: ^7could not find storage file ^3", file_name, "^7, no items were loaded\n");
+       }
+       else
+       {
+               for(;;)
+               {
+                       file_read = fgets(file_get);
+                       if(file_read == "")
+                               break;
+                       if(substring(file_read, 0, 2) == "//")
+                               continue;
+                       if(substring(file_read, 0, 1) == "#")
+                               continue;
+                       if(substring(file_read, 0, 9) == "nextlevel")
+                       {
+                               bd_set_nextlevel(minigame, file_read);
+                               continue;
+                       }
+
+                       entity e;
+                       e = bd_load_piece(minigame, file_read);
+               }
+       }
+       fclose(file_get);
+}
+
+void bd_close_editor(entity minigame)
+{
+       entity dozer = bd_find_dozer(minigame);
+       if(!dozer)
+       {
+               LOG_INFO("You need to place a bulldozer on the level to save it!\n");
+               return;
+       }
+
+       if(bd_save_level(minigame))
+       {
+               minigame.minigame_flags = BD_TURN_MOVE;
+               minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+       }
+       else
+       {
+               LOG_INFO("You need to set the level name!\n");
+               return;
+       }
+}
+
+#ifdef SVQC
+
+// required function, handle server side events
+int bd_server_event(entity minigame, string event, ...)
+{
+       switch(event)
+       {
+               case "start":
+               {
+                       if(minigame.bd_levelname) { strunzone(minigame.bd_levelname); }
+                       minigame.bd_levelname = strzone(autocvar_sv_minigames_bulldozer_startlevel);
+                       bd_setup_pieces(minigame);
+                       minigame.minigame_flags = BD_TURN_MOVE;
+                       
+                       return true;
+               }
+               case "end":
+               {
+                       entity e = world;
+                       while( (e = findentity(e, owner, minigame)) )
+                       if(e.classname == "minigame_board_piece")
+                       {
+                               if(e.netname) { strunzone(e.netname); }
+                               remove(e);
+                       }
+
+                       if(minigame.bd_nextlevel) { strunzone(minigame.bd_nextlevel); }
+                       if(minigame.bd_levelname) { strunzone(minigame.bd_levelname); }
+                       return false;
+               }
+               case "join":
+               {
+                       int pl_num = minigame_count_players(minigame);
+
+                       if(pl_num >= BD_TEAMS) { return false; }
+
+                       return 1;
+               }
+               case "cmd":
+               {
+                       switch(argv(0))
+                       {
+                               case "move":
+                                       bd_do_move(minigame, ...(0,entity), ((...(1,int)) >= 2 ? argv(1) : string_null), ((...(1,int)) >= 3 ? argv(2) : string_null), ((...(1,int)) >= 4 ? argv(3) : string_null)); 
+                                       return true;
+                               case "next":
+                                       bd_next_match(minigame,...(0,entity), ((...(1,int) >= 2 ? argv(1) : string_null)));
+                                       return true;
+                               case "restart":
+                                       bd_restart_match(minigame,...(0,entity));
+                                       return true;
+                               case "edit":
+                                       bd_activate_editor(minigame,...(0,entity));
+                                       return true;
+                               case "save":
+                                       bd_close_editor(minigame);
+                                       return true;
+                               case "fill":
+                                       bd_do_fill(minigame, ...(0,entity), ((...(1,int)) >= 2 ? argv(1) : string_null), ((...(1,int)) >= 3 ? argv(2) : string_null)); 
+                                       return true;
+                       }
+
+                       return false;
+               }
+               case "network_send":
+               {
+                       entity sent = ...(0,entity);
+                       int sf = ...(1,int);
+                       if ( sent.classname == "minigame_board_piece" && (sf & MINIG_SF_UPDATE) )
+                       {
+                               int letter = minigame_tile_letter(sent.netname);
+                               int number = minigame_tile_number(sent.netname);
+
+                               WriteByte(MSG_ENTITY,letter);
+                               WriteByte(MSG_ENTITY,number);
+
+                               WriteByte(MSG_ENTITY,sent.bd_tiletype);
+
+                               int dx = sent.bd_dir_x;
+                               int dy = sent.bd_dir_y;
+                               if(dx == -1) dx = 2;
+                               if(dy == -1) dy = 2;
+                               WriteByte(MSG_ENTITY,dx);
+                               WriteByte(MSG_ENTITY,dy);
+                       }
+                       else if(sent.classname == "minigame_player" && (sf & BD_SF_PLAYERMOVES))
+                               WriteShort(MSG_ENTITY,sent.bd_moves);
+                       return false;
+               }
+       }
+       
+       return false;
+}
+
+
+#elif defined(CSQC)
+
+int bd_curr_tile;
+string bd_curr_pos;
+
+vector bd_boardpos; // HUD board position
+vector bd_boardsize;// HUD board size
+
+string bd_get_tile_pic(int tileid)
+{
+       switch(tileid)
+       {
+               case BD_TILE_BOULDER: return "bd/boulder";
+               case BD_TILE_BRICK1: return "bd/brick1";
+               case BD_TILE_BRICK2: return "bd/brick2";
+               case BD_TILE_BRICK3: return "bd/brick3";
+               case BD_TILE_BRICK4: return "bd/brick4";
+               case BD_TILE_BRICK5: return "bd/brick5";
+               case BD_TILE_BRICK6: return "bd/brick6";
+               case BD_TILE_TARGET: return "bd/target";
+               case BD_TILE_DOZER: return "bd/dozer";
+       }
+
+       return string_null;
+}
+
+// Required function, draw the game board
+void bd_hud_board(vector pos, vector mySize)
+{
+       minigame_hud_fitsqare(pos, mySize);
+       bd_boardpos = pos;
+       bd_boardsize = mySize;
+       
+       minigame_hud_simpleboard(pos,mySize,minigame_texture("bd/board"));
+
+       vector tile_size = minigame_hud_denormalize_size('1 1 0' / BD_TILE_SIZE,pos,mySize);
+       vector tile_pos;
+
+       entity e;
+       FOREACH_MINIGAME_ENTITY(e)
+       {
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype != BD_TILE_TARGET && e.bd_tiletype != BD_TILE_DOZER )
+               {
+                       tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+                       tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+                       string thepiece = bd_get_tile_pic(e.bd_tiletype);
+
+                       minigame_drawpic_centered( tile_pos,  
+                                       minigame_texture(thepiece),
+                                       tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+               }
+
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET && e.bd_tiletype != BD_TILE_DOZER )
+               {
+                       tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+                       tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+                       minigame_drawpic_centered( tile_pos,  
+                                       minigame_texture("bd/target"),
+                                       tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+               }
+
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype != BD_TILE_TARGET && e.bd_tiletype == BD_TILE_DOZER )
+               {
+                       tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+                       tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+                       vector thedir = e.bd_dir;
+                       float theang = 0;
+
+                       if(thedir_y == -1) { theang = M_PI; }
+                       if(thedir_x == 1) { theang = M_PI/2; }
+                       if(thedir_x == -1) { theang = M_PI*3/2; }
+
+                       drawrotpic(tile_pos, theang, minigame_texture("bd/dozer"),
+                                               tile_size, tile_size/2, '1 1 1',
+                                               panel_fg_alpha, DRAWFLAG_NORMAL );
+               }
+       }
+
+       FOREACH_MINIGAME_ENTITY(e)
+       {
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET )
+               {
+                       tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+                       tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+                       minigame_drawpic_centered( tile_pos,  
+                                       minigame_texture("bd/target"),
+                                       tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+               }
+       }
+
+       FOREACH_MINIGAME_ENTITY(e)
+       {
+               if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER )
+               {
+                       tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+                       tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+                       vector thedir = e.bd_dir;
+                       float theang = 0;
+
+                       if(thedir_y == -1) { theang = M_PI; }
+                       if(thedir_x == 1) { theang = M_PI/2; }
+                       if(thedir_x == -1) { theang = M_PI*3/2; }
+
+                       drawrotpic(tile_pos, theang, minigame_texture("bd/dozer"),
+                                               tile_size, tile_size/2, '1 1 1',
+                                               panel_fg_alpha, DRAWFLAG_NORMAL );
+               }
+       }
+
+       if(active_minigame.minigame_flags & BD_TURN_EDIT)
+       if(bd_valid_tile(bd_curr_pos))
+       {
+               entity piece = bd_find_piece(active_minigame, bd_curr_pos, false);
+               entity targ = bd_find_piece(active_minigame, bd_curr_pos, true);
+               string thepiece = ((piece || (targ && bd_curr_tile != BD_TILE_BOULDER)) ? "bd/delete" : bd_get_tile_pic(bd_curr_tile));
+
+               tile_pos = minigame_tile_pos(bd_curr_pos,BD_LET_CNT,BD_NUM_CNT);
+               tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+               if(bd_curr_tile == BD_TILE_DOZER)
+               {
+                       drawrotpic(tile_pos, M_PI, minigame_texture("bd/dozer"),
+                                               tile_size, tile_size/2, '1 1 1',
+                                               panel_fg_alpha/2, DRAWFLAG_NORMAL );
+               }
+               else
+               {
+                       minigame_drawpic_centered( tile_pos,
+                                       minigame_texture(thepiece),
+                                       tile_size, '1 1 1', panel_fg_alpha/2, DRAWFLAG_NORMAL );
+               }
+       }
+
+       if ( (active_minigame.minigame_flags & BD_TURN_LOSS) || (active_minigame.minigame_flags & BD_TURN_WIN) )
+       {
+               vector winfs = hud_fontsize*2;
+               string victory_text = "Game over!";
+
+               if(active_minigame.minigame_flags & BD_TURN_WIN)
+                       victory_text = "Well done! Click 'Next Level' to continue";
+               
+               vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
+               vector win_sz;
+               win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
+                       sprintf("%s", victory_text), 
+                       winfs, 0, DRAWFLAG_NORMAL, 0.5);
+               
+               drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'0.3 0.3 1',0.8,DRAWFLAG_ADDITIVE);
+               
+               minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
+                       sprintf("%s", victory_text), 
+                       winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5);
+       }
+}
+
+
+// Required function, draw the game status panel
+void bd_hud_status(vector pos, vector mySize)
+{
+       HUD_Panel_DrawBg(1);
+       vector ts;
+       ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
+               hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
+
+       pos_y += ts_y;
+       mySize_y -= ts_y;
+
+       vector player_fontsize = hud_fontsize * 1.75;
+       ts_y = ( mySize_y - 2*player_fontsize_y ) / BD_TEAMS;
+       ts_x = mySize_x;
+       vector mypos;
+       vector tile_size = '48 48 0';
+
+       mypos = pos;
+       drawfill(mypos,eX*mySize_x+eY*player_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE);
+       mypos_y += player_fontsize_y;
+       drawfill(mypos,eX*mySize_x+eY*tile_size_y,'1 1 1',0.25,DRAWFLAG_ADDITIVE);
+
+       entity e;
+       FOREACH_MINIGAME_ENTITY(e)
+       {
+               if ( e.classname == "minigame_player" )
+               {
+                       mypos = pos;
+                       minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
+                               GetPlayerName(e.minigame_playerslot-1),
+                               player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+
+                       mypos_y += player_fontsize_y;
+                       string thepiece = "bd/dozer";
+                       if(active_minigame.minigame_flags & BD_TURN_EDIT)
+                               thepiece = bd_get_tile_pic(bd_curr_tile);
+                       drawpic( mypos,
+                                       minigame_texture(thepiece),
+                                       tile_size * 0.7, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+
+                       mypos_x += tile_size_x;
+
+                       drawstring(mypos,ftos(e.bd_moves),tile_size,
+                                          '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
+       }
+}
+
+// Turn a set of flags into a help message
+string bd_turn_to_string(int turnflags)
+{
+       if ( turnflags & BD_TURN_LOSS )
+               return _("Better luck next time!");
+
+       if ( turnflags & BD_TURN_WIN )
+               if(random() > 0.5)
+                       return _("Tubular! Press \"Next Level\" to continue!");
+               else
+                       return _("Wicked! Press \"Next Level\" to continue!");
+
+       if( turnflags & BD_TURN_EDIT )
+               return _("Press the space bar to change your currently selected tile");
+
+       if ( turnflags & BD_TURN_MOVE )
+               return _("Push the boulders onto the targets");
+       
+       return "";
+}
+
+// Make the correct move
+void bd_make_move(entity minigame, string dir)
+{
+       if ( minigame.minigame_flags == BD_TURN_MOVE )
+       {
+               minigame_cmd("move ", dir);
+       }
+}
+
+void bd_editor_make_move(entity minigame, string dir)
+{
+       if ( minigame.minigame_flags == BD_TURN_EDIT )
+       {
+               minigame_cmd("move ", bd_curr_pos, " ", ftos(bd_curr_tile), " ", dir);
+       }
+}
+
+void bd_editor_fill(entity minigame)
+{
+       if ( minigame.minigame_flags == BD_TURN_EDIT )
+       {
+               minigame_cmd("fill ", bd_curr_pos, " ", ftos(bd_curr_tile));
+       }
+}
+
+void bd_set_curr_pos(string s)
+{
+       if ( bd_curr_pos )
+               strunzone(bd_curr_pos);
+       if ( s )
+               s = strzone(s);
+       bd_curr_pos = s;
+}
+
+bool bd_normal_move(entity minigame, int themove)
+{
+       switch ( themove )
+       {
+               case K_RIGHTARROW:
+               case K_KP_RIGHTARROW:
+                       bd_make_move(minigame, "r");
+                       return true;
+               case K_LEFTARROW:
+               case K_KP_LEFTARROW:
+                       bd_make_move(minigame, "l");
+                       return true;
+               case K_UPARROW:
+               case K_KP_UPARROW:
+                       bd_make_move(minigame, "u");
+                       return true;
+               case K_DOWNARROW:
+               case K_KP_DOWNARROW:
+                       bd_make_move(minigame, "d");
+                       return true;
+       }
+
+       return false;
+}
+
+bool bd_change_dozer_angle(entity minigame)
+{
+       entity dozer = bd_find_piece(minigame, bd_curr_pos, false);
+       if(!dozer || dozer.bd_tiletype != BD_TILE_DOZER)
+               return false;
+
+       string thedir = "";
+       vector dir = dozer.bd_dir;
+       if(dir.x == 0 && dir.y == 0) { thedir = "r"; }
+
+       if(dir.x == 0 && dir.y == 1) { thedir = "r"; }
+       if(dir.x == 0 && dir.y ==-1) { thedir = "l"; }
+       if(dir.x ==-1 && dir.y == 0) { thedir = "u"; }
+       if(dir.x == 1 && dir.y == 0) { thedir = "d"; }
+
+       bd_editor_make_move(minigame, thedir);
+       return true;
+}
+
+bool bd_editor_move(entity minigame, int themove)
+{
+       switch ( themove )
+       {
+               case K_RIGHTARROW:
+               case K_KP_RIGHTARROW:
+                       if ( ! bd_curr_pos )
+                               bd_set_curr_pos("a3");
+                       else
+                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,1,0,BD_NUM_CNT,BD_LET_CNT));
+                       return true;
+               case K_LEFTARROW:
+               case K_KP_LEFTARROW:
+                       if ( ! bd_curr_pos )
+                               bd_set_curr_pos("c3");
+                       else
+                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,-1,0,BD_NUM_CNT,BD_LET_CNT));
+                       return true;
+               case K_UPARROW:
+               case K_KP_UPARROW:
+                       if ( ! bd_curr_pos )
+                               bd_set_curr_pos("a1");
+                       else
+                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,1,BD_NUM_CNT,BD_LET_CNT));
+                       return true;
+               case K_DOWNARROW:
+               case K_KP_DOWNARROW:
+                       if ( ! bd_curr_pos )
+                               bd_set_curr_pos("a3");
+                       else
+                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,-1,BD_NUM_CNT,BD_LET_CNT));
+                       return true;
+               case K_ENTER:
+               case K_KP_ENTER:
+                       bd_editor_make_move(minigame, "");
+                       return true;
+               case K_SPACE:
+                       if(bd_change_dozer_angle(minigame))
+                               return true;
+                       bd_curr_tile += 1;
+                       if(bd_curr_tile > BD_TILE_LAST)
+                               bd_curr_tile = 1;
+                       return true;
+       }
+
+       return false;
+}
+
+// Required function, handle client events
+int bd_client_event(entity minigame, string event, ...)
+{
+       switch(event)
+       {
+               case "activate":
+               {
+                       minigame.message = bd_turn_to_string(minigame.minigame_flags);
+                       bd_set_curr_pos("");
+                       bd_curr_tile = BD_TILE_BRICK1;
+                       return false;
+               }
+               case "key_pressed":
+               {
+                       if(minigame.minigame_flags & BD_TURN_MOVE)
+                       {
+                               if(bd_normal_move(minigame, ...(0,int)))
+                                       return true;
+                       }
+
+                       if(minigame.minigame_flags & BD_TURN_EDIT)
+                       {
+                               if(bd_editor_move(minigame, ...(0,int)))
+                                       return true;
+                       }
+
+                       return false;
+               }
+               case "mouse_pressed":
+               {
+                       if(minigame.minigame_flags & BD_TURN_EDIT)
+                       {
+                               if(...(0,int) == K_MOUSE1)
+                               {
+                                       bd_editor_make_move(minigame, "");
+                                       return true;
+                               }
+
+                               if(...(0,int) == K_MOUSE2)
+                               {
+                                       bd_editor_fill(minigame);
+                                       return true;
+                               }
+                       }
+
+                       return false;
+               }
+               case "mouse_moved":
+               {
+                       if(minigame.minigame_flags & BD_TURN_EDIT)
+                       {
+                               vector mouse_pos = minigame_hud_normalize(mousepos,bd_boardpos,bd_boardsize);
+                               bd_set_curr_pos(minigame_tile_name(mouse_pos,BD_LET_CNT,BD_NUM_CNT));
+                               if ( ! bd_valid_tile(bd_curr_pos) )
+                                       bd_set_curr_pos("");
+                       }
+                       return true;
+               }
+               case "network_receive":
+               {
+                       entity sent = ...(0,entity);
+                       int sf = ...(1,int);
+                       if ( sent.classname == "minigame" )
+                       {
+                               if ( sf & MINIG_SF_UPDATE )
+                               {
+                                       sent.message = bd_turn_to_string(sent.minigame_flags);
+                                       //if ( sent.minigame_flags & minigame_self.team )
+                                               minigame_prompt();
+                               }
+                       }
+                       else if(sent.classname == "minigame_board_piece")
+                       {
+                               if(sf & MINIG_SF_UPDATE)
+                               {
+                                       int letter = ReadByte();
+                                       int number = ReadByte();
+                                       if(sent.netname) { strunzone(sent.netname); }
+                                       sent.netname = strzone(minigame_tile_buildname(letter, number));
+
+                                       sent.bd_tiletype = ReadByte();
+
+                                       int dx = ReadByte();
+                                       int dy = ReadByte();
+
+                                       if(dx == 2) dx = -1;
+                                       if(dy == 2) dy = -1;
+
+                                       sent.bd_dir_x = dx;
+                                       sent.bd_dir_y = dy;
+                                       sent.bd_dir_z = 0;
+                               }
+                       }
+                       else if(sent.classname == "minigame_player" && (sf & BD_SF_PLAYERMOVES))
+                               sent.bd_moves = ReadShort(); // make this a byte when possible
+
+                       return false;
+               }
+               case "menu_show":
+               {
+                       HUD_MinigameMenu_CustomEntry(...(0,entity),_("Next Level"),"next");
+                       HUD_MinigameMenu_CustomEntry(...(0,entity),_("Restart"),"restart");
+                       HUD_MinigameMenu_CustomEntry(...(0,entity),_("Editor"),"edit");
+                       HUD_MinigameMenu_CustomEntry(...(0,entity),_("Save"),"save");
+                       return false;
+               }
+               case "menu_click":
+               {
+                       if(...(0,string) == "next")
+                               minigame_cmd("next");
+                       if(...(0,string) == "restart")
+                               minigame_cmd("restart");
+                       if(...(0,string) == "edit")
+                               minigame_cmd("edit");
+                       if(...(0,string) == "save")
+                               minigame_cmd("save");
+                       return false;
+               }
+       }
+
+       return false;
+}
+
+#endif
\ No newline at end of file
index 73e2a2bb1d1567d1d13b208ac81731797b1cd2c5..f69fc15b548c39ef99759700247db76dfdfedd5f 100644 (file)
@@ -51,8 +51,6 @@ void minigame_rmplayer(entity minigame_session, entity player)
 
 
 #define FIELD(Flags, Type,Name) if ( sf & (Flags) ) Write##Type(MSG_ENTITY, self.Name);
-#define WriteVector(to,Name) WriteCoord(to,Name##_x); WriteCoord(to,Name##_y); WriteCoord(to,Name##_z)
-#define WriteVector2D(to,Name) WriteCoord(to,Name##_x); WriteCoord(to,Name##_y)
 #define MSLE(Name,Fields) \
        else if ( self.classname == #Name ) { \
                if ( sf & MINIG_SF_CREATE ) WriteString(MSG_ENTITY,self.owner.netname); \
index eb6825ed600e52ad46df1c47af15717d3a10229d..10e0a039fe3a5755bd22d4a075637150206dc449 100644 (file)
@@ -46,19 +46,19 @@ entity minigame_sessions;
 
 bool minigame_SendEntity(entity this, entity to, int sf);
 
-REGISTRY(Minigames, BITS(3))
+REGISTRY(Minigames, BITS(4))
 #define Minigames_from(i) _Minigames_from(i, NULL)
 REGISTER_REGISTRY(Minigames)
 REGISTRY_CHECK(Minigames)
 #define REGISTER_MINIGAME(name,nicename) \
-    REGISTER(Minigames, MINIGAMEname, m_id, new(minigame_descriptor)); \
+    REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \
     int name##_server_event(entity, string, ...); \
-    REGISTER_INIT_POST(MINIGAMEname) { \
+    REGISTER_INIT_POST(MINIGAME_##name) { \
         make_pure(this); \
         this.netname = strzone(strtolower(#name)); \
         this.message = nicename; \
                this.minigame_event = name##_server_event; \
     } \
-    REGISTER_INIT(MINIGAMEname)
+    REGISTER_INIT(MINIGAME_##name)
 
 #endif
index 67b6808cc7b23346d517f310435cba7ab09d00ae..f30d36065fa34925fcb7437c19e9f4f80c1ff290 100644 (file)
@@ -107,7 +107,7 @@ void M_Shambler_Attack_Lightning_Explode()
                Damage(head, self, self.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_ZAP.m_id, head.origin, '0 0 0');
        }
 
-       self.think = SUB_Remove;
+       self.think = SUB_Remove_self;
        self.nextthink = time + 0.2;
 }
 
index 702e8ee39d010bc67d77dff3b4f5118d9485421c..7ee3e3eab72d84228fe2360e7d46a8137ede8fe1 100644 (file)
@@ -207,7 +207,7 @@ void Monster_Delay_Action()
        }
        else
        {
-               oldself.think = SUB_Remove;
+               oldself.think = SUB_Remove_self;
                oldself.nextthink = time;
        }
 }
@@ -955,19 +955,19 @@ float Monster_Appear_Check(entity ent, float monster_id)
        return true;
 }
 
-void Monster_Reset()
-{SELFPARAM();
-       setorigin(self, self.pos1);
-       self.angles = self.pos2;
+void Monster_Reset(entity this)
+{
+       setorigin(this, this.pos1);
+       this.angles = this.pos2;
 
-       Unfreeze(self); // remove any icy remains
+       Unfreeze(this); // remove any icy remains
 
-       self.health = self.max_health;
-       self.velocity = '0 0 0';
-       self.enemy = world;
-       self.goalentity = world;
-       self.attack_finished_single[0] = 0;
-       self.moveto = self.origin;
+       this.health = this.max_health;
+       this.velocity = '0 0 0';
+       this.enemy = world;
+       this.goalentity = world;
+       this.attack_finished_single[0] = 0;
+       this.moveto = this.origin;
 }
 
 void Monster_Dead_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -983,7 +983,7 @@ void Monster_Dead_Damage(entity inflictor, entity attacker, float damage, int de
                // number of monsters spawned with mobspawn command
                totalspawned -= 1;
 
-               self.think = SUB_Remove;
+               self.think = SUB_Remove_self;
                self.nextthink = time + 0.1;
                self.event_damage = func_null;
        }
@@ -1121,7 +1121,7 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
                {
                        Violence_GibSplash(self, 1, 0.5, attacker);
 
-                       self.think = SUB_Remove;
+                       self.think = SUB_Remove_self;
                        self.nextthink = time + 0.1;
                }
        }
index 94a00b9de76bd8ea19a02fe009ad493f1e153066..db22d314115f510c7a58369af9c2c8b1d9678754 100644 (file)
@@ -17,13 +17,13 @@ REGISTER_REGISTRY(Buffs)
 REGISTRY_CHECK(Buffs)
 
 #define REGISTER_BUFF(id) \
-    REGISTER(Buffs, BUFFid, m_id, NEW(Buff)); \
-    REGISTER_INIT_POST(BUFFid) { \
+    REGISTER(Buffs, BUFF_##id, m_id, NEW(Buff)); \
+    REGISTER_INIT_POST(BUFF_##id) { \
         this.netname = this.m_name; \
         this.m_itemid = BIT(this.m_id - 1); \
         this.m_sprite = strzone(strcat("buff-", this.m_name)); \
     } \
-    REGISTER_INIT(BUFFid)
+    REGISTER_INIT(BUFF_##id)
 
 #include "../../../items/item/pickup.qh"
 CLASS(Buff, Pickup)
index 08f1aa3b504f60b93beb10ff6a6c28a25cd1b29e..9eb113a96ff86355b809b690b43ceaff159cc79e 100644 (file)
@@ -381,17 +381,17 @@ void buff_Waypoint_Reset()
        if(self.buff_activetime) { buff_Waypoint_Spawn(self); }
 }
 
-void buff_Reset()
-{SELFPARAM();
+void buff_Reset(entity this)
+{
        if(autocvar_g_buffs_randomize)
-               buff_NewType(self, self.buffs);
-       self.owner = world;
+               buff_NewType(this, this.buffs);
+       this.owner = world;
        buff_SetCooldown(autocvar_g_buffs_cooldown_activate);
        buff_Waypoint_Reset();
-       self.buff_activetime_updated = false;
+       this.buff_activetime_updated = false;
 
-       if(autocvar_g_buffs_random_location || (self.spawnflags & 64))
-               buff_Respawn(self);
+       if(autocvar_g_buffs_random_location || (this.spawnflags & 64))
+               buff_Respawn(this);
 }
 
 float buff_Customize()
index 1810734c64b36d46e36a9f4b401e9eb7769c3244..6f35817149af1fc753a52b9691d95c5c93721d14 100644 (file)
@@ -37,7 +37,6 @@ void instagib_invisibility()
 
 void instagib_extralife()
 {SELFPARAM();
-       self.max_health = 1;
        StartItem(this, ITEM_ExtraLife);
 }
 
@@ -431,7 +430,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, ItemTouch)
                return MUT_ITEMTOUCH_CONTINUE;
        }
 
-       if(self.max_health)
+       if(self.itemdef == ITEM_ExtraLife)
        {
                other.armorvalue = bound(other.armorvalue, 999, other.armorvalue + autocvar_g_instagib_extralives);
                Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
index ef021bbdcb23f4f2bff217b7e4c43500ea3eb6d2..12a53ff1392bef5bffb9e2efb89f1a60541b7573 100644 (file)
@@ -958,7 +958,7 @@ void nade_prime()
        fn.colormod = Nades_from(n.nade_type).m_color;
        fn.colormap = self.colormap;
        fn.glowmod = self.glowmod;
-       fn.think = SUB_Remove;
+       fn.think = SUB_Remove_self;
        fn.nextthink = n.wait;
 
        self.nade = n;
index c146f1c1a0a253d9d3b068b6b5bae77c1d3e865e..151e094c9eb72ce16b0cabfb86c0182f1c32d75b 100644 (file)
@@ -260,8 +260,8 @@ MUTATOR_HOOKFUNCTION(ok, PlayerSpawn)
        return false;
 }
 
-void _spawnfunc_weapon_hmg() { SELFPARAM(); spawnfunc_weapon_hmg(this); }
-void _spawnfunc_weapon_rpc() { SELFPARAM(); spawnfunc_weapon_rpc(this); }
+void self_spawnfunc_weapon_hmg() { SELFPARAM(); spawnfunc_weapon_hmg(this); }
+void self_spawnfunc_weapon_rpc() { SELFPARAM(); spawnfunc_weapon_rpc(this); }
 
 MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
 {SELFPARAM();
@@ -279,7 +279,7 @@ MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
                        wep.team = self.team;
                        wep.respawntime = autocvar_g_overkill_superguns_respawn_time;
                        wep.pickup_anyway = true;
-                       wep.think = _spawnfunc_weapon_hmg;
+                       wep.think = self_spawnfunc_weapon_hmg;
                        wep.nextthink = time + 0.1;
                        return true;
                }
@@ -295,7 +295,7 @@ MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
                        wep.team = self.team;
                        wep.respawntime = autocvar_g_overkill_superguns_respawn_time;
                        wep.pickup_anyway = true;
-                       wep.think = _spawnfunc_weapon_rpc;
+                       wep.think = self_spawnfunc_weapon_rpc;
                        wep.nextthink = time + 0.1;
                        return true;
                }
index 63e318d2f7c03d4d4b3e9f7b043615993b3126c0..5deb0960e2daadefae90bec456b45510459d0241 100644 (file)
@@ -103,7 +103,7 @@ float cl_notice_run()
 
         if(_notes.alpha <= time)
         {
-            _notes.think = SUB_Remove;
+            _notes.think = SUB_Remove_self;
             _notes.nextthink = time;
         }
 
index e03e23ea73c022f16cbf61f493967c2c52a8e808..6305c534025650da0dabb4a41adc43b14d7737c6 100644 (file)
@@ -264,85 +264,85 @@ void func_breakable_damage(entity inflictor, entity attacker, float damage, int
        }
 }
 
-void func_breakable_reset()
-{SELFPARAM();
-       self.team = self.team_saved;
+void func_breakable_reset(entity this)
+{
+       this.team = this.team_saved;
        func_breakable_look_restore();
-       if(self.spawnflags & 1)
+       if(this.spawnflags & 1)
                func_breakable_behave_destroyed();
        else
                func_breakable_behave_restore();
 
-       CSQCMODEL_AUTOUPDATE(self);
+       CSQCMODEL_AUTOUPDATE(this);
 }
 
 // destructible walls that can be used to trigger target_objective_decrease
 spawnfunc(func_breakable)
 {
        float n, i;
-       if(!self.health)
-               self.health = 100;
-       self.max_health = self.health;
+       if(!this.health)
+               this.health = 100;
+       this.max_health = this.health;
 
        // yes, I know, MOVETYPE_NONE is not available here, not that one would want it here anyway
-       if(!self.debrismovetype) self.debrismovetype = MOVETYPE_BOUNCE;
-       if(!self.debrissolid) self.debrissolid = SOLID_NOT;
-       if(self.debrisvelocity == '0 0 0') self.debrisvelocity = '0 0 140';
-       if(self.debrisvelocityjitter == '0 0 0') self.debrisvelocityjitter = '70 70 70';
-       if(self.debrisavelocityjitter == '0 0 0') self.debrisavelocityjitter = '600 600 600';
-       if(!self.debristime) self.debristime = 3.5;
-       if(!self.debristimejitter) self.debristime = 2.5;
-
-       if(self.mdl != "")
-               self.cnt = _particleeffectnum(self.mdl);
-       if(self.count == 0)
-               self.count = 1;
-
-       if(self.message == "")
-               self.message = "got too close to an explosion";
-       if(self.message2 == "")
-               self.message2 = "was pushed into an explosion by";
-       if(!self.dmg_radius)
-               self.dmg_radius = 150;
-       if(!self.dmg_force)
-               self.dmg_force = 200;
-
-       self.mdl = self.model;
+       if(!this.debrismovetype) this.debrismovetype = MOVETYPE_BOUNCE;
+       if(!this.debrissolid) this.debrissolid = SOLID_NOT;
+       if(this.debrisvelocity == '0 0 0') this.debrisvelocity = '0 0 140';
+       if(this.debrisvelocityjitter == '0 0 0') this.debrisvelocityjitter = '70 70 70';
+       if(this.debrisavelocityjitter == '0 0 0') this.debrisavelocityjitter = '600 600 600';
+       if(!this.debristime) this.debristime = 3.5;
+       if(!this.debristimejitter) this.debristime = 2.5;
+
+       if(this.mdl != "")
+               this.cnt = _particleeffectnum(this.mdl);
+       if(this.count == 0)
+               this.count = 1;
+
+       if(this.message == "")
+               this.message = "got too close to an explosion";
+       if(this.message2 == "")
+               this.message2 = "was pushed into an explosion by";
+       if(!this.dmg_radius)
+               this.dmg_radius = 150;
+       if(!this.dmg_force)
+               this.dmg_force = 200;
+
+       this.mdl = this.model;
        SetBrushEntityModel();
 
-       if(self.spawnflags & 4)
-               self.use = func_breakable_destroy;
+       if(this.spawnflags & 4)
+               this.use = func_breakable_destroy;
        else
-               self.use = func_breakable_restore;
+               this.use = func_breakable_restore;
 
-       if(self.spawnflags & 4)
+       if(this.spawnflags & 4)
        {
-               self.takedamage = DAMAGE_NO;
-               self.event_damage = func_null;
-               self.bot_attack = false;
+               this.takedamage = DAMAGE_NO;
+               this.event_damage = func_null;
+               this.bot_attack = false;
        }
 
        // precache all the models
-       if (self.mdl_dead)
-               precache_model(self.mdl_dead);
-       n = tokenize_console(self.debris);
+       if (this.mdl_dead)
+               precache_model(this.mdl_dead);
+       n = tokenize_console(this.debris);
        for(i = 0; i < n; ++i)
                precache_model(argv(i));
-       if(self.noise)
-               precache_sound(self.noise);
-       if(self.noise1)
-               precache_sound(self.noise1);
+       if(this.noise)
+               precache_sound(this.noise);
+       if(this.noise1)
+               precache_sound(this.noise1);
 
-       self.team_saved = self.team;
-       self.dropped_origin = self.origin;
+       this.team_saved = this.team;
+       this.dropped_origin = this.origin;
 
-       self.reset = func_breakable_reset;
-       func_breakable_reset();
+       this.reset = func_breakable_reset;
+       this.reset(this);
 
-       self.init_for_player_needed = 1;
-       self.init_for_player = func_breakable_init_for_player;
+       this.init_for_player_needed = 1;
+       this.init_for_player = func_breakable_init_for_player;
 
-       CSQCMODEL_AUTOINIT(self);
+       CSQCMODEL_AUTOINIT(this);
 }
 
 // for use in maps with a "model" key set
index ac30dda43deb43f5dcb1197e7adbed9fe498f1ea..fb50a6613c14ce5dab6c3ea43d54978fd6e4822b 100644 (file)
@@ -65,11 +65,11 @@ void conveyor_use()
        self.SendFlags |= 2;
 }
 
-void conveyor_reset()
-{SELFPARAM();
-       self.state = (self.spawnflags & 1);
+void conveyor_reset(entity this)
+{
+       this.state = (this.spawnflags & 1);
 
-       self.SendFlags |= 2;
+       this.SendFlags |= 2;
 }
 
 bool conveyor_send(entity this, entity to, int sf)
@@ -110,25 +110,24 @@ bool conveyor_send(entity this, entity to, int sf)
 
 void conveyor_init()
 {SELFPARAM();
-       if (!self.speed)
-               self.speed = 200;
-       self.movedir = self.movedir * self.speed;
-       self.think = conveyor_think;
-       self.nextthink = time;
+       if (!this.speed) this.speed = 200;
+       this.movedir *= this.speed;
+       this.think = conveyor_think;
+       this.nextthink = time;
        IFTARGETED
        {
-               self.use = conveyor_use;
-               self.reset = conveyor_reset;
-               conveyor_reset();
+               this.use = conveyor_use;
+               this.reset = conveyor_reset;
+               this.reset(this);
        }
        else
-               self.state = 1;
+               this.state = 1;
 
-       FixSize(self);
+       FixSize(this);
 
-       Net_LinkEntity(self, 0, false, conveyor_send);
+       Net_LinkEntity(this, 0, false, conveyor_send);
 
-       self.SendFlags |= 1;
+       this.SendFlags |= 1;
 }
 
 spawnfunc(trigger_conveyor)
index 6c825655664e18722470be94299c031897da2de2..c93ccc488119fee00056e1efe1b9422053766a05 100644 (file)
@@ -704,16 +704,16 @@ void door_init_startopen()
 #endif
 }
 
-void door_reset()
-{SELFPARAM();
-       SUB_SETORIGIN(self, self.pos1);
-       self.SUB_VELOCITY = '0 0 0';
-       self.state = STATE_BOTTOM;
-       self.SUB_THINK = func_null;
-       self.SUB_NEXTTHINK = 0;
+void door_reset(entity this)
+{
+       SUB_SETORIGIN(this, this.pos1);
+       this.SUB_VELOCITY = '0 0 0';
+       this.state = STATE_BOTTOM;
+       this.SUB_THINK = func_null;
+       this.SUB_NEXTTHINK = 0;
 
 #ifdef SVQC
-       self.SendFlags |= SF_TRIGGER_RESET;
+       this.SendFlags |= SF_TRIGGER_RESET;
 #endif
 }
 
@@ -812,69 +812,75 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
 
        if(sf & SF_TRIGGER_INIT)
        {
-               self.classname = strzone(ReadString());
-               self.spawnflags = ReadByte();
+               this.classname = strzone(ReadString());
+               this.spawnflags = ReadByte();
 
-               self.mdl = strzone(ReadString());
-               _setmodel(self, self.mdl);
+               this.mdl = strzone(ReadString());
+               _setmodel(this, this.mdl);
 
                trigger_common_read(true);
 
-               self.pos1_x = ReadCoord();
-               self.pos1_y = ReadCoord();
-               self.pos1_z = ReadCoord();
-               self.pos2_x = ReadCoord();
-               self.pos2_y = ReadCoord();
-               self.pos2_z = ReadCoord();
-
-               self.size_x = ReadCoord();
-               self.size_y = ReadCoord();
-               self.size_z = ReadCoord();
-
-               self.wait = ReadShort();
-               self.speed = ReadShort();
-               self.lip = ReadByte();
-               self.state = ReadByte();
-               self.SUB_LTIME = ReadCoord();
-
-               self.solid = SOLID_BSP;
-               self.movetype = MOVETYPE_PUSH;
-               self.trigger_touch = door_touch;
-               self.draw = door_draw;
-               self.drawmask = MASK_NORMAL;
-               self.use = door_use;
+               vector v;
+
+               v.x = ReadCoord();
+               v.y = ReadCoord();
+               v.z = ReadCoord();
+               this.pos1 = v;
+
+               v.x = ReadCoord();
+               v.y = ReadCoord();
+               v.z = ReadCoord();
+               this.pos2 = v;
+
+               v.x = ReadCoord();
+               v.y = ReadCoord();
+               v.z = ReadCoord();
+               this.size = v;
+
+               this.wait = ReadShort();
+               this.speed = ReadShort();
+               this.lip = ReadByte();
+               this.state = ReadByte();
+               this.SUB_LTIME = ReadCoord();
+
+               this.solid = SOLID_BSP;
+               this.movetype = MOVETYPE_PUSH;
+               this.trigger_touch = door_touch;
+               this.draw = door_draw;
+               this.drawmask = MASK_NORMAL;
+               this.use = door_use;
 
                LinkDoors();
 
-               if(self.spawnflags & DOOR_START_OPEN)
+               if(this.spawnflags & DOOR_START_OPEN)
                        door_init_startopen();
 
-               self.move_time = time;
-               self.move_origin = self.origin;
-               self.move_movetype = MOVETYPE_PUSH;
-               self.move_angles = self.angles;
-               self.move_blocked = door_blocked;
+               this.move_time = time;
+               this.move_origin = this.origin;
+               this.move_movetype = MOVETYPE_PUSH;
+               this.move_angles = this.angles;
+               this.move_blocked = door_blocked;
        }
 
        if(sf & SF_TRIGGER_RESET)
        {
-               door_reset();
+               door_reset(this);
        }
 
        if(sf & SF_TRIGGER_UPDATE)
        {
-               self.origin_x = ReadCoord();
-               self.origin_y = ReadCoord();
-               self.origin_z = ReadCoord();
-               setorigin(self, self.origin);
-               self.move_origin = self.origin;
-
-               self.pos1_x = ReadCoord();
-               self.pos1_y = ReadCoord();
-               self.pos1_z = ReadCoord();
-               self.pos2_x = ReadCoord();
-               self.pos2_y = ReadCoord();
-               self.pos2_z = ReadCoord();
+               this.origin_x = ReadCoord();
+               this.origin_y = ReadCoord();
+               this.origin_z = ReadCoord();
+               setorigin(this, this.origin);
+               this.move_origin = this.origin;
+
+               this.pos1_x = ReadCoord();
+               this.pos1_y = ReadCoord();
+               this.pos1_z = ReadCoord();
+               this.pos2_x = ReadCoord();
+               this.pos2_y = ReadCoord();
+               this.pos2_z = ReadCoord();
        }
        return true;
 }
index e01a7e73e299e6288652471a283eb9a4cb03a25c..4f88e9e9b5ae02c595511f9a96625ee1406d72e2 100644 (file)
@@ -27,13 +27,13 @@ START_OPEN causes the door to move to its destination when spawned, and operate
 FIXME: only one sound set available at the time being
 */
 
-void door_rotating_reset()
-{SELFPARAM();
-       self.angles = self.pos1;
-       self.avelocity = '0 0 0';
-       self.state = STATE_BOTTOM;
-       self.think = func_null;
-       self.nextthink = 0;
+void door_rotating_reset(entity this)
+{
+       this.angles = this.pos1;
+       this.avelocity = '0 0 0';
+       this.state = STATE_BOTTOM;
+       this.think = func_null;
+       this.nextthink = 0;
 }
 
 void door_rotating_init_startopen()
index 4d6b9b48a176d324673e2e0c5a4c0fcdfcb989af..3fabc3fb1d0939f3b66786e1f2e389ac3a8f8c7e 100644 (file)
@@ -167,16 +167,16 @@ void secret_touch()
        }
 }
 
-void secret_reset()
-{SELFPARAM();
-       if (self.spawnflags&SECRET_YES_SHOOT)
+void secret_reset(entity this)
+{
+       if (this.spawnflags & SECRET_YES_SHOOT)
        {
-               self.health = 10000;
-               self.takedamage = DAMAGE_YES;
+               this.health = 10000;
+               this.takedamage = DAMAGE_YES;
        }
-       setorigin(self, self.oldorigin);
-       self.think = func_null;
-       self.SUB_NEXTTHINK = 0;
+       setorigin(this, this.oldorigin);
+       this.think = func_null;
+       this.SUB_NEXTTHINK = 0;
 }
 
 /*QUAKED spawnfunc_func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
@@ -198,45 +198,41 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
 
 spawnfunc(func_door_secret)
 {
-       /*if (!self.deathtype) // map makers can override this
-               self.deathtype = " got in the way";*/
+       /*if (!this.deathtype) // map makers can override this
+               this.deathtype = " got in the way";*/
 
-       if (!self.dmg)
-               self.dmg = 2;
+       if (!this.dmg) this.dmg = 2;
 
        // Magic formula...
-       self.mangle = self.angles;
-       self.angles = '0 0 0';
-       self.classname = "door";
-       if (!InitMovingBrushTrigger())
-               return;
-       self.effects |= EF_LOWPRECISION;
-
-       if(self.noise == "")
-               self.noise = "misc/talk.wav";
-       precache_sound(self.noise);
-
-       self.touch = secret_touch;
-       self.blocked = secret_blocked;
-       self.speed = 50;
-       self.use = fd_secret_use;
+       this.mangle = this.angles;
+       this.angles = '0 0 0';
+       this.classname = "door";
+       if (!InitMovingBrushTrigger()) return;
+       this.effects |= EF_LOWPRECISION;
+
+       if (this.noise == "") this.noise = "misc/talk.wav";
+       precache_sound(this.noise);
+
+       this.touch = secret_touch;
+       this.blocked = secret_blocked;
+       this.speed = 50;
+       this.use = fd_secret_use;
        IFTARGETED
        {
        }
        else
-               self.spawnflags |= SECRET_YES_SHOOT;
+               this.spawnflags |= SECRET_YES_SHOOT;
 
-       if(self.spawnflags&SECRET_YES_SHOOT)
+       if (this.spawnflags & SECRET_YES_SHOOT)
        {
-               self.health = 10000;
-               self.takedamage = DAMAGE_YES;
-               self.event_damage = fd_secret_damage;
+               this.health = 10000;
+               this.takedamage = DAMAGE_YES;
+               this.event_damage = fd_secret_damage;
        }
-       self.oldorigin = self.origin;
-       if (!self.wait)
-               self.wait = 5;          // 5 seconds before closing
+       this.oldorigin = this.origin;
+       if (!this.wait) this.wait = 5; // seconds before closing
 
-       self.reset = secret_reset;
-       secret_reset();
+       this.reset = secret_reset;
+       this.reset(this);
 }
 #endif
index cb2cc3a49cbeb47c065c05bbd071323657e15581..a419e62106ab3b7cab2ee2fff3686275594fc323 100644 (file)
@@ -63,70 +63,63 @@ void plat_link()
 
 spawnfunc(func_plat)
 {
-       if (self.sounds == 0)
-               self.sounds = 2;
+       if (this.sounds == 0) this.sounds = 2;
 
-    if(self.spawnflags & 4)
-        self.dmg = 10000;
+    if (this.spawnflags & 4) this.dmg = 10000;
 
-    if(self.dmg && (self.message == ""))
-               self.message = "was squished";
-    if(self.dmg && (self.message2 == ""))
-               self.message2 = "was squished by";
+    if (this.dmg && (this.message == "")) this.message = "was squished";
+    if (this.dmg && (this.message2 == "")) this.message2 = "was squished by";
 
-       if (self.sounds == 1)
+       if (this.sounds == 1)
        {
                precache_sound ("plats/plat1.wav");
                precache_sound ("plats/plat2.wav");
-               self.noise = "plats/plat1.wav";
-               self.noise1 = "plats/plat2.wav";
+               this.noise = "plats/plat1.wav";
+               this.noise1 = "plats/plat2.wav";
        }
 
-       if (self.sounds == 2)
+       if (this.sounds == 2)
        {
                precache_sound ("plats/medplat1.wav");
                precache_sound ("plats/medplat2.wav");
-               self.noise = "plats/medplat1.wav";
-               self.noise1 = "plats/medplat2.wav";
+               this.noise = "plats/medplat1.wav";
+               this.noise1 = "plats/medplat2.wav";
        }
 
-       if (self.sound1)
+       if (this.sound1)
        {
-               precache_sound (self.sound1);
-               self.noise = self.sound1;
+               precache_sound (this.sound1);
+               this.noise = this.sound1;
        }
-       if (self.sound2)
+       if (this.sound2)
        {
-               precache_sound (self.sound2);
-               self.noise1 = self.sound2;
+               precache_sound (this.sound2);
+               this.noise1 = this.sound2;
        }
 
-       self.mangle = self.angles;
-       self.angles = '0 0 0';
+       this.mangle = this.angles;
+       this.angles = '0 0 0';
 
-       self.classname = "plat";
+       this.classname = "plat";
        if (!InitMovingBrushTrigger())
                return;
-       self.effects |= EF_LOWPRECISION;
-       setsize (self, self.mins , self.maxs);
+       this.effects |= EF_LOWPRECISION;
+       setsize (this, this.mins , this.maxs);
 
-       self.blocked = plat_crush;
+       this.blocked = plat_crush;
 
-       if (!self.speed)
-               self.speed = 150;
-       if (!self.lip)
-               self.lip = 16;
-       if (!self.height)
-               self.height = self.size_z - self.lip;
+       if (!this.speed) this.speed = 150;
+       if (!this.lip) this.lip = 16;
+       if (!this.height) this.height = this.size.z - this.lip;
 
-       self.pos1 = self.origin;
-       self.pos2 = self.origin;
-       self.pos2_z = self.origin_z - self.height;
+       this.pos1 = this.origin;
+       this.pos2 = this.origin;
+       this.pos2_z = this.origin.z - this.height;
 
-       self.reset = plat_reset;
-       plat_reset();
+       this.reset = plat_reset;
+       this.reset(this);
 
-       InitializeEntity(self, plat_delayedinit, INITPRIO_FINDTARGET);
+       InitializeEntity(this, plat_delayedinit, INITPRIO_FINDTARGET);
 }
 #elif defined(CSQC)
 void plat_draw(entity this)
@@ -141,63 +134,63 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
 
        if(sf & SF_TRIGGER_INIT)
        {
-               self.platmovetype_start = ReadByte();
-               self.platmovetype_turn = ReadByte();
-               self.platmovetype_end = ReadByte();
-               self.spawnflags = ReadByte();
+               this.platmovetype_start = ReadByte();
+               this.platmovetype_turn = ReadByte();
+               this.platmovetype_end = ReadByte();
+               this.spawnflags = ReadByte();
 
-               self.model = strzone(ReadString());
-               _setmodel(self, self.model);
+               this.model = strzone(ReadString());
+               _setmodel(this, this.model);
 
                trigger_common_read(true);
 
-               self.pos1_x = ReadCoord();
-               self.pos1_y = ReadCoord();
-               self.pos1_z = ReadCoord();
-               self.pos2_x = ReadCoord();
-               self.pos2_y = ReadCoord();
-               self.pos2_z = ReadCoord();
+               this.pos1_x = ReadCoord();
+               this.pos1_y = ReadCoord();
+               this.pos1_z = ReadCoord();
+               this.pos2_x = ReadCoord();
+               this.pos2_y = ReadCoord();
+               this.pos2_z = ReadCoord();
 
-               self.size_x = ReadCoord();
-               self.size_y = ReadCoord();
-               self.size_z = ReadCoord();
+               this.size_x = ReadCoord();
+               this.size_y = ReadCoord();
+               this.size_z = ReadCoord();
 
-               self.mangle_x = ReadAngle();
-               self.mangle_y = ReadAngle();
-               self.mangle_z = ReadAngle();
+               this.mangle_x = ReadAngle();
+               this.mangle_y = ReadAngle();
+               this.mangle_z = ReadAngle();
 
-               self.speed = ReadShort();
-               self.height = ReadShort();
-               self.lip = ReadByte();
-               self.state = ReadByte();
+               this.speed = ReadShort();
+               this.height = ReadShort();
+               this.lip = ReadByte();
+               this.state = ReadByte();
 
-               self.dmg = ReadShort();
+               this.dmg = ReadShort();
 
-               self.classname = "plat";
-               self.solid = SOLID_BSP;
-               self.movetype = MOVETYPE_PUSH;
-               self.drawmask = MASK_NORMAL;
-               self.draw = plat_draw;
-               self.use = plat_use;
-               self.entremove = trigger_remove_generic;
+               this.classname = "plat";
+               this.solid = SOLID_BSP;
+               this.movetype = MOVETYPE_PUSH;
+               this.drawmask = MASK_NORMAL;
+               this.draw = plat_draw;
+               this.use = plat_use;
+               this.entremove = trigger_remove_generic;
 
-               plat_reset(); // also called here
+               plat_reset(this); // also called here
 
-               self.move_movetype = MOVETYPE_PUSH;
-               self.move_origin = self.origin;
-               self.move_angles = self.angles;
-               self.move_time = time;
+               this.move_movetype = MOVETYPE_PUSH;
+               this.move_origin = this.origin;
+               this.move_angles = this.angles;
+               this.move_time = time;
 
                plat_spawn_inside_trigger();
        }
 
        if(sf & SF_TRIGGER_RESET)
        {
-               plat_reset();
+               plat_reset(this);
 
-               self.move_origin = self.origin;
-               self.move_angles = self.angles;
-               self.move_time = time;
+               this.move_origin = this.origin;
+               this.move_angles = this.angles;
+               this.move_time = time;
        }
        return true;
 }
index ef42c93eb06514c8547a9cca55b916a41d35f2a8..c3a059aa24265101871601d3cdc1a06ba9dcd33e 100644 (file)
@@ -102,57 +102,47 @@ void pointparticles_think()
        self.nextthink = time;
 }
 
-void pointparticles_reset()
-{SELFPARAM();
-       if(self.spawnflags & 1)
-               self.state = 1;
+void pointparticles_reset(entity this)
+{
+       if(this.spawnflags & 1)
+               this.state = 1;
        else
-               self.state = 0;
+               this.state = 0;
 }
 
 spawnfunc(func_pointparticles)
 {
-       if(self.model != "")
-               _setmodel(self, self.model);
-       if(self.noise != "")
-               precache_sound (self.noise);
+       if(this.model != "") _setmodel(this, this.model);
+       if(this.noise != "") precache_sound(this.noise);
 
-       if(!self.bgmscriptsustain)
-               self.bgmscriptsustain = 1;
-       else if(self.bgmscriptsustain < 0)
-               self.bgmscriptsustain = 0;
+       if(!this.bgmscriptsustain) this.bgmscriptsustain = 1;
+       else if(this.bgmscriptsustain < 0) this.bgmscriptsustain = 0;
 
-       if(!self.atten)
-               self.atten = ATTEN_NORM;
-       else if(self.atten < 0)
-               self.atten = 0;
-       if(!self.volume)
-               self.volume = 1;
-       if(!self.count)
-               self.count = 1;
-       if(!self.impulse)
-               self.impulse = 1;
+       if(!this.atten) this.atten = ATTEN_NORM;
+       else if(this.atten < 0) this.atten = 0;
+       if(!this.volume) this.volume = 1;
+       if(!this.count) this.count = 1;
+       if(!this.impulse) this.impulse = 1;
 
-       if(!self.modelindex)
+       if(!this.modelindex)
        {
-               setorigin(self, self.origin + self.mins);
-               setsize(self, '0 0 0', self.maxs - self.mins);
+               setorigin(this, this.origin + this.mins);
+               setsize(this, '0 0 0', this.maxs - this.mins);
        }
-       if(!self.cnt)
-               self.cnt = _particleeffectnum(self.mdl);
+       if(!this.cnt) this.cnt = _particleeffectnum(this.mdl);
 
-       Net_LinkEntity(self, (self.spawnflags & 4), 0, pointparticles_SendEntity);
+       Net_LinkEntity(this, (this.spawnflags & 4), 0, pointparticles_SendEntity);
 
        IFTARGETED
        {
-               self.use = pointparticles_use;
-               self.reset = pointparticles_reset;
-               self.reset();
+               this.use = pointparticles_use;
+               this.reset = pointparticles_reset;
+               this.reset(this);
        }
        else
-               self.state = 1;
-       self.think = pointparticles_think;
-       self.nextthink = time;
+               this.state = 1;
+       this.think = pointparticles_think;
+       this.nextthink = time;
 }
 
 spawnfunc(func_sparks)
index 8bfa35f40da77688d516a8e36688628e766781c6..8fe240f6f7db278d5fb322a95e67731f7f6d78e6 100644 (file)
@@ -195,67 +195,61 @@ void laser_use()
        misc_laser_aim();
 }
 
-void laser_reset()
-{SELFPARAM();
-       if(self.spawnflags & 1)
-               self.state = 1;
+void laser_reset(entity this)
+{
+       if(this.spawnflags & 1)
+               this.state = 1;
        else
-               self.state = 0;
+               this.state = 0;
 }
 
 spawnfunc(misc_laser)
 {
-       if(self.mdl)
+       if(this.mdl)
        {
-               if(self.mdl == "none")
-                       self.cnt = -1;
+               if(this.mdl == "none")
+                       this.cnt = -1;
                else
                {
-                       self.cnt = _particleeffectnum(self.mdl);
-                       if(self.cnt < 0)
-                               if(self.dmg)
-                                       self.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
+                       this.cnt = _particleeffectnum(this.mdl);
+                       if(this.cnt < 0 && this.dmg)
+                this.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
                }
        }
-       else if(!self.cnt)
+       else if(!this.cnt)
        {
-               if(self.dmg)
-                       self.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
+               if(this.dmg)
+                       this.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
                else
-                       self.cnt = -1;
+                       this.cnt = -1;
        }
-       if(self.cnt < 0)
-               self.cnt = -1;
+       if(this.cnt < 0)
+               this.cnt = -1;
 
-       if(self.colormod == '0 0 0')
-               if(!self.alpha)
-                       self.colormod = '1 0 0';
-       if(self.message == "")
-               self.message = "saw the light";
-       if (self.message2 == "")
-               self.message2 = "was pushed into a laser by";
-       if(!self.scale)
-               self.scale = 1;
-       if(!self.modelscale)
-               self.modelscale = 1;
-       else if(self.modelscale < 0)
-               self.modelscale = 0;
-       self.think = misc_laser_think;
-       self.nextthink = time;
-       InitializeEntity(self, misc_laser_init, INITPRIO_FINDTARGET);
+       if(this.colormod == '0 0 0')
+               if(!this.alpha)
+                       this.colormod = '1 0 0';
+       if(this.message == "") this.message = "saw the light";
+       if (this.message2 == "") this.message2 = "was pushed into a laser by";
+       if(!this.scale) this.scale = 1;
+       if(!this.modelscale) this.modelscale = 1;
+       else if(this.modelscale < 0) this.modelscale = 0;
+       this.think = misc_laser_think;
+       this.nextthink = time;
+       InitializeEntity(this, misc_laser_init, INITPRIO_FINDTARGET);
 
-       self.mangle = self.angles;
+       this.mangle = this.angles;
 
-       Net_LinkEntity(self, false, 0, laser_SendEntity);
+       Net_LinkEntity(this, false, 0, laser_SendEntity);
 
        IFTARGETED
        {
-               self.reset = laser_reset;
-               laser_reset();
-               self.use = laser_use;
+               this.reset = laser_reset;
+               this.reset(this);
+               this.use = laser_use;
        }
        else
-               self.state = 1;
+               this.state = 1;
 }
 #elif defined(CSQC)
 
index 1c8a8bbad45766a10538139667d0bf5061077eaa..11f0bd0024a25b407cb320659cea75114d937916 100644 (file)
@@ -185,23 +185,23 @@ void plat_use()
 
 .string sound1, sound2;
 
-void plat_reset()
-{SELFPARAM();
+void plat_reset(entity this)
+{
        IFTARGETED
        {
-               setorigin (self, self.pos1);
-               self.state = 4;
-               self.use = plat_use;
+               setorigin (this, this.pos1);
+               this.state = 4;
+               this.use = plat_use;
        }
        else
        {
-               setorigin (self, self.pos2);
-               self.state = 2;
-               self.use = plat_trigger_use;
+               setorigin (this, this.pos2);
+               this.state = 2;
+               this.use = plat_trigger_use;
        }
 
 #ifdef SVQC
-       self.SendFlags |= SF_TRIGGER_RESET;
+       this.SendFlags |= SF_TRIGGER_RESET;
 #endif
 }
 
index 95cc59904a5017710f4ff9104ddd1de7cd833f41..e3b9c2e6963c5934506f804dc739f6a37be2e956 100644 (file)
@@ -36,7 +36,6 @@
 
 #endif
 
-void SUB_Remove();
 void SUB_SetFade (entity ent, float when, float fading_time);
 void SUB_VanishOrRemove (entity ent);
 
index 283b8afb47767a1d8be8029e52c827493eb930e0..3f38914f472b9405c3ed8bae978a655531614581 100644 (file)
@@ -30,10 +30,9 @@ void target_music_sendto(float to, float is)
        WriteByte(to, self.lifetime);
        WriteString(to, self.noise);
 }
-void target_music_reset()
-{SELFPARAM();
-       if(self.targetname == "")
-               target_music_sendto(MSG_ALL, 1);
+void target_music_reset(entity this)
+{
+       if (this.targetname == "") target_music_sendto(MSG_ALL, 1);
 }
 void target_music_kill()
 {
@@ -127,10 +126,10 @@ bool trigger_music_SendEntity(entity this, entity to, float sf)
        }
        return 1;
 }
-void trigger_music_reset()
-{SELFPARAM();
-       self.cnt = !(self.spawnflags & 1);
-       self.SendFlags |= 0x80;
+void trigger_music_reset(entity this)
+{
+       this.cnt = !(this.spawnflags & 1);
+       this.SendFlags |= 0x80;
 }
 void trigger_music_use()
 {SELFPARAM();
@@ -139,21 +138,19 @@ void trigger_music_use()
 }
 spawnfunc(trigger_music)
 {
-       if(self.model != "")
-               _setmodel(self, self.model);
-       if(!self.volume)
-               self.volume = 1;
-       if(!self.modelindex)
+       if(this.model != "") _setmodel(this, this.model);
+       if(!this.volume) this.volume = 1;
+       if(!this.modelindex)
        {
-               setorigin(self, self.origin + self.mins);
-               setsize(self, '0 0 0', self.maxs - self.mins);
+               setorigin(this, this.origin + this.mins);
+               setsize(this, '0 0 0', this.maxs - this.mins);
        }
-       trigger_music_reset();
+       trigger_music_reset(this);
 
-       self.use = trigger_music_use;
-       self.reset = trigger_music_reset;
+       this.use = trigger_music_use;
+       this.reset = trigger_music_reset;
 
-       Net_LinkEntity(self, false, 0, trigger_music_SendEntity);
+       Net_LinkEntity(this, false, 0, trigger_music_SendEntity);
 }
 #elif defined(CSQC)
 
index 0b3767ff654c856a13d9e6a515dc13020c5abd4f..3c43b0e9ea590f7ed0528080d0bbaab65f80f327 100644 (file)
@@ -61,16 +61,16 @@ void target_speaker_use_off()
        sound(self, CH_TRIGGER_SINGLE, SND_Null, VOL_BASE * self.volume, self.atten);
        self.use = target_speaker_use_on;
 }
-void target_speaker_reset()
-{SELFPARAM();
-       if(self.spawnflags & 1) // LOOPED_ON
+void target_speaker_reset(entity this)
+{
+       if(this.spawnflags & 1) // LOOPED_ON
        {
-               if(self.use == target_speaker_use_on)
+               if(this.use == target_speaker_use_on)
                        target_speaker_use_on();
        }
-       else if(self.spawnflags & 2)
+       else if(this.spawnflags & 2)
        {
-               if(self.use == target_speaker_use_off)
+               if(this.use == target_speaker_use_off)
                        target_speaker_use_off();
        }
 }
index 41f9f79ecc4d245d8c1f7790158a9efc11cfeb26..d5811e479ed2bec89677d1d0bde1634ae28acfbf 100644 (file)
@@ -23,10 +23,10 @@ void counter_use()
        }
 }
 
-void counter_reset()
-{SELFPARAM();
-       self.count = self.cnt;
-       multi_reset();
+void counter_reset(entity this)
+{
+       this.count = this.cnt;
+       multi_reset(this);
 }
 
 /*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage
index eb0c0af7754a252ce0ef5ac301f220314f345f34..fb341ebb77a124bb543dab8e2871dca5f0d7ede8 100644 (file)
@@ -5,10 +5,10 @@ void delay_use()
    self.nextthink = self.wait;
 }
 
-void delay_reset()
-{SELFPARAM();
-       self.think = func_null;
-       self.nextthink = 0;
+void delay_reset(entity this)
+{
+       this.think = func_null;
+       this.nextthink = 0;
 }
 
 spawnfunc(trigger_delay)
index e039173fb01ea752cbfae4361181cb65895282c4..d2549f6c506b228500974313e3f13f5bab397597 100644 (file)
@@ -9,14 +9,12 @@ void flipflop_use()
         SUB_UseTargets();
 }
 
-void _spawnfunc_trigger_flipflop();
 spawnfunc(trigger_flipflop)
 {
-    if(self.spawnflags & 1)
-        self.state = 1;
-    self.use = flipflop_use;
-    self.reset = _spawnfunc_trigger_flipflop; // perfect resetter
+    if(this.spawnflags & 1)
+        this.state = 1;
+    this.use = flipflop_use;
+    this.reset = spawnfunc_trigger_flipflop; // perfect resetter
 }
-void _spawnfunc_trigger_flipflop() { SELFPARAM(); spawnfunc_trigger_flipflop(this); }
 
 #endif
index 30e6ebae7015e6a25af19d7f8b82335b6571cec4..d90e3418caab154454fbafeb36a6c350827bd177 100644 (file)
@@ -6,20 +6,20 @@ void gamestart_use()
        remove(self);
 }
 
-void _spawnfunc_trigger_gamestart();
+void self_spawnfunc_trigger_gamestart();
 spawnfunc(trigger_gamestart)
 {
-       self.use = gamestart_use;
-       self.reset2 = _spawnfunc_trigger_gamestart;
+       this.use = gamestart_use;
+       this.reset2 = self_spawnfunc_trigger_gamestart;
 
-       if(self.wait)
+       if(this.wait)
        {
-               self.think = self.use;
-               self.nextthink = game_starttime + self.wait;
+               this.think = this.use;
+               this.nextthink = game_starttime + this.wait;
        }
        else
-               InitializeEntity(self, gamestart_use, INITPRIO_FINDTARGET);
+               InitializeEntity(this, gamestart_use, INITPRIO_FINDTARGET);
 }
-void _spawnfunc_trigger_gamestart() { SELFPARAM(); spawnfunc_trigger_gamestart(this); }
+void self_spawnfunc_trigger_gamestart() { SELFPARAM(); spawnfunc_trigger_gamestart(this); }
 
 #endif
index 0b3be0056de03bb8dafd15683d77eb73b919d38d..c124a064531f71cb131cda502b977b8c1db2150c 100644 (file)
@@ -131,7 +131,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 
 void trigger_push_touch()
 {SELFPARAM();
-       if (self.active == ACTIVE_NOT)
+       if (this.active == ACTIVE_NOT)
                return;
 
 #ifdef SVQC
@@ -139,34 +139,34 @@ void trigger_push_touch()
                return;
 #endif
 
-       if(self.team)
-               if(((self.spawnflags & 4) == 0) == (DIFF_TEAM(self, other)))
+       if(this.team)
+               if(((this.spawnflags & 4) == 0) == (DIFF_TEAM(this, other)))
                        return;
 
        EXACTTRIGGER_TOUCH;
 
-       if(self.enemy)
+       if(this.enemy)
        {
-               other.velocity = trigger_push_calculatevelocity(other.origin, self.enemy, self.height);
+               other.velocity = trigger_push_calculatevelocity(other.origin, this.enemy, this.height);
                other.move_velocity = other.velocity;
        }
-       else if(self.target)
+       else if(this.target)
        {
                entity e;
                RandomSelection_Init();
-               for(e = world; (e = find(e, targetname, self.target)); )
+               for(e = world; (e = find(e, targetname, this.target)); )
                {
                        if(e.cnt)
                                RandomSelection_Add(e, 0, string_null, e.cnt, 1);
                        else
                                RandomSelection_Add(e, 0, string_null, 1, 1);
                }
-               other.velocity = trigger_push_calculatevelocity(other.origin, RandomSelection_chosen_ent, self.height);
+               other.velocity = trigger_push_calculatevelocity(other.origin, RandomSelection_chosen_ent, this.height);
                other.move_velocity = other.velocity;
        }
        else
        {
-               other.velocity = self.movedir;
+               other.velocity = this.movedir;
                other.move_velocity = other.velocity;
        }
 
@@ -180,29 +180,29 @@ void trigger_push_touch()
                // reset tracking of oldvelocity for impact damage (sudden velocity changes)
                other.oldvelocity = other.velocity;
 
-               if(self.pushltime < time)  // prevent "snorring" sound when a player hits the jumppad more than once
+               if(this.pushltime < time)  // prevent "snorring" sound when a player hits the jumppad more than once
                {
                        // flash when activated
                        Send_Effect(EFFECT_JUMPPAD, other.origin, other.velocity, 1);
-                       _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
-                       self.pushltime = time + 0.2;
+                       _sound (other, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
+                       this.pushltime = time + 0.2;
                }
                if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
                {
                        bool found = false;
                        for(int i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
-                               if(other.(jumppadsused[i]) == self)
+                               if(other.(jumppadsused[i]) == this)
                                        found = true;
                        if(!found)
                        {
-                               other.(jumppadsused[other.jumppadcount % NUM_JUMPPADSUSED]) = self;
+                               other.(jumppadsused[other.jumppadcount % NUM_JUMPPADSUSED]) = this;
                                other.jumppadcount = other.jumppadcount + 1;
                        }
 
                        if(IS_REAL_CLIENT(other))
                        {
-                               if(self.message)
-                                       centerprint(other, self.message);
+                               if(this.message)
+                                       centerprint(other, this.message);
                        }
                        else
                                other.lastteleporttime = time;
@@ -218,10 +218,10 @@ void trigger_push_touch()
                other.istypefrag = 0;
        }
 
-       if(self.enemy.target)
+       if(this.enemy.target)
        {
                activator = other;
-               WITH(entity, self, self.enemy, SUB_UseTargets());
+               WITH(entity, self, this.enemy, SUB_UseTargets());
        }
 
        if (other.flags & FL_PROJECTILE)
@@ -241,11 +241,11 @@ void trigger_push_touch()
                UpdateCSQCProjectile(other);
        }
 
-       if (self.spawnflags & PUSH_ONCE)
+       if (this.spawnflags & PUSH_ONCE)
        {
-               self.touch = func_null;
-               self.think = SUB_Remove;
-               self.nextthink = time;
+               this.touch = func_null;
+               this.think = SUB_Remove_self;
+               this.nextthink = time;
        }
 #endif
 }
index d81f6e371958c9d3b8680567cf6817af849eefe7..26975ab6d144885ff60efb777e6fe2f727b0e5bf 100644 (file)
@@ -28,10 +28,10 @@ void monoflop_think()
        SUB_UseTargets();
 }
 
-void monoflop_reset()
-{SELFPARAM();
-       self.state = 0;
-       self.nextthink = 0;
+void monoflop_reset(entity this)
+{
+       this.state = 0;
+       this.nextthink = 0;
 }
 
 spawnfunc(trigger_monoflop)
index 91bfc99834b2953611707678ab25268269f3244e..fd3917d33be3fec7fa623f27b18c0066d4dca30a 100644 (file)
@@ -115,19 +115,19 @@ void multi_eventdamage (entity inflictor, entity attacker, float damage, int dea
        }
 }
 
-void multi_reset()
-{SELFPARAM();
-       if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) )
-               self.touch = multi_touch;
-       if (self.max_health)
+void multi_reset(entity this)
+{
+       if ( !(this.spawnflags & SPAWNFLAG_NOTOUCH) )
+               this.touch = multi_touch;
+       if (this.max_health)
        {
-               self.health = self.max_health;
-               self.takedamage = DAMAGE_YES;
-               self.solid = SOLID_BBOX;
+               this.health = this.max_health;
+               this.takedamage = DAMAGE_YES;
+               this.solid = SOLID_BBOX;
        }
-       self.think = func_null;
-       self.nextthink = 0;
-       self.team = self.team_saved;
+       this.think = func_null;
+       this.nextthink = 0;
+       this.team = this.team_saved;
 }
 
 /*QUAKED spawnfunc_trigger_multiple (.5 .5 .5) ? notouch
index 5e72a96a2fe478d74523c3c53183524b873dda27..32a3c3131e6000f6690d2dcd7461700154b4eb76 100644 (file)
@@ -1,6 +1,6 @@
 #ifdef SVQC
 void multi_trigger();
-void multi_reset();
+void multi_reset(entity this);
 
 spawnfunc(trigger_once);
 #endif
index 178daad90e06b78904abc187d5e60f3f3aeda720..1df446ba32ee4345a936fc0512c98eb5aa191a65 100644 (file)
@@ -1,12 +1,10 @@
 #ifdef SVQC
-void _spawnfunc_trigger_relay();
 /*QUAKED spawnfunc_trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8)
 This fixed size trigger cannot be touched, it can only be fired by other events.  It can contain killtargets, targets, delays, and messages.
 */
 spawnfunc(trigger_relay)
 {
-       self.use = SUB_UseTargets;
-       self.reset = _spawnfunc_trigger_relay; // this spawnfunc resets fully
+       this.use = SUB_UseTargets;
+       this.reset = spawnfunc_trigger_relay; // this spawnfunc resets fully
 }
-void _spawnfunc_trigger_relay() { SELFPARAM(); spawnfunc_trigger_relay(this); }
 #endif
index ab2b87aaa0da62276a72ed52f0cc74e81a119d1d..193dba36825fe8ce1aefc43b06948c9d1a223277 100644 (file)
@@ -21,15 +21,15 @@ void trigger_relay_teamcheck_use()
        }
 }
 
-void trigger_relay_teamcheck_reset()
-{SELFPARAM();
-       self.team = self.team_saved;
+void trigger_relay_teamcheck_reset(entity this)
+{
+       this.team = this.team_saved;
 }
 
 spawnfunc(trigger_relay_teamcheck)
 {
-       self.team_saved = self.team;
-       self.use = trigger_relay_teamcheck_use;
-       self.reset = trigger_relay_teamcheck_reset;
+       this.team_saved = this.team;
+       this.use = trigger_relay_teamcheck_use;
+       this.reset = trigger_relay_teamcheck_reset;
 }
 #endif
index b0667c89afb0146084749acbfd4e5ba105dbe099..c56ba66e968a67c36ffe34e4b68884cd05c4f999 100644 (file)
@@ -204,7 +204,6 @@ void FireImoBeam (vector start, vector end, vector smin, vector smax,
 }
 
 #ifdef TURRET_DEBUG
-void SUB_Remove();
 void marker_think()
 {SELFPARAM();
        if(self.cnt)
index 7f0537eeb502583fdcdd16ab8ebb74e423e9a359..0068a51e247f1222a06c65fea089e36d02222b8e 100644 (file)
@@ -274,7 +274,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound,
        proj.use                          = vehicles_projectile_explode;
        proj.owner                      = self;
        proj.realowner          = _owner;
-       proj.think                      = SUB_Remove;
+       proj.think                      = SUB_Remove_self;
        proj.nextthink          = time + 30;
 
        if(_health)
@@ -460,7 +460,7 @@ void vehicles_clearreturn(entity veh)
                if(ret.wp00 == veh)
                {
                        ret.classname   = "";
-                       ret.think          = SUB_Remove;
+                       ret.think          = SUB_Remove_self;
                        ret.nextthink   = time + 0.1;
 
                        if(ret.waypointsprite_attached)
index 055293e930b990ef0fee44d662536ffa5a92112e..23ea7e1c8cb1d2c2d9739eb9495b6272fc8f32af 100644 (file)
@@ -77,10 +77,10 @@ void W_Blaster_Touch()
 
 void W_Blaster_Think()
 {SELFPARAM();
-       self.movetype = MOVETYPE_FLY;
-       self.think = SUB_Remove;
-       self.nextthink = time + self.blaster_lifetime;
-       CSQCProjectile(self, true, PROJECTILE_BLASTER, true);
+       this.movetype = MOVETYPE_FLY;
+       this.think = SUB_Remove_self;
+       this.nextthink = time + this.blaster_lifetime;
+       CSQCProjectile(this, true, PROJECTILE_BLASTER, true);
 }
 
 void W_Blaster_Attack(
index 252cc56dc80929c2d935b0db16697b515f3339ce..209bd2dd0e62f43754cd88272dc27f151df13a72 100644 (file)
@@ -108,10 +108,10 @@ void W_Crylink_Dequeue(entity e)
        W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
 }
 
-void W_Crylink_Reset()
-{SELFPARAM();
-       W_Crylink_Dequeue(self);
-       remove(self);
+void W_Crylink_Reset(entity this)
+{
+       W_Crylink_Dequeue(this);
+       remove(this);
 }
 
 // force projectile to explode
index 9c4d8b2a66e86923de98617f0d3d6280941bd732..252cc96e34988c5c1698f864d4eb2a0a197e98f8 100644 (file)
@@ -103,7 +103,7 @@ void W_HLAC_Attack(Weapon thiswep)
        //missile.angles = vectoangles(missile.velocity); // csqc
 
        missile.touch = W_HLAC_Touch;
-       missile.think = SUB_Remove;
+       missile.think = SUB_Remove_self;
 
     missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
 
@@ -145,7 +145,7 @@ void W_HLAC_Attack2()
        //missile.angles = vectoangles(missile.velocity); // csqc
 
        missile.touch = W_HLAC_Touch;
-       missile.think = SUB_Remove;
+       missile.think = SUB_Remove_self;
 
     missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
 
index 4679ef38f747cbb287fb73388bd09583ae59b97a..553381818394bf4df9b27d9539a13c7b3830efc4 100644 (file)
@@ -71,16 +71,16 @@ spawnfunc(weapon_uzi) { spawnfunc_weapon_machinegun(this); }
 
 void W_MachineGun_MuzzleFlash_Think()
 {SELFPARAM();
-       self.frame = self.frame + 2;
-       self.scale = self.scale * 0.5;
-       self.alpha = self.alpha - 0.25;
-       self.nextthink = time + 0.05;
+       this.frame += 2;
+       this.scale *= 0.5;
+       this.alpha -= 0.25;
+       this.nextthink = time + 0.05;
 
-       if(self.alpha <= 0)
+       if(this.alpha <= 0)
        {
-               self.think = SUB_Remove;
-               self.nextthink = time;
-               self.realowner.muzzle_flash = world;
+               this.think = SUB_Remove_self;
+               this.nextthink = time;
+               this.realowner.muzzle_flash = world;
                return;
        }
 
index faf20a4fb9a05095957e48a84a52545042d2b5b7..533b7c944acfaa58fbe7ec437a75ecdb65280bcb 100644 (file)
@@ -565,7 +565,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep)
        missile.bot_dodge       = true;
        missile.bot_dodgerating = 50;
        missile.touch           = W_Seeker_Tag_Touch;
-       missile.think           = SUB_Remove;
+       missile.think           = SUB_Remove_self;
        missile.nextthink       = time + WEP_CVAR(seeker, tag_lifetime);
        missile.movetype        = MOVETYPE_FLY;
        missile.solid           = SOLID_BBOX;
index e7ad8b042027e6df03f0567e283d421a32ea6838..3ac26958ad00d82e946a76218d4367a32a207b25 100644 (file)
@@ -77,7 +77,7 @@ void W_Shotgun_Attack(Weapon thiswep, float isprimary)
        // muzzle flash for 1st person view
        flash = spawn();
        setmodel(flash, MDL_SHOTGUN_MUZZLEFLASH); // precision set below
-       flash.think = SUB_Remove;
+       flash.think = SUB_Remove_self;
        flash.nextthink = time + 0.06;
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        W_AttachToShotorg(self, flash, '5 0 0');
index dc449d35d0ae8d58a11f4f07d2d28e40eb2c0f70..8059f3272bcfddc8112579e22bc8ccd32f7de7fc 100644 (file)
@@ -125,7 +125,7 @@ void VaporizerBeam_Draw(entity this)
 NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
 {
        Net_Accept(vortex_beam);
-       this.think = SUB_Remove;
+       this.think = SUB_Remove_self;
        this.nextthink = time + bound(0, autocvar_cl_vaporizerbeam_lifetime, 10);
        this.draw = VaporizerBeam_Draw;
        this.drawmask = MASK_NORMAL;
index 6f9c9d637ff3a927faae655e701e09d7c73d22a9..b9bcec58e60c6df31679667ea4a7ded1397333b5 100644 (file)
@@ -29,6 +29,4 @@
 
 #pragma noref 0
 
-#define ReadFloat() ReadCoord()
-
 #endif
index 5a93a2444c472d555b643fa18a601b4b0b8e76b4..535c3b6f7c3504e8ba3113a385ec7e489bcb29fa 100644 (file)
@@ -23,6 +23,4 @@
 
 #pragma noref 0
 
-#define WriteFloat(to, f) WriteCoord(to, f)
-
 #endif
index 749e4a665ec882a23f2e247551fbdc91f7c5f404..0fa29747543a8aa0da3fd74935e7dfd1a5971b0c 100644 (file)
        class(Defer).void() think;
        class(Defer).float nextthink;
 
-/*
-==================
-SUB_Remove
+       /** Remove self */
+       void SUB_Remove(entity this)
+       {
+               remove(this);
+       }
 
-Remove self
-==================
-*/
-       void SUB_Remove()
+       /** Remove self */
+       void SUB_Remove_self()
        {
                SELFPARAM();
-               remove(self);
+               remove(this);
        }
 
        void defer_think()
        {
                SELFPARAM();
-               self.think     = SUB_Remove;
+               self.think     = SUB_Remove_self;
                self.nextthink = time;
                WITH(entity, self, self.owner, self.use());
        }
index d71c2639fb1997a24975d11ce86869a612e0542c..aee2a363765d50bb7f52629b6af65d161f4c10ac 100644 (file)
@@ -2,18 +2,17 @@
 #define MAP_H
 
 // Databases (hash tables)
-const float DB_BUCKETS = 8192;
-void db_save(float db, string pFilename)
+const int DB_BUCKETS = 8192;
+void db_save(int db, string filename)
 {
-       int fh = fopen(pFilename, FILE_WRITE);
+       int fh = fopen(filename, FILE_WRITE);
        if (fh < 0)
        {
-               LOG_INFO(strcat("^1Can't write DB to ", pFilename));
+               LOG_WARNINGF("^1Can't write DB to %s\n", filename);
                return;
        }
-       int n = buf_getsize(db);
        fputs(fh, strcat(ftos(DB_BUCKETS), "\n"));
-       for (int i = 0; i < n; ++i)
+       for (int i = 0, n = buf_getsize(db); i < n; ++i)
                fputs(fh, strcat(bufstr_get(db, i), "\n"));
        fclose(fh);
 }
@@ -23,16 +22,16 @@ int db_create()
        return buf_create();
 }
 
-void db_put(float db, string pKey, string pValue);
+void db_put(int db, string key, string value);
 
-int db_load(string pFilename)
+int db_load(string filename)
 {
        int db = buf_create();
        if (db < 0) return -1;
-       int fh = fopen(pFilename, FILE_READ);
+       int fh = fopen(filename, FILE_READ);
        if (fh < 0) return db;
        string l = fgets(fh);
-       if (stof(l) == DB_BUCKETS)
+       if (stoi(l) == DB_BUCKETS)
        {
                for (int i = 0; (l = fgets(fh)); ++i)
                {
@@ -58,13 +57,12 @@ int db_load(string pFilename)
        return db;
 }
 
-void db_dump(float db, string pFilename)
+void db_dump(int db, string filename)
 {
-       int fh = fopen(pFilename, FILE_WRITE);
-       if (fh < 0) error(strcat("Can't dump DB to ", pFilename));
-       int n = buf_getsize(db);
+       int fh = fopen(filename, FILE_WRITE);
+       if (fh < 0) LOG_FATALF("Can't dump DB to %s\n");
        fputs(fh, "0\n");
-       for (int i = 0; i < n; ++i)
+       for (int i = 0, n = buf_getsize(db); i < n; ++i)
        {
                int m = tokenizebyseparator(bufstr_get(db, i), "\\");
                for (int j = 2; j < m; j += 2)
@@ -73,21 +71,23 @@ void db_dump(float db, string pFilename)
        fclose(fh);
 }
 
-void db_close(float db)
+void db_close(int db)
 {
        buf_del(db);
 }
 
-string db_get(float db, string pKey)
+string db_get(int db, string key)
 {
-       int h = crc16(false, pKey) % DB_BUCKETS;
-       return uri_unescape(infoget(bufstr_get(db, h), pKey));
+       int h = crc16(false, key) % DB_BUCKETS;
+       return uri_unescape(infoget(bufstr_get(db, h), key));
 }
 
-void db_put(float db, string pKey, string pValue)
+#define db_remove(db, key) db_put(db, key, "")
+
+void db_put(int db, string key, string value)
 {
-       int h = crc16(false, pKey) % DB_BUCKETS;
-       bufstr_set(db, h, infoadd(bufstr_get(db, h), pKey, uri_escape(pValue)));
+       int h = crc16(false, key) % DB_BUCKETS;
+       bufstr_set(db, h, infoadd(bufstr_get(db, h), key, uri_escape(value)));
 }
 
 void db_test()
index bbe8f327640a7259ba117ada1c7fd207a0f57d9c..7a43a49ebf630029d5b2196ee4fe0c71b36f985c 100644 (file)
@@ -30,7 +30,7 @@
                if (dt)
                {
                        e.nextthink = time + dt;
-                       e.think = SUB_Remove;
+                       e.think = SUB_Remove_self;
                }
        }
 
 REGISTRY(LinkedEntities, BITS(8) - 1)
 #define LinkedEntities_from(i) _LinkedEntities_from(i, NULL)
 REGISTER_REGISTRY(LinkedEntities)
-REGISTRY_SORT(LinkedEntities, 0)
+REGISTRY_SORT(LinkedEntities)
 REGISTRY_CHECK(LinkedEntities)
 STATIC_INIT(RegisterLinkedEntities_renumber)
 {
@@ -142,7 +142,7 @@ STATIC_INIT(RegisterLinkedEntities_renumber)
 REGISTRY(TempEntities, BITS(8) - 80)
 #define TempEntities_from(i) _TempEntities_from(i, NULL)
 REGISTER_REGISTRY(TempEntities)
-REGISTRY_SORT(TempEntities, 0)
+REGISTRY_SORT(TempEntities)
 REGISTRY_CHECK(TempEntities)
 STATIC_INIT(RegisterTempEntities_renumber)
 {
@@ -185,6 +185,10 @@ STATIC_INIT(RegisterTempEntities_renumber)
                        return v;
                }
 
+               #define ReadFloat() ReadCoord()
+        vector ReadVector() { vector v; v.x = ReadFloat(); v_y = ReadFloat(); v.z = ReadFloat(); return v; }
+               vector ReadVector2D() { vector v; v.x = ReadFloat(); v.y = ReadFloat(); v.z = 0; return v; }
+
                float ReadApproxPastTime()
                {
                        float dt = ReadByte();
@@ -216,6 +220,10 @@ STATIC_INIT(RegisterTempEntities_renumber)
                        WriteInt24_t(dst, val.z);
                }
 
+        #define WriteFloat(to, f) WriteCoord(to, f)
+               #define WriteVector(to, v) do { WriteFloat(to, v.x); WriteFloat(to, v.y); WriteFloat(to, v.z); } while (0)
+        #define WriteVector2D(to, v) do { WriteFloat(to, v.x); WriteFloat(to, v.y); } while (0)
+
                // this will use the value:
                //   128
                // accuracy near zero is APPROXPASTTIME_MAX/(256*255)
index 52ab23377454bb92dfe75708ace67d428eac92e5..16d35b0dd3e2b8bec4e1cce0a3feb70d565e71d0 100644 (file)
@@ -39,14 +39,16 @@ REGISTRY(Registries, BITS(8))
  * @param fld       The field to store the locally unique unique entity id
  * @param inst      An expression to create a new instance, invoked for every registration
  */
-#define REGISTER(registry, ns, id, fld, inst) \
-       entity ns##_##id; \
-       REGISTER_INIT(ns, id) {} \
-       REGISTER_INIT_POST(ns, id) {} \
-       void Register_##ns##_##id() \
+#define REGISTER(...) EVAL(OVERLOAD(REGISTER, __VA_ARGS__))
+#define REGISTER_5(registry, ns, id, fld, inst) REGISTER_4(registry, ns##_##id, fld, inst)
+#define REGISTER_4(registry, id, fld, inst) \
+       entity id; \
+       REGISTER_INIT(id) {} \
+       REGISTER_INIT_POST(id) {} \
+       void Register_##id() \
        { \
                if (registry##_COUNT >= registry##_MAX) LOG_FATALF("Registry capacity exceeded (%s)", ftos(registry##_MAX)); \
-               entity this = ns##_##id = inst; \
+               entity this = id = inst; \
                this.registered_id = #id; \
                this.fld = registry##_COUNT; \
                _##registry[registry##_COUNT] = this; \
@@ -54,20 +56,22 @@ REGISTRY(Registries, BITS(8))
                if (!registry##_first) registry##_first = this; \
                if (registry##_last)   registry##_last.REGISTRY_NEXT = this; \
                registry##_last = this; \
-               Register_##ns##_##id##_init(this); \
-               Register_##ns##_##id##_init_post(this); \
+               Register_##id##_init(this); \
+               Register_##id##_init_post(this); \
        } \
-       ACCUMULATE_FUNCTION(Register##registry, Register_##ns##_##id) \
-       REGISTER_INIT(ns, id)
+       ACCUMULATE_FUNCTION(Register##registry, Register_##id) \
+       REGISTER_INIT(id)
 
-#define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
-#define REGISTER_INIT_POST(ns, id) [[accumulate]] void Register_##ns##_##id##_init_post(entity this)
+#define REGISTER_INIT(id) [[accumulate]] void Register_##id##_init(entity this)
+#define REGISTER_INIT_POST(id) [[accumulate]] void Register_##id##_init_post(entity this)
 
 /** internal next pointer */
 #define REGISTRY_NEXT enemy
 .entity REGISTRY_NEXT;
 
-#define REGISTRY_SORT(id, skip) \
+#define REGISTRY_SORT(...) EVAL(OVERLOAD(REGISTRY_SORT, __VA_ARGS__))
+#define REGISTRY_SORT_1(id) REGISTRY_SORT_2(id, 0)
+#define REGISTRY_SORT_2(id, skip) \
        void _REGISTRY_SWAP_##id(int i, int j, entity pass) \
        { \
                i += skip; j += skip; \
index 8a17854cb924af606baaaf77ffe7efdb477019ad..75f56a23d01fbaafb70140067e53088670b5748a 100644 (file)
@@ -28,9 +28,12 @@ noref bool require_spawnfunc_prefix;
        #define _spawnfunc_check(fld) \
                if (fieldname == #fld) continue;
 
-               #define spawnfunc_1(id, whitelist) spawnfunc_2(id, whitelist)
+       bool __spawnfunc_unreachable_workaround = true;
+
+       #define spawnfunc_1(id) spawnfunc_2(id, FIELDS_UNION)
        #define spawnfunc_2(id, whitelist) \
-               void spawnfunc_##id(entity this) \
+               void __spawnfunc_##id(entity this); \
+               [[accumulate]] void spawnfunc_##id(entity this) \
                { \
                        this = self; \
                        if (!this.sourceLocFile) \
@@ -53,8 +56,10 @@ noref bool require_spawnfunc_prefix;
                                } \
                                this.spawnfunc_checked = true; \
                        } \
+                       __spawnfunc_##id(this); \
+                       if (__spawnfunc_unreachable_workaround) return; \
                } \
-               [[accumulate]] void spawnfunc_##id(entity this)
+               void __spawnfunc_##id(entity this)
 
        #define FIELD_SCALAR(fld, n) \
                fld(n)
@@ -176,6 +181,6 @@ noref bool require_spawnfunc_prefix;
                FIELD_VEC(fld, velocity) \
                /**/
 
-       #define spawnfunc(...) EVAL(OVERLOAD(spawnfunc, __VA_ARGS__, FIELDS_UNION))
+       #define spawnfunc(...) EVAL(OVERLOAD(spawnfunc, __VA_ARGS__))
 
 #endif
index 7dd2706fd240c798e8dff885bd916f122222335f..12dc425cd356e876a78e3406d4cb58126a6ea4d8 100644 (file)
@@ -59,7 +59,7 @@ const int STATS_ENGINE_RESERVE = 32 + (8 * 3); // Not sure how to handle vector
 
 REGISTRY(Stats, 220 - STATS_ENGINE_RESERVE)
 REGISTER_REGISTRY(Stats)
-REGISTRY_SORT(Stats, 0)
+REGISTRY_SORT(Stats)
 REGISTRY_CHECK(Stats)
 STATIC_INIT(RegisterStats_renumber)
 {
index 27640770a1b5ea1ff88a9fbb58b43dd0fd669d86..0cd85cba62241a7080ce2fa54786c272c2444894 100644 (file)
@@ -142,7 +142,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
                ts.SendEntity = WarpZone_Teleported_Send;
                ts.SendFlags = 0xFFFFFF;
                ts.drawonlytoclient = player;
-               ts.think = SUB_Remove;
+               ts.think = SUB_Remove_self;
                ts.nextthink = time + 1;
                ts.owner = player;
                ts.enemy = wz;
index f065e34b18071f8173c567469ab6a83586782f8c..e3220f57d9d49c392d8f6a8fa036bb1fb24091c0 100644 (file)
                save = draw_alpha;
                if (me.disabled) draw_alpha *= me.disabledAlpha;
                draw_ButtonPicture('0 0 0', strcat(me.src, "_s"), eX * (1 - me.textSpace) + eY, me.color2, 1);
+               if (me.valueMax > me.valueMin) // valid?
                if (almost_in_bounds(me.valueMin, me.sliderValue, me.valueMax))
                {
                        controlLeft = (me.sliderValue - me.valueMin) / (me.valueMax - me.valueMin) * (1 - me.textSpace - me.controlWidth);
                                me.sliderAnim = NULL;
                        }
 
-               me.setText(me, me.valueToText(me, me.value));
+               if (me.valueMax > me.valueMin) // valid?
+                       me.setText(me, me.valueToText(me, me.value));
                draw_alpha = save;
                SUPER(Slider).draw(me);
                me.text = string_null;  // TEMPSTRING!
index eeab84e363b4cf4098b9635f2c972c3edeee71fb..f165d992381c1df1b52767a132e5de513fed9925 100644 (file)
@@ -21,37 +21,47 @@ entity makeXonoticServerCreateTab();
 
 #ifdef IMPLEMENTATION
 
-void GameType_ConfigureSliders(entity e, entity l, string pLabel, float pMin, float pMax, float pStep, string pCvar, string theTooltip)
+void GameType_ConfigureSliders(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip)
 {
-       if(pCvar == "")
+       int i;
+       entity e = me.sliderFraglimit;
+       entity l = me.labelFraglimit;
+       e.configureXonoticTextSlider(e, pCvar, pTooltip);
+       e.disabled = l.disabled = !pCvar;
+       l.setText(l, pLabel);
+
+       // clear old values
+       for(i = 0; i < e.nValues; ++i);
        {
-               e.configureXonoticTextSlider(e, string_null, string_null);
-               l.setText(l, pLabel);
-               e.disabled = l.disabled = true;
-       }
-       else
-       {
-               e.configureXonoticTextSlider(e, pCvar, theTooltip);
-
-               // clear old values
-               int i;
-               for(i = 0; i <= e.nValues; ++i);
+               if(e.(valueStrings[i]))
+               {
+                       strunzone(e.(valueStrings[i]));
+                       e.(valueStrings[i]) = string_null;
+               }
+               if(e.(valueIdentifiers[i]))
                {
-                       if(e.(valueStrings[i])) { strunzone(e.(valueStrings[i])); }
-                       if(e.(valueIdentifiers[i])) { strunzone(e.(valueIdentifiers[i])); }
+                       strunzone(e.(valueIdentifiers[i]));
+                       e.(valueIdentifiers[i]) = string_null;
                }
-               e.clearValues(e);
+       }
+       e.clearValues(e);
 
+       if(pCvar != "")
+       {
                // set new values
                e.addValue(e, strzone(_("Default")), strzone("-1"));
                for(i = pMin; i <= pMax; i += pStep) { e.addValue(e, strzone(ftos(i)), strzone(ftos(i))); }
                e.addValue(e, strzone(_("Unlimited")), strzone("0"));
-               e.configureXonoticTextSliderValues(e);
-
-               // set text field
-               l.setText(l, pLabel);
-               e.disabled = l.disabled = false;
        }
+       e.configureXonoticTextSliderValues(e);
+
+
+       entity t = me.sliderTeams;
+       entity tl = me.labelTeams;
+       t.configureXonoticTextSlider(t, tCvar, string_null);
+       tl.disabled = t.disabled = !tCvar;
+       t.nValues = (tCvar == "") ? 0 : 4; // instead of clearing / readding the very same values
+       t.configureXonoticTextSliderValues(t);
 }
 
 entity makeXonoticServerCreateTab()
@@ -212,45 +222,24 @@ void XonoticServerCreateTab_fill(entity me)
 
 void XonoticServerCreateTab_gameTypeChangeNotify(entity me)
 {
-       // tell the map list to update
-       float gt;
-       entity e, l;
-       gt = MapInfo_CurrentGametype();
-       e = me.sliderFraglimit;
-       l = me.labelFraglimit;
-
-       switch(gt)
+       switch(MapInfo_CurrentGametype())
        {
-               case MAPINFO_TYPE_CTF:            GameType_ConfigureSliders(e, l, _("Capture limit:"),   1,   20, 1,  "capturelimit_override", string_null); break;
-               case MAPINFO_TYPE_DOMINATION:     GameType_ConfigureSliders(e, l, _("Point limit:"),    50,  500, 10, "g_domination_point_limit", string_null); break;
-               case MAPINFO_TYPE_KEYHUNT:        GameType_ConfigureSliders(e, l, _("Point limit:"),   200, 1500, 50, "g_keyhunt_point_limit", string_null); break;
-               case MAPINFO_TYPE_LMS:            GameType_ConfigureSliders(e, l, _("Lives:"),           3,   50,  1, "g_lms_lives_override", string_null); break;
-               case MAPINFO_TYPE_RACE:           GameType_ConfigureSliders(e, l, _("Laps:"),            1,   25,  1, "g_race_laps_limit", string_null); break;
-               case MAPINFO_TYPE_NEXBALL:        GameType_ConfigureSliders(e, l, _("Goals:"),           1,   50,  1, "g_nexball_goallimit", string_null); break;
-               case MAPINFO_TYPE_ASSAULT:        GameType_ConfigureSliders(e, l, _("Point limit:"),    50,  500, 10, "", string_null); break;
-               case MAPINFO_TYPE_ONSLAUGHT:      GameType_ConfigureSliders(e, l, _("Point limit:"),    50,  500, 10, "", string_null); break;
-               case MAPINFO_TYPE_CTS:            GameType_ConfigureSliders(e, l, _("Point limit:"),    50,  500, 10, "", string_null); break;
-               case MAPINFO_TYPE_INVASION:       GameType_ConfigureSliders(e, l, _("Point limit:"),     5,    0,  5, "", string_null); break;
-               case MAPINFO_TYPE_TEAM_DEATHMATCH:GameType_ConfigureSliders(e, l, _("Point limit:"),     5,  100,  5, "g_tdm_point_limit", string_null); break;
-               default:                          GameType_ConfigureSliders(e, l, _("Frag limit:"),      5,  100,  5, "fraglimit_override", _("The amount of frags needed before the match will end")); break;
+               case MAPINFO_TYPE_CA:              GameType_ConfigureSliders(me, _("Frag limit:"),      5,  100,  5, "fraglimit_override",        "g_ca_teams_override",          _("The amount of frags needed before the match will end")); break;
+               case MAPINFO_TYPE_FREEZETAG:       GameType_ConfigureSliders(me, _("Frag limit:"),      5,  100,  5, "fraglimit_override",        "g_freezetag_teams_override",   _("The amount of frags needed before the match will end")); break;
+               case MAPINFO_TYPE_CTF:             GameType_ConfigureSliders(me, _("Capture limit:"),   1,   20,  1, "capturelimit_override",     string_null,                    _("The amount of captures needed before the match will end")); break;
+               case MAPINFO_TYPE_DOMINATION:      GameType_ConfigureSliders(me, _("Point limit:"),    50,  500, 10, "g_domination_point_limit",  "g_domination_teams_override",  _("The amount of points needed before the match will end")); break;
+               case MAPINFO_TYPE_KEYHUNT:         GameType_ConfigureSliders(me, _("Point limit:"),   200, 1500, 50, "g_keyhunt_point_limit",     "g_keyhunt_teams_override",     _("The amount of points needed before the match will end")); break;
+               case MAPINFO_TYPE_LMS:             GameType_ConfigureSliders(me, _("Lives:"),           3,   50,  1, "g_lms_lives_override",      string_null,                    string_null); break;
+               case MAPINFO_TYPE_RACE:            GameType_ConfigureSliders(me, _("Laps:"),            1,   25,  1, "g_race_laps_limit",         string_null,                    string_null); break;
+               case MAPINFO_TYPE_NEXBALL:         GameType_ConfigureSliders(me, _("Goals:"),           1,   50,  1, "g_nexball_goallimit",       string_null,                    _("The amount of goals needed before the match will end")); break;
+               case MAPINFO_TYPE_ASSAULT:         GameType_ConfigureSliders(me, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null); break;
+               case MAPINFO_TYPE_ONSLAUGHT:       GameType_ConfigureSliders(me, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null); break;
+               case MAPINFO_TYPE_CTS:             GameType_ConfigureSliders(me, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null); break;
+               case MAPINFO_TYPE_INVASION:        GameType_ConfigureSliders(me, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null); break;
+               case MAPINFO_TYPE_TEAM_DEATHMATCH: GameType_ConfigureSliders(me, _("Point limit:"),     5,  100,  5, "g_tdm_point_limit",         "g_tdm_teams_override",         _("The amount of points needed before the match will end")); break;
+               default:                           GameType_ConfigureSliders(me, _("Frag limit:"),      5,  100,  5, "fraglimit_override",        string_null,                    _("The amount of frags needed before the match will end")); break;
        }
 
-       string x = string_null;
-       string theTooltip = string_null;
-       e = me.sliderTeams;
-       switch(gt)
-       {
-               // old tooltip: _("Override the default amount of teams in teamgames")
-               case MAPINFO_TYPE_CA:               x = "g_ca_teams_override";          break;
-               case MAPINFO_TYPE_DOMINATION:       x = "g_domination_teams_override";  break;
-               case MAPINFO_TYPE_FREEZETAG:        x = "g_freezetag_teams_override";   break;
-               case MAPINFO_TYPE_KEYHUNT:          x = "g_keyhunt_teams_override";     break;
-               case MAPINFO_TYPE_TEAM_DEATHMATCH:  x = "g_tdm_teams_override";         break;
-       }
-       e.configureXonoticTextSlider(e, x, theTooltip);
-       e.configureXonoticTextSliderValues(e);
-       me.sliderTeams.disabled = me.labelTeams.disabled = !x;
-
        me.mapListBox.refilter(me.mapListBox);
 }
 
index 8638ab14b7aacd642b5b914643c47f4ad354dc79..b459728594c650364e0c8fde6ee984e31025f802 100644 (file)
@@ -192,7 +192,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.currentServerNumFreeSlots = strzone(s);
        me.numFreeSlotsLabel.setText(me.numFreeSlotsLabel, me.currentServerNumFreeSlots);
 
-       me.currentServerMod = ((modname == "Xonotic") ? _("Default") : modname);
+       me.currentServerMod = ((modname == "Xonotic") ? ZCTX(_("MOD^Default")) : modname);
        me.currentServerMod = strzone(me.currentServerMod);
        me.modLabel.setText(me.modLabel, me.currentServerMod);
 
index 3819036ad4445f8fdd99dcdc3dc9576a685e2160..6b3cea416de0158dfed3fa2ab2b24783d64ff26d 100644 (file)
@@ -12,6 +12,9 @@ CLASS(XonoticServerList, XonoticListBox)
        METHOD(XonoticServerList, toggleFavorite, void(entity, string));
 
        ATTRIB(XonoticServerList, iconsSizeFactor, float, 0.85)
+       METHOD(XonoticServerList, mouseMove, float(entity, vector));
+       ATTRIB(XonoticServerList, mouseOverIcons, bool, false)
+       METHOD(XonoticServerList, focusedItemChangeNotify, void(entity));
 
        ATTRIB(XonoticServerList, realFontSize, vector, '0 0 0')
        ATTRIB(XonoticServerList, realUpperMargin, float, 0)
@@ -1077,9 +1080,10 @@ void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool is
 
 #ifdef COMPAT_NO_MOD_IS_XONOTIC
        if(modname == "")
-               modname = "xonotic";
+               modname = "Xonotic";
 #endif
 
+       string original_modname = modname;
        modname = strtolower(modname);
 
        /*
@@ -1096,7 +1100,7 @@ void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool is
        if(modname != "cts")
        if(modname != "nix")
        if(modname != "newtoys")
-               pure = false;
+               pure_available = false;
 
        if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
                theAlpha = SKINALPHA_SERVERLIST_FULL;
@@ -1232,6 +1236,19 @@ void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool is
        if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
                draw_Picture(iconPos, "icon_stats1", iconSize, '1 1 1', 1);
 
+       if(isFocused && me.mouseOverIcons && !me.tooltip)
+       {
+               string t = "";
+               if(me.seenIPv4 && me.seenIPv6)
+                       t = strcat(t, (isv6) ? "IPv6, " : "IPv4, ");
+               t = strcat(t, _("encryption:"), " ", (q ? sprintf(_("AES level %d"), q) : ZCTX(_("ENC^none"))), ", ");
+               t = strcat(t, sprintf(_("mod: %s"), ((modname == "xonotic") ? ZCTX(_("MOD^Default")) : original_modname)));
+               if(pure_available)
+                       t = strcat(t, sprintf(_(" (%s)"), (pure) ? _("official settings") : _("modified settings")));
+               t = strcat(t, ", ");
+               t = strcat(t, ((sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS)) ? _("stats enabled") : _("stats disabled")));
+               setZonedTooltip(me, t, string_null);
+       }
        // --------------
        //  RENDER TEXT
        // --------------
@@ -1257,6 +1274,26 @@ void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool is
        draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 }
 
+void XonoticServerList_focusedItemChangeNotify(entity me)
+{
+       clearTooltip(me);
+}
+
+float XonoticServerList_mouseMove(entity me, vector pos)
+{
+       if(!SUPER(XonoticServerList).mouseMove(me, pos))
+       {
+               me.mouseOverIcons = false;
+               clearTooltip(me);
+               return 1;
+       }
+
+       me.mouseOverIcons = (pos_x <= me.columnIconsSize);
+       if(!me.mouseOverIcons)
+               clearTooltip(me);
+       return 1;
+}
+
 bool XonoticServerList_keyDown(entity me, int scan, bool ascii, bool shift)
 {
        vector org, sz;
index 426048002255bb4ec838055409ead3ff54be17c6..b879257b7f7be8712694155a04ab66cff2c3509c 100644 (file)
@@ -63,7 +63,7 @@ string getCvarsMulti(entity me)
 void saveCvarsMulti(entity me)
 {
        float n, i;
-       string s;
+       string s, cvarname;
 
        me.saveCvars_Multi(me);
        s = cvar_string(me.cvarName);
@@ -71,12 +71,19 @@ void saveCvarsMulti(entity me)
        n = tokenize_console(me.cvarNames_Multi);
        for(i = 0; i < n; ++i)
        {
+               // cvars prefixed with ! get saved with the inverted value
                if(substring(argv(i), 0, 1) == "!")
-                       cvar_set(substring(argv(i), 1, strlen(argv(i))), ((s == "0") ? "1" : "0"));
+               {
+                       cvarname = substring(argv(i), 1, strlen(argv(i)));
+                       cvar_set(cvarname, ((s == "0") ? "1" : "0"));
+               }
                else
-                       cvar_set(argv(i), s);
+               {
+                       cvarname = argv(i);
+                       cvar_set(cvarname, s);
+               }
 
-               CheckSendCvars(me, argv(i));
+               CheckSendCvars(me, cvarname);
        }
 }
 void makeMulti(entity e, string otherCvars)
index 81d5136f9648949b18e8b7866059ea977eff7a2e..eb9c24d67ab0bb5797ef13a37168d9c08e4ffc3a 100644 (file)
@@ -341,30 +341,25 @@ void VoteThink()
 // =======================
 
 // Resets the state of all clients, items, weapons, waypoints, ... of the map.
-void reset_map(float dorespawn)
+void reset_map(bool dorespawn)
 {
        SELFPARAM();
 
-       if (time <= game_starttime && round_handler_IsActive())
-               round_handler_Reset(game_starttime);
+       if (time <= game_starttime && round_handler_IsActive()) round_handler_Reset(game_starttime);
 
        MUTATOR_CALLHOOK(reset_map_global);
 
        for (entity e = world; (e = nextent(e)); )
        {
-               setself(e);
-               if (IS_NOT_A_CLIENT(self))
+               if (IS_NOT_A_CLIENT(e))
                {
-                       if (self.reset)
+                       if (e.reset)
                        {
-                               self.reset();
+                               WITH(entity, self, e, e.reset(e));
                                continue;
                        }
-
-                       if (self.team_saved) self.team = self.team_saved;
-
-                       if (self.flags & FL_PROJECTILE)  // remove any projectiles left
-                               remove(self);
+                       if (e.team_saved) e.team = e.team_saved;
+                       if (e.flags & FL_PROJECTILE) remove(e);  // remove any projectiles left
                }
        }
 
@@ -384,7 +379,7 @@ void reset_map(float dorespawn)
 
        entity e;
        FOR_EACH_PLAYER(e)
-       if (e.frozen) WITH(entity, self, e, Unfreeze(self));
+       if (e.frozen) WITH(entity, self, e, Unfreeze(e));
 
        // Moving the player reset code here since the player-reset depends
        // on spawnpoint entities which have to be reset first --blub
@@ -426,28 +421,29 @@ void reset_map(float dorespawn)
 void ReadyRestart_think()
 {
        SELFPARAM();
-       restart_mapalreadyrestarted = 1;
+       restart_mapalreadyrestarted = true;
        reset_map(true);
        Score_ClearAll();
-       remove(self);
+       remove(this);
 }
 
 // Forces a restart of the game without actually reloading the map // this is a mess...
 void ReadyRestart_force()
 {
-       entity tmp_player, restart_timer;
-
        bprint("^1Server is restarting...\n");
 
        VoteReset();
 
        // clear overtime, we have to decrease timelimit to its original value again.
-       if (checkrules_overtimesadded > 0 && g_race_qualifying != 2)   cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime)));
+       if (checkrules_overtimesadded > 0 && g_race_qualifying != 2)
+               cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime)));
        checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
 
-       readyrestart_happened = 1;
+       readyrestart_happened = true;
        game_starttime = time + RESTART_COUNTDOWN;
 
+       entity tmp_player;
+
        // clear player attributes
        FOR_EACH_CLIENT(tmp_player)
        {
@@ -456,7 +452,7 @@ void ReadyRestart_force()
                PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, -PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, 0));
        }
 
-       restart_mapalreadyrestarted = 0; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
+       restart_mapalreadyrestarted = false; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
 
        // disable the warmup global for the server
        warmup_stage = 0;                // once the game is restarted the game is in match stage
@@ -464,7 +460,7 @@ void ReadyRestart_force()
        // reset the .ready status of all players (also spectators)
        FOR_EACH_REALCLIENT(tmp_player)
        {
-               tmp_player.ready = 0;
+               tmp_player.ready = false;
        }
        readycount = 0;
        Nagger_ReadyCounted();  // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
@@ -472,14 +468,15 @@ void ReadyRestart_force()
        // lock teams with lockonrestart
        if (autocvar_teamplay_lockonrestart && teamplay)
        {
-               lockteams = 1;
+               lockteams = true;
                bprint("^1The teams are now locked.\n");
        }
 
        // initiate the restart-countdown-announcer entity
        if (autocvar_sv_ready_restart_after_countdown)
        {
-               restart_timer = spawn();
+               entity restart_timer = new(restart_timer);
+               make_pure(restart_timer);
                restart_timer.think = ReadyRestart_think;
                restart_timer.nextthink = game_starttime;
        }
@@ -491,9 +488,11 @@ void ReadyRestart_force()
                {
                        tmp_player.allowed_timeouts = autocvar_sv_timeout_number;
                }
-               // reset map immediately if this cvar is not set
-               if (!autocvar_sv_ready_restart_after_countdown)   reset_map(true); }
-       if (autocvar_sv_eventlog)   GameLogEcho(":restart"); }
+       }
+    // reset map immediately if this cvar is not set
+    if (!autocvar_sv_ready_restart_after_countdown) reset_map(true);
+       if (autocvar_sv_eventlog) GameLogEcho(":restart");
+}
 
 void ReadyRestart()
 {
@@ -503,7 +502,7 @@ void ReadyRestart()
 
        // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
        // Otherwise scores could be manipulated during the countdown.
-       if (!autocvar_sv_ready_restart_after_countdown)   Score_ClearAll();
+       if (!autocvar_sv_ready_restart_after_countdown) Score_ClearAll();
        ReadyRestart_force();
 }
 
index 16a7c779be9736147ee7ca9c0984e9b9f61562f0..c04acac1593aa6bb8880c9ea77bf96d2b0ffcc64 100644 (file)
@@ -348,7 +348,7 @@ float g_nexball_meter_period;
 void SUB_DontUseTargets();
 void SUB_UseTargets();
 
-.void() reset; // if set, an entity is reset using this
+.void(entity this) reset; // if set, an entity is reset using this
 .void() reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
 
 void ClientData_Touch(entity e);
index 147c03ca26e60a4a1d64eea44fae528544ca74a6..87c28825ac4dfd9f553c07d6b5363e7b03dbf356 100644 (file)
@@ -857,7 +857,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        farcent.origin = hitloc;
                        farcent.forcetype = FORCETYPE_FORCEATPOS;
                        farcent.nextthink = time + 0.1;
-                       farcent.think = SUB_Remove;
+                       farcent.think = SUB_Remove_self;
                }
                else
                {
index 99bd819495bd9949394e05f2cc34c95e4d361b8e..360078d2a31124fde23eb212159440944d802649 100644 (file)
@@ -80,12 +80,12 @@ void RemoveGrapplingHook(entity pl)
        //pl.disableclientprediction = false;
 }
 
-void GrapplingHookReset()
-{SELFPARAM();
-       if(self.realowner.hook == self)
-               RemoveGrapplingHook(self.owner);
+void GrapplingHookReset(entity this)
+{
+       if(this.realowner.hook == this)
+               RemoveGrapplingHook(this.owner);
        else // in any case:
-               remove(self);
+               remove(this);
 }
 
 void GrapplingHookThink();
index a50885a7fe45f34208b8c7eea2f57d3382cfa10e..cebf61b7040d1b24302c4662e395272aadbd4a3f 100644 (file)
@@ -6,7 +6,6 @@ void SUB_NullThink();
 void()  SUB_CalcMoveDone;
 void() SUB_CalcAngleMoveDone;
 //void() SUB_UseTargets;
-void() SUB_Remove;
 
 spawnfunc(info_null);
 
@@ -14,14 +13,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart
 
 void updateanim(entity e);
 
-/*
-==================
-SUB_Remove
 
-Remove self
-==================
-*/
-void SUB_Remove ();
 
 /*
 ==================
index ef399f5666c8ba40402748670d2de6d000ab6482..f03b2e7ceb15dbac4f831b5839a3c97116141055 100644 (file)
@@ -1158,7 +1158,7 @@ string uid2name(string myuid) {
                if(s != "")
                {
                        db_put(ServerProgsDB, strcat("/uid2name/", myuid), s);
-                       db_put(ServerProgsDB, strcat("uid2name", myuid), "");
+                       db_remove(ServerProgsDB, strcat("uid2name", myuid));
                }
        }
 
index 4193ff29add7c5bd7fd357c9862a3faaa85d0ef3..f7479af965ee8246f531d2c1885bcf3ae26c9d4d 100644 (file)
@@ -58,7 +58,6 @@ void soundtoat(float _dest, entity e, vector o, float chan, string samp, float v
 
 void objerror(string s);
 void droptofloor();
-void() SUB_Remove;
 
 void attach_sameorigin(entity e, entity to, string tag);
 
index fdc26626591835ca51246ecaad36d79b897bde75..68d23f4860c55485a9b12fc8f03b1b3e4cfd17a4 100644 (file)
@@ -94,9 +94,9 @@ vector target_objective_spawn_evalfunc(entity player, entity spot, vector curren
 
 // reset this objective. Used when spawning an objective
 // and when a new round starts
-void assault_objective_reset()
-{SELFPARAM();
-       self.health = ASSAULT_VALUE_INACTIVE;
+void assault_objective_reset(entity this)
+{
+       this.health = ASSAULT_VALUE_INACTIVE;
 }
 
 // decrease the health of targeted objectives
@@ -212,11 +212,11 @@ void target_objective_decrease_findtarget()
        assault_setenemytoobjective();
 }
 
-void target_assault_roundend_reset()
-{SELFPARAM();
+void target_assault_roundend_reset(entity this)
+{
        //print("round end reset\n");
-       self.cnt = self.cnt + 1; // up round counter
-       self.winning = 0; // up round
+       ++this.cnt; // up round counter
+       this.winning = false; // up round
 }
 
 void target_assault_roundend_use()
@@ -330,13 +330,13 @@ spawnfunc(info_player_defender)
 
 spawnfunc(target_objective)
 {
-       if (!g_assault) { remove(self); return; }
+       if (!g_assault) { remove(this); return; }
 
-       self.classname = "target_objective";
-       self.use = assault_objective_use;
-       assault_objective_reset();
-       self.reset = assault_objective_reset;
-       self.spawn_evalfunc = target_objective_spawn_evalfunc;
+       this.classname = "target_objective";
+       this.use = assault_objective_use;
+       this.reset = assault_objective_reset;
+       this.reset(this);
+       this.spawn_evalfunc = target_objective_spawn_evalfunc;
 }
 
 spawnfunc(target_objective_decrease)
index d16b1687781fa52df21050715e0c510283348e5c..95b219ea034b8d49e8009a0410868b1abfb15124 100644 (file)
@@ -249,6 +249,7 @@ bool autocvar_g_ctf_flag_dropped_floatinwater;
 bool autocvar_g_ctf_flag_glowtrails;
 int autocvar_g_ctf_flag_health;
 bool autocvar_g_ctf_flag_return;
+bool autocvar_g_ctf_flag_return_carrying;
 float autocvar_g_ctf_flag_return_carried_radius;
 float autocvar_g_ctf_flag_return_time;
 bool autocvar_g_ctf_flag_return_when_unreachable;
@@ -1246,7 +1247,7 @@ METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher))
 
                case FLAG_DROPPED:
                {
-                       if(CTF_SAMETEAM(toucher, flag) && (autocvar_g_ctf_flag_return || num_perteam <= 1) && flag.team) // automatically return if there's only 1 player on the team
+                       if(CTF_SAMETEAM(toucher, flag) && (autocvar_g_ctf_flag_return || num_perteam <= 1 || (autocvar_g_ctf_flag_return_carrying && toucher.flagcarried)) && flag.team) // automatically return if there's only 1 player on the team
                                ctf_Handle_Return(flag, toucher); // toucher just returned his own flag
                        else if(is_not_monster && (!toucher.flagcarried) && ((toucher != flag.ctf_dropper) || (time > flag.ctf_droptime + autocvar_g_ctf_flag_collect_delay)))
                                ctf_Handle_Pickup(flag, toucher, PICKUP_DROPPED); // toucher just picked up a dropped enemy flag
@@ -1325,13 +1326,12 @@ void ctf_RespawnFlag(entity flag)
        ctf_CheckStalemate();
 }
 
-void ctf_Reset()
-{SELFPARAM();
-       if(self.owner)
-               if(IS_PLAYER(self.owner))
-                       ctf_Handle_Throw(self.owner, world, DROP_RESET);
+void ctf_Reset(entity this)
+{
+       if(this.owner && IS_PLAYER(this.owner))
+        ctf_Handle_Throw(this.owner, world, DROP_RESET);
 
-       ctf_RespawnFlag(self);
+       ctf_RespawnFlag(this);
 }
 
 void ctf_DelayedFlagSetup() // called after a flag is placed on a map by ctf_FlagSetup()
index 8c5d5159d5383e5763bd7cb818ff8359c6e31c9e..9be5e108aa895be8d962c623c78dc4dd018611c2 100644 (file)
@@ -315,8 +315,10 @@ void dompointtouch()
        dompoint_captured();
 }
 
-void dom_controlpoint_setup()
-{SELFPARAM();
+void dom_controlpoint_setup(entity this);
+void dom_controlpoint_setup_self() { SELFPARAM(); dom_controlpoint_setup(this); }
+void dom_controlpoint_setup(entity this)
+{
        entity head;
        // find the spawnfunc_dom_team representing unclaimed points
        head = find(world, classname, "dom_team");
@@ -551,7 +553,7 @@ spawnfunc(dom_controlpoint)
                remove(self);
                return;
        }
-       self.think = dom_controlpoint_setup;
+       self.think = dom_controlpoint_setup_self;
        self.nextthink = time + 0.1;
        self.reset = dom_controlpoint_setup;
 
@@ -664,12 +666,12 @@ void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float p
        setself(this);
 }
 
-void _spawnfunc_dom_controlpoint() { SELFPARAM(); spawnfunc_dom_controlpoint(self); }
+void self_spawnfunc_dom_controlpoint() { SELFPARAM(); spawnfunc_dom_controlpoint(self); }
 void dom_spawnpoint(vector org)
 {SELFPARAM();
        setself(spawn());
        self.classname = "dom_controlpoint";
-       self.think = _spawnfunc_dom_controlpoint;
+       self.think = self_spawnfunc_dom_controlpoint;
        self.nextthink = time;
        setorigin(self, org);
        spawnfunc_dom_controlpoint(this);
index 1fa986483bd4ed9d31678bb6a3867f2a2fa4b916..26a7b91dbb8536128c57a9d5c833476a2d1f03c5 100644 (file)
@@ -140,7 +140,7 @@ void invasion_SpawnChosenMonster(float mon)
                        monster = spawnmonster("", mon, world, world, e.origin, false, false, 2);
                else return;
 
-               e.think = SUB_Remove;
+               e.think = SUB_Remove_self;
                e.nextthink = time + 0.1;
        }
        else
index ea14243709cfc1b433e3a159c053e5801dc992af..1e593d0eff0afdac49d2e5a5cbb28cc55bb6cfb5 100644 (file)
@@ -221,16 +221,17 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
 }
 
-void ka_Reset() // used to clear the ballcarrier whenever the match switches from warmup to normal
-{SELFPARAM();
-       if((self.owner) && (IS_PLAYER(self.owner)))
-               ka_DropEvent(self.owner);
+/** used to clear the ballcarrier whenever the match switches from warmup to normal */
+void ka_Reset(entity this)
+{
+       if((this.owner) && (IS_PLAYER(this.owner)))
+               ka_DropEvent(this.owner);
 
        if(time < game_starttime)
        {
-               self.think = ka_RespawnBall;
-               self.touch = func_null;
-               self.nextthink = game_starttime;
+               this.think = ka_RespawnBall;
+               this.touch = func_null;
+               this.nextthink = game_starttime;
        }
        else
                ka_RespawnBall();
index 8d4240e29aa3478b35dbfdfc6b0e0e95179dc1d6..cbfc8f814f5bd1b65a12fe604fe3219a3c0b6247 100644 (file)
@@ -793,10 +793,10 @@ void kh_Key_Think()  // runs all the time
        self.nextthink = time + 0.05;
 }
 
-void key_reset()
-{SELFPARAM();
-       kh_Key_AssignTo(self, world);
-       kh_Key_Remove(self);
+void key_reset(entity this)
+{
+       kh_Key_AssignTo(this, world);
+       kh_Key_Remove(this);
 }
 
 const string STR_ITEM_KH_KEY = "item_kh_key";
index 9fa7f4739715b39269c9b4e600ee8ce6705a0d69..575bc69040474805daee2fef54347a3887dd6f3e 100644 (file)
@@ -299,22 +299,43 @@ MUTATOR_HOOKFUNCTION(lms, ForbidPlayerScore_Clear)
 MUTATOR_HOOKFUNCTION(lms, FilterItem)
 {SELFPARAM();
        if(autocvar_g_lms_extra_lives)
-       if(self.itemdef == ITEM_HealthMega)
-       {
-               self.max_health = 1;
+       if(self.itemdef == ITEM_ExtraLife)
                return false;
-       }
+
+       return true;
+}
+
+void lms_extralife()
+{SELFPARAM();
+       StartItem(this, ITEM_ExtraLife);
+}
+
+MUTATOR_HOOKFUNCTION(lms, OnEntityPreSpawn)
+{SELFPARAM();
+       if (!autocvar_g_powerups) return false;
+       if (!autocvar_g_lms_extra_lives) return false;
+
+       // Can't use .itemdef here
+       if (self.classname != "item_health_mega") return false;
+
+       entity e = spawn();
+       e.think = lms_extralife;
+
+       e.nextthink = time + 0.1;
+       e.spawnflags = self.spawnflags;
+       e.noalign = self.noalign;
+       setorigin(e, self.origin);
 
        return true;
 }
 
 MUTATOR_HOOKFUNCTION(lms, ItemTouch)
 {SELFPARAM();
-       // give extra lives for mega health
-       if (self.items & ITEM_HealthMega.m_itemid)
+       if(self.itemdef == ITEM_ExtraLife)
        {
                Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
                PlayerScore_Add(other, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
+               return MUT_ITEMTOUCH_PICKUP;
        }
 
        return MUT_ITEMTOUCH_CONTINUE;
index 434f50b8641bcb3aeeb3f8a76efc1e0ee17c4b13..abdfcbaed88087254fe4e0e1eabab38943ef6d2e 100644 (file)
@@ -70,8 +70,6 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align)
     }
 }
 
-void SUB_Remove();
-
 void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 {
     entity s;
@@ -83,7 +81,7 @@ void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 
     s           = spawn();
     s.alpha     = 0.25;
-    s.think     = SUB_Remove;
+    s.think     = SUB_Remove_self;
     s.nextthink = _lifetime;
     s.scale     = pathlib_gridsize / 512.001;
     s.solid     = SOLID_NOT;
@@ -108,7 +106,7 @@ void pathlib_showedge(vector where,float _lifetime,float rot)
 
     e           = spawn();
     e.alpha     = 0.25;
-    e.think     = SUB_Remove;
+    e.think     = SUB_Remove_self;
     e.nextthink = _lifetime;
     e.scale     = pathlib_gridsize / 512;
     e.solid     = SOLID_NOT;
index 9a199bd62697031f402a995912663823d375956a..c78fc9320d771ec58357013d9920ea646dacd082 100644 (file)
@@ -10,7 +10,7 @@ void pathlib_deletepath(entity start)
     e = findchainentity(owner, start);
     while(e)
     {
-        e.think = SUB_Remove;
+        e.think = SUB_Remove_self;
         e.nextthink = time;
         e = e.chain;
     }
@@ -22,7 +22,7 @@ const float PATHLIB_NODEEXPIRE = 20;
 void dumpnode(entity n)
 {
     n.is_path_node = false;
-    n.think        = SUB_Remove;
+    n.think        = SUB_Remove_self;
     n.nextthink    = time;
 }
 
@@ -49,7 +49,7 @@ entity pathlib_mknode(vector where,entity parent)
 
     node = spawn();
 
-    node.think        = SUB_Remove;
+    node.think        = SUB_Remove_self;
     node.nextthink    = time + PATHLIB_NODEEXPIRE;
     node.is_path_node = true;
     node.owner        = openlist;
index 3d6e9e85e80eacdfd3bf2371af6dcdcbf46a5afb..bc9fafc4c293f821ef6e3f36e951e123946cf39b 100644 (file)
@@ -328,8 +328,8 @@ void race_deleteTime(string map, float pos)
        {
                if (i == RANKINGS_CNT)
                {
-                       db_put(ServerProgsDB, strcat(map, rr, "time", ftos(i)), string_null);
-                       db_put(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)), string_null);
+                       db_remove(ServerProgsDB, strcat(map, rr, "time", ftos(i)));
+                       db_remove(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)));
                }
                else
                {
index f295777db791f581cc15e5a10ecdd4eb79cdea3b..f55402f0ecf54124cf39dbfa657bde045dec596e 100644 (file)
@@ -1066,7 +1066,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
                if(this.angles != '0 0 0')
                        this.SendFlags |= ISF_ANGLES;
 
-               this.reset = Item_Reset_self;
+               this.reset = Item_Reset;
                // it's a level item
                if(this.spawnflags & 1)
                        this.noalign = 1;
index 82646da26a01dfca79a42192c9adc9d2f77d5f06..88e9c2a666688e53402150b5307beb254ed4d563 100644 (file)
@@ -128,7 +128,7 @@ void target_give_init()
                else if (targ.classname == "item_health_mega")
                        self.health = 200;
                //remove(targ); // removing ents in init functions causes havoc, workaround:
-        targ.think = SUB_Remove;
+        targ.think = SUB_Remove_self;
         targ.nextthink = time;
        }
        self.spawnflags = 2;