]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/menu_remove_tab_title' of git://de.git.xonotic.org/xonotic...
authorterencehill <piuntn@gmail.com>
Sun, 10 May 2015 23:09:24 +0000 (01:09 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 10 May 2015 23:09:24 +0000 (01:09 +0200)
Conflicts:
qcsrc/menu/item/dialog.qc

446 files changed:
qcsrc/Makefile
qcsrc/client/_all.qh [new file with mode: 0644]
qcsrc/client/announcer.qc
qcsrc/client/announcer.qh [new file with mode: 0644]
qcsrc/client/bgmscript.qc
qcsrc/client/bgmscript.qh
qcsrc/client/casings.qc
qcsrc/client/casings.qh [new file with mode: 0644]
qcsrc/client/command/cl_cmd.qc
qcsrc/client/command/commands.qc [new file with mode: 0644]
qcsrc/client/command/commands.qh [new file with mode: 0644]
qcsrc/client/csqc_constants.qc [deleted file]
qcsrc/client/csqc_constants.qh [new file with mode: 0644]
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/csqcmodel_hooks.qh [new file with mode: 0644]
qcsrc/client/damage.qc
qcsrc/client/damage.qh
qcsrc/client/defs.qh
qcsrc/client/effects.qc
qcsrc/client/effects.qh [new file with mode: 0644]
qcsrc/client/gibs.qc
qcsrc/client/hook.qc
qcsrc/client/hook.qh [new file with mode: 0644]
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc
qcsrc/client/hud_config.qh [new file with mode: 0644]
qcsrc/client/laser.qc
qcsrc/client/laser.qh [new file with mode: 0644]
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/mapvoting.qh
qcsrc/client/miscfunctions.qc
qcsrc/client/modeleffects.qc
qcsrc/client/modeleffects.qh
qcsrc/client/movelib.qc [new file with mode: 0644]
qcsrc/client/movelib.qh [new file with mode: 0644]
qcsrc/client/movetypes.qc
qcsrc/client/noise.qc
qcsrc/client/particles.qc
qcsrc/client/particles.qh
qcsrc/client/player_skeleton.qc
qcsrc/client/player_skeleton.qh
qcsrc/client/prandom.qc
qcsrc/client/progs.src
qcsrc/client/rubble.qc
qcsrc/client/rubble.qh
qcsrc/client/scoreboard.qc
qcsrc/client/scoreboard.qh
qcsrc/client/shownames.qc
qcsrc/client/shownames.qh
qcsrc/client/sortlist.qh
qcsrc/client/t_items.qc [new file with mode: 0644]
qcsrc/client/t_items.qh [new file with mode: 0644]
qcsrc/client/target_music.qc
qcsrc/client/target_music.qh
qcsrc/client/teamradar.qc
qcsrc/client/teamradar.qh
qcsrc/client/tturrets.qc
qcsrc/client/tturrets.qh
qcsrc/client/tuba.qc
qcsrc/client/tuba.qh
qcsrc/client/vehicles/bumblebee.qc [new file with mode: 0644]
qcsrc/client/vehicles/bumblebee.qh [new file with mode: 0644]
qcsrc/client/vehicles/vehicles.qc
qcsrc/client/vehicles/vehicles.qh
qcsrc/client/view.qc
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/client/waypointsprites.qc
qcsrc/client/waypointsprites.qh
qcsrc/client/weapons/projectile.qc
qcsrc/client/weapons/projectile.qh
qcsrc/common/animdecide.qc
qcsrc/common/buffs.qh
qcsrc/common/command/command.qh [new file with mode: 0644]
qcsrc/common/command/commands.qc [new file with mode: 0644]
qcsrc/common/command/commands.qh [new file with mode: 0644]
qcsrc/common/command/generic.qc
qcsrc/common/command/generic.qh
qcsrc/common/command/markup.qc
qcsrc/common/command/markup.qh
qcsrc/common/command/rpn.qc
qcsrc/common/command/rpn.qh
qcsrc/common/command/shared_defs.qh [deleted file]
qcsrc/common/counting.qh
qcsrc/common/mapinfo.qh
qcsrc/common/monsters/all.inc [new file with mode: 0644]
qcsrc/common/monsters/all.qh [deleted file]
qcsrc/common/monsters/monsters.qc
qcsrc/common/monsters/monsters.qh
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/nades.qh
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/common/stats.qh
qcsrc/common/util-pre.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/weapons/all.inc [new file with mode: 0644]
qcsrc/common/weapons/all.qh [deleted file]
qcsrc/common/weapons/weapons.qc
qcsrc/common/weapons/weapons.qh
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/dpdefs/dpextensions.qh
qcsrc/dpdefs/keycodes.qh
qcsrc/dpdefs/menudefs.qh
qcsrc/dpdefs/progsdefs.qh
qcsrc/dpdefs/upstream/csprogsdefs.qc [new file with mode: 0644]
qcsrc/dpdefs/upstream/dpextensions.qc [new file with mode: 0644]
qcsrc/dpdefs/upstream/keycodes.qc [new file with mode: 0644]
qcsrc/dpdefs/upstream/menudefs.qc [new file with mode: 0644]
qcsrc/dpdefs/upstream/progsdefs.qc [new file with mode: 0644]
qcsrc/menu/_all.qh [new file with mode: 0644]
qcsrc/menu/anim/animation.qc
qcsrc/menu/anim/animhost.qc
qcsrc/menu/anim/easing.qc
qcsrc/menu/anim/keyframe.qc
qcsrc/menu/classes.inc [new file with mode: 0644]
qcsrc/menu/classes.qc [deleted file]
qcsrc/menu/command/commands.qc [new file with mode: 0644]
qcsrc/menu/command/commands.qh [new file with mode: 0644]
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/draw.qc
qcsrc/menu/item.qc
qcsrc/menu/item/borderimage.qc
qcsrc/menu/item/button.qc
qcsrc/menu/item/checkbox.qc
qcsrc/menu/item/container.qc
qcsrc/menu/item/dialog.qc
qcsrc/menu/item/image.qc
qcsrc/menu/item/inputbox.qc
qcsrc/menu/item/inputcontainer.qc
qcsrc/menu/item/label.qc
qcsrc/menu/item/listbox.qc
qcsrc/menu/item/modalcontroller.qc
qcsrc/menu/item/nexposee.qc
qcsrc/menu/item/radiobutton.qc
qcsrc/menu/item/slider.qc
qcsrc/menu/item/tab.qc
qcsrc/menu/item/textslider.qc
qcsrc/menu/menu.qc
qcsrc/menu/menu.qh
qcsrc/menu/oo/base.qh
qcsrc/menu/oo/classes.qc [new file with mode: 0644]
qcsrc/menu/oo/implementation.qh [deleted file]
qcsrc/menu/oo/interface.qh [deleted file]
qcsrc/menu/progs.src
qcsrc/menu/skin.qh
qcsrc/menu/xonotic/bigbutton.qc
qcsrc/menu/xonotic/bigcommandbutton.qc
qcsrc/menu/xonotic/button.qc
qcsrc/menu/xonotic/campaign.qc
qcsrc/menu/xonotic/charmap.qc
qcsrc/menu/xonotic/checkbox.qc
qcsrc/menu/xonotic/checkbox_slider_invalid.qc
qcsrc/menu/xonotic/checkbox_string.qc
qcsrc/menu/xonotic/colorbutton.qc
qcsrc/menu/xonotic/colorpicker.qc
qcsrc/menu/xonotic/colorpicker_string.qc
qcsrc/menu/xonotic/commandbutton.qc
qcsrc/menu/xonotic/credits.qc
qcsrc/menu/xonotic/crosshairbutton.qc
qcsrc/menu/xonotic/cvarlist.qc
qcsrc/menu/xonotic/demolist.qc
qcsrc/menu/xonotic/dialog.qc
qcsrc/menu/xonotic/dialog_credits.qc
qcsrc/menu/xonotic/dialog_firstrun.qc
qcsrc/menu/xonotic/dialog_hudpanel_ammo.qc
qcsrc/menu/xonotic/dialog_hudpanel_buffs.qc
qcsrc/menu/xonotic/dialog_hudpanel_centerprint.qc
qcsrc/menu/xonotic/dialog_hudpanel_chat.qc
qcsrc/menu/xonotic/dialog_hudpanel_engineinfo.qc
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc
qcsrc/menu/xonotic/dialog_hudpanel_infomessages.qc
qcsrc/menu/xonotic/dialog_hudpanel_modicons.qc
qcsrc/menu/xonotic/dialog_hudpanel_notification.qc
qcsrc/menu/xonotic/dialog_hudpanel_physics.qc
qcsrc/menu/xonotic/dialog_hudpanel_powerups.qc
qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.qc
qcsrc/menu/xonotic/dialog_hudpanel_racetimer.qc
qcsrc/menu/xonotic/dialog_hudpanel_radar.qc
qcsrc/menu/xonotic/dialog_hudpanel_score.qc
qcsrc/menu/xonotic/dialog_hudpanel_timer.qc
qcsrc/menu/xonotic/dialog_hudpanel_vote.qc
qcsrc/menu/xonotic/dialog_hudpanel_weapons.qc
qcsrc/menu/xonotic/dialog_hudsetup_exit.qc
qcsrc/menu/xonotic/dialog_monstertools.qc
qcsrc/menu/xonotic/dialog_multiplayer.qc
qcsrc/menu/xonotic/dialog_multiplayer_create.qc
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.qc
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc
qcsrc/menu/xonotic/dialog_multiplayer_join.qc
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.qc
qcsrc/menu/xonotic/dialog_multiplayer_media.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_demo_timeconfirm.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_musicplayer.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc
qcsrc/menu/xonotic/dialog_multiplayer_profile.qc
qcsrc/menu/xonotic/dialog_quit.qc
qcsrc/menu/xonotic/dialog_sandboxtools.qc
qcsrc/menu/xonotic/dialog_settings.qc
qcsrc/menu/xonotic/dialog_settings_audio.qc
qcsrc/menu/xonotic/dialog_settings_effects.qc
qcsrc/menu/xonotic/dialog_settings_game.qc
qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc
qcsrc/menu/xonotic/dialog_settings_game_hud.qc
qcsrc/menu/xonotic/dialog_settings_game_hudconfirm.qc
qcsrc/menu/xonotic/dialog_settings_game_messages.qc
qcsrc/menu/xonotic/dialog_settings_game_model.qc
qcsrc/menu/xonotic/dialog_settings_game_view.qc
qcsrc/menu/xonotic/dialog_settings_game_weapons.qc
qcsrc/menu/xonotic/dialog_settings_input.qc
qcsrc/menu/xonotic/dialog_settings_input_userbind.qc
qcsrc/menu/xonotic/dialog_settings_misc.qc
qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc
qcsrc/menu/xonotic/dialog_settings_misc_reset.qc
qcsrc/menu/xonotic/dialog_settings_user.qc
qcsrc/menu/xonotic/dialog_settings_user_languagewarning.qc
qcsrc/menu/xonotic/dialog_settings_video.qc
qcsrc/menu/xonotic/dialog_singleplayer.qc
qcsrc/menu/xonotic/dialog_singleplayer_winner.qc
qcsrc/menu/xonotic/dialog_teamselect.qc
qcsrc/menu/xonotic/gametypebutton.qc
qcsrc/menu/xonotic/gametypelist.qc
qcsrc/menu/xonotic/image.qc
qcsrc/menu/xonotic/inputbox.qc
qcsrc/menu/xonotic/keybinder.qc
qcsrc/menu/xonotic/languagelist.qc
qcsrc/menu/xonotic/listbox.qc
qcsrc/menu/xonotic/mainwindow.qc
qcsrc/menu/xonotic/maplist.qc
qcsrc/menu/xonotic/nexposee.qc
qcsrc/menu/xonotic/playerlist.qc
qcsrc/menu/xonotic/playermodel.qc
qcsrc/menu/xonotic/playlist.qc
qcsrc/menu/xonotic/radiobutton.qc
qcsrc/menu/xonotic/rootdialog.qc
qcsrc/menu/xonotic/screenshotimage.qc
qcsrc/menu/xonotic/screenshotlist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/skinlist.qc
qcsrc/menu/xonotic/slider.qc
qcsrc/menu/xonotic/slider_decibels.qc
qcsrc/menu/xonotic/slider_particles.qc
qcsrc/menu/xonotic/slider_picmip.qc
qcsrc/menu/xonotic/slider_resolution.qc
qcsrc/menu/xonotic/slider_sbfadetime.qc
qcsrc/menu/xonotic/soundlist.qc
qcsrc/menu/xonotic/statslist.qc
qcsrc/menu/xonotic/tab.qc
qcsrc/menu/xonotic/tabcontroller.qc
qcsrc/menu/xonotic/textlabel.qc
qcsrc/menu/xonotic/textslider.qc
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/weaponarenacheckbox.qc
qcsrc/menu/xonotic/weaponslist.qc
qcsrc/server/_all.qh [new file with mode: 0644]
qcsrc/server/anticheat.qc
qcsrc/server/antilag.qc
qcsrc/server/bot/aim.qc
qcsrc/server/bot/aim.qh
qcsrc/server/bot/bot.qc
qcsrc/server/bot/bot.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_keyhunt.qc
qcsrc/server/bot/havocbot/role_keyhunt.qh [new file with mode: 0644]
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/havocbot/role_onslaught.qh [new file with mode: 0644]
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/havocbot/roles.qh [new file with mode: 0644]
qcsrc/server/bot/havocbot/scripting.qh [new file with mode: 0644]
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/navigation.qh
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/scripting.qh [new file with mode: 0644]
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cheats.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_client.qh [new file with mode: 0644]
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/banning.qc
qcsrc/server/command/banning.qh
qcsrc/server/command/cmd.qc
qcsrc/server/command/commands.qc [new file with mode: 0644]
qcsrc/server/command/commands.qh [new file with mode: 0644]
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/getreplies.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/radarmap.qh
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/command/vote.qh
qcsrc/server/csqceffects.qh [new file with mode: 0644]
qcsrc/server/defs.qh
qcsrc/server/ent_cs.qc
qcsrc/server/func_breakable.qc
qcsrc/server/g_casings.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_damage.qh
qcsrc/server/g_hook.qc
qcsrc/server/g_lights.qc
qcsrc/server/g_models.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_violence.qc
qcsrc/server/g_world.qc
qcsrc/server/g_world.qh
qcsrc/server/ipban.qc
qcsrc/server/item_key.qc
qcsrc/server/mapvoting.qc
qcsrc/server/mapvoting.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/base.qc
qcsrc/server/mutators/gamemode.qh [new file with mode: 0644]
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_ctf.qh
qcsrc/server/mutators/gamemode_cts.qc
qcsrc/server/mutators/gamemode_domination.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_freezetag.qh [new file with mode: 0644]
qcsrc/server/mutators/gamemode_invasion.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keepaway.qh
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_keyhunt.qh
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/gamemode_race.qc
qcsrc/server/mutators/gamemode_tdm.qc
qcsrc/server/mutators/mutator.qh [new file with mode: 0644]
qcsrc/server/mutators/mutator_bloodloss.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_campcheck.qc
qcsrc/server/mutators/mutator_dodging.qc
qcsrc/server/mutators/mutator_instagib.qc
qcsrc/server/mutators/mutator_invincibleproj.qc
qcsrc/server/mutators/mutator_melee_only.qc
qcsrc/server/mutators/mutator_midair.qc
qcsrc/server/mutators/mutator_multijump.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/mutators/mutator_physical_items.qc
qcsrc/server/mutators/mutator_pinata.qc
qcsrc/server/mutators/mutator_random_gravity.qc
qcsrc/server/mutators/mutator_rocketflying.qc
qcsrc/server/mutators/mutator_spawn_near_teammate.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/mutators/mutator_touchexplode.qc
qcsrc/server/mutators/mutator_vampire.qc
qcsrc/server/mutators/mutators_include.qc
qcsrc/server/mutators/sandbox.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib.qh [new file with mode: 0644]
qcsrc/server/pathlib/costs.qc
qcsrc/server/pathlib/debug.qc
qcsrc/server/pathlib/expandnode.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/main.qh [new file with mode: 0644]
qcsrc/server/pathlib/movenode.qc
qcsrc/server/pathlib/path_waypoint.qc
qcsrc/server/pathlib/pathlib.qh
qcsrc/server/pathlib/utility.qc
qcsrc/server/pathlib/utility.qh [new file with mode: 0644]
qcsrc/server/playerdemo.qc
qcsrc/server/portals.qc
qcsrc/server/progs.src
qcsrc/server/race.qc
qcsrc/server/race.qh
qcsrc/server/round_handler.qc
qcsrc/server/scores.qc
qcsrc/server/scores.qh
qcsrc/server/scores_rules.qc
qcsrc/server/scores_rules.qh [new file with mode: 0644]
qcsrc/server/secret.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/steerlib.qc
qcsrc/server/steerlib.qh [new file with mode: 0644]
qcsrc/server/sv_main.qc
qcsrc/server/t_halflife.qc
qcsrc/server/t_items.qc
qcsrc/server/t_items.qh
qcsrc/server/t_jumppads.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_quake.qc
qcsrc/server/t_quake3.qc
qcsrc/server/t_swamp.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/target_music.qc
qcsrc/server/target_spawn.qc
qcsrc/server/teamplay.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/units/unit_ewheel.qc
qcsrc/server/tturrets/units/unit_machinegun.qc
qcsrc/server/tturrets/units/unit_phaser.qc
qcsrc/server/tturrets/units/unit_targettrigger.qc
qcsrc/server/tturrets/units/unit_tessla.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/all.qc [new file with mode: 0644]
qcsrc/server/vehicles/all.qh [new file with mode: 0644]
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/racer.qh [new file with mode: 0644]
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/raptor.qh [new file with mode: 0644]
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/spiderbot.qh [new file with mode: 0644]
qcsrc/server/vehicles/vehicle.qc [new file with mode: 0644]
qcsrc/server/vehicles/vehicle.qh [new file with mode: 0644]
qcsrc/server/vehicles/vehicles.qc [deleted file]
qcsrc/server/vehicles/vehicles.qh [deleted file]
qcsrc/server/vehicles/vehicles_def.qh [deleted file]
qcsrc/server/waypointsprites.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/common.qc
qcsrc/server/weapons/csqcprojectile.qc
qcsrc/server/weapons/hitplot.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponstats.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/test/compilationunit.sh [new file with mode: 0755]
qcsrc/warpzonelib/anglestransform.qc
qcsrc/warpzonelib/client.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/mathlib.qc
qcsrc/warpzonelib/mathlib.qh
qcsrc/warpzonelib/server.qc
qcsrc/warpzonelib/util_server.qc

index abbd25ffd8ba40041322b62fee2577aafe85a286..f53707e829f482c39e0f6dcdee0c54d54d4aa3c1 100644 (file)
@@ -15,8 +15,13 @@ QCCFLAGS ?= \
        -Werror -fno-bail-on-werror -Wall \
        -fftepp -fftepp-predefs -Wcpp -futf8 \
        $(QCCFLAGS_WTFS) \
+       $(QCCFLAGS_FEATURES) \
        $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
 
+QCCFLAGS_FEATURES ?= \
+       -DVEHICLES_ENABLED=1 \
+       -DVEHICLES_USE_ODE=0
+
 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
 XON_BUILDSYSTEM =
 
diff --git a/qcsrc/client/_all.qh b/qcsrc/client/_all.qh
new file mode 100644 (file)
index 0000000..c8ff79d
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef CLIENT___H
+#define CLIENT___H
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "main.qh"
+#include "miscfunctions.qh"
+
+#include "../dpdefs/csprogsdefs.qh"
+
+#endif
index 116dba7d3cc5898bf6acc70f13772e810babdd6c..19e51cedc6b98f2611c274476fba9cc0430300d2 100644 (file)
@@ -1,13 +1,9 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-    #include "../common/stats.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "../common/notifications.qh"
-    #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "announcer.qh"
+#include "_all.qh"
+
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
+#include "../common/util.qh"
 
 bool announcer_1min;
 bool announcer_5min;
diff --git a/qcsrc/client/announcer.qh b/qcsrc/client/announcer.qh
new file mode 100644 (file)
index 0000000..620b845
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef ANNOUNCER_H
+#define ANNOUNCER_H
+
+void Announcer();
+
+#endif
index b567190caa666f165cfe49bea7a09ea6fd8b0d73..697cae91ca3296d36c9d0c79612bb575a7ab4e38 100644 (file)
@@ -1,13 +1,7 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/util.qh"
-       #include "autocvars.qh"
-       #include "bgmscript.qh"
-       #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "bgmscript.qh"
+#include "_all.qh"
+
+#include "../common/util.qh"
 
 #define CONSTANT_SPEED_DECAY
 
@@ -15,12 +9,12 @@ float bgmscriptbuf;
 float bgmscriptbufsize;
 float bgmscriptbufloaded;
 
-.float bgmscriptline;
-.float bgmscriptline0;
-.float bgmscriptvolume;
-.float bgmscripttime;
-.float bgmscriptstate;
-.float bgmscriptstatetime;
+class(BGMScript) .float bgmscriptline;
+class(BGMScript) .float bgmscriptline0;
+class(BGMScript) .float bgmscriptvolume;
+class(BGMScript) .float bgmscripttime;
+class(BGMScript) .float bgmscriptstate;
+class(BGMScript) .float bgmscriptstatetime;
 
 float GetAttackDecaySustainAmplitude(float a, float d, float s, float t)
 {
@@ -177,7 +171,7 @@ float GetTimeForAmplitude(entity e, float amp)
        }
 }
 
-float BGMScript(entity e)
+float doBGMScript(entity e)
 {
        float amp, vel;
 
index 910ef6b5df006c69f3347ad33363498d31f53a74..cd70955cb428709ddb29a931189e6a2b536a9679 100644 (file)
@@ -1,14 +1,15 @@
 #ifndef BGMSCRIPT_H
 #define BGMSCRIPT_H
 
-.string bgmscript;
-.float bgmscriptattack;
-.float bgmscriptdecay;
-.float bgmscriptsustain;
-.float bgmscriptrelease;
+entityclass(BGMScript);
+class(BGMScript) .string bgmscript;
+class(BGMScript) .float bgmscriptattack;
+class(BGMScript) .float bgmscriptdecay;
+class(BGMScript) .float bgmscriptsustain;
+class(BGMScript) .float bgmscriptrelease;
 
-.float just_toggled;
+class(BGMScript) .float just_toggled;
 
 void BGMScript_InitEntity(entity e);
-float BGMScript(entity e);
+float doBGMScript(entity e);
 #endif
index 6068a799f752892a2d1dc8f86b7d412537c0644c..f9c58957e546c33f65287233822a36bbf3f30cda 100644 (file)
@@ -1,17 +1,18 @@
-#if defined(CSQC)
-       #include "movetypes.qh"
-       #include "prandom.qh"
-       #include "rubble.qh"
+#include "casings.qh"
+#include "_all.qh"
 
-       .float cnt;
-       .float alpha;
-       .int state;
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "rubble.qh"
 
+#include "../common/util.qh"
 
-.bool silent;
+.float cnt;
+.float alpha;
+.int state;
+
+entityclass(Casing);
+class(Casing) .bool silent;
 
 void Casing_Delete()
 {
diff --git a/qcsrc/client/casings.qh b/qcsrc/client/casings.qh
new file mode 100644 (file)
index 0000000..dafe66a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CASINGS_H
+#define CASINGS_H
+
+void Casings_Precache();
+
+void Ent_Casing(float isNew);
+
+#endif
index 7b74d2dd7fa56752889ee75f6abb3cdbb1e08115..18fcfd1271cfeb9c273349cadf47e1f7331bdb63 100644 (file)
@@ -3,8 +3,20 @@
 //  Last updated: December 28th, 2011
 // ==============================================
 
+#include "../../common/command/command.qh"
+#include "cl_cmd.qh"
+
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../hud.qh"
+#include "../hud_config.qh"
+#include "../main.qh"
+#include "../mapvoting.qh"
+#include "../miscfunctions.qh"
+
+#include "../../common/mapinfo.qh"
+
 #include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
 
 void DrawDebugModel()
 {
diff --git a/qcsrc/client/command/commands.qc b/qcsrc/client/command/commands.qc
new file mode 100644 (file)
index 0000000..dabf8f3
--- /dev/null
@@ -0,0 +1,5 @@
+#include "../_all.qh"
+
+#include "../../common/command/commands.qc"
+
+#include "cl_cmd.qc"
diff --git a/qcsrc/client/command/commands.qh b/qcsrc/client/command/commands.qh
new file mode 100644 (file)
index 0000000..65bf3da
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CLIENT_COMMANDS_H
+#define CLIENT_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "cl_cmd.qh"
+
+#endif
diff --git a/qcsrc/client/csqc_constants.qc b/qcsrc/client/csqc_constants.qc
deleted file mode 100644 (file)
index f11c31c..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-// MenuQC redefines world, change define it here to be safe
-#define world world
-
-// Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
-const int              MASK_ENGINE                                             = 1;
-const int              MASK_ENGINEVIEWMODELS                   = 2;
-const int              MASK_NORMAL                                             = 4;
-
-// Renderflag Constants (used for CSQC entities)
-const int              RF_VIEWMODEL                                    = 1;
-const int              RF_EXTERNALMODEL                                = 2;
-const int              RF_DEPTHHACK                                    = 4;
-const int              RF_ADDITIVE                                             = 8;
-const int              RF_USEAXIS                                              = 16;
-
-// Viewflag Constants (use with R_SetView)
-const int              VF_MIN                                                  = 1;    //(vector)
-const int              VF_MIN_X                                                = 2;    //(float)
-const int              VF_MIN_Y                                                = 3;    //(float)
-const int              VF_SIZE                                                 = 4;    //(vector) (viewport size)
-const int              VF_SIZE_Y                                               = 5;    //(float)
-const int              VF_SIZE_X                                               = 6;    //(float)
-const int              VF_VIEWPORT                                             = 7;    //(vector, vector)
-const int              VF_FOV                                                  = 8;    //(vector)
-const int              VF_FOVX                                                 = 9;    //(float)
-const int              VF_FOVY                                                 = 10;   //(float)
-const int              VF_ORIGIN                                               = 11;   //(vector)
-const int              VF_ORIGIN_X                                             = 12;   //(float)
-const int              VF_ORIGIN_Y                                             = 13;   //(float)
-const int              VF_ORIGIN_Z                                             = 14;   //(float)
-const int              VF_ANGLES                                               = 15;   //(vector)
-const int              VF_ANGLES_X                                             = 16;   //(float)
-const int              VF_ANGLES_Y                                             = 17;   //(float)
-const int              VF_ANGLES_Z                                             = 18;   //(float)
-const int              VF_DRAWWORLD                                    = 19;   //(float)
-const int              VF_DRAWENGINEHUD                                = 20;   //(float)
-const int              VF_DRAWCROSSHAIR                                = 21;   //(float)
-const int              VF_PERSPECTIVE                                  = 200;  //(float)
-
-const int              VF_CL_VIEWANGLES                                = 33;   //(vector)
-const int              VF_CL_VIEWANGLES_X                              = 34;   //(float)
-const int              VF_CL_VIEWANGLES_Y                              = 35;   //(float)
-const int              VF_CL_VIEWANGLES_Z                              = 36;   //(float)
-
-// Quake-style Point Contents
-const int              CONTENT_EMPTY                                   = -1;
-const int              CONTENT_SOLID                                   = -2;
-const int              CONTENT_WATER                                   = -3;
-const int              CONTENT_SLIME                                   = -4;
-const int              CONTENT_LAVA                                    = -5;
-const int              CONTENT_SKY                                             = -6;
-
-// Vector / Hull Constants
-const vector   VEC_1                                                   = '1 1 1';
-const vector   VEC_0                                                   = '0 0 0';
-const vector   VEC_M1                                                  = '-1 -1 -1';
-
-const vector   VEC_HULL_MIN                                    = '-16 -16 -24';
-const vector   VEC_HULL_MAX                                    = '16 16 32';
-
-// Effect Constants
-const int      EF_NODRAW                                               = 16;
-const int      EF_ADDITIVE                                             = 32;
-const int      EF_BLUE                                                 = 64;
-const int      EF_RED                                                  = 128;
-const int      EF_FULLBRIGHT                                   = 512;
-const int      EF_FLAME                                                = 1024;
-const int      EF_STARDUST                                             = 2048;
-const int      EF_NOSHADOW                                             = 4096;
-const int      EF_NODEPTHTEST                                  = 8192;
-
-// Quake Player Flag Constants
-const int      PFL_ONGROUND                                    = 1;
-const int      PFL_CROUCH                                              = 2;
-const int      PFL_DEAD                                                = 4;
-const int      PFL_GIBBED                                              = 8;
-
-// Quake Temporary Entity Constants
-const int              TE_SPIKE                                                = 0;
-const int              TE_SUPERSPIKE                                   = 1;
-const int              TE_GUNSHOT                                              = 2;
-const int              TE_EXPLOSION                                    = 3;
-const int              TE_TAREXPLOSION                                 = 4;
-const int              TE_LIGHTNING1                                   = 5;
-const int              TE_LIGHTNING2                                   = 6;
-const int              TE_WIZSPIKE                                             = 7;
-const int              TE_KNIGHTSPIKE                                  = 8;
-const int              TE_LIGHTNING3                                   = 9;
-const int              TE_LAVASPLASH                                   = 10;
-const int              TE_TELEPORT                                             = 11;
-const int      TE_EXPLOSION2                                   = 12;
-// Darkplaces Additions
-const int      TE_EXPLOSIONRGB                                 = 53;
-const int              TE_GUNSHOTQUAD                                  = 57;
-const int              TE_EXPLOSIONQUAD                                = 70;
-
-// Math Constants
-const int      EXTRA_LOW                                               = -99999999;
-const int      EXTRA_HIGH                                              = 99999999;
-
-// Frik File Constants
-const int              FILE_READ                                               = 0;
-const int              FILE_APPEND                                             = 1;
-const int              FILE_WRITE                                              = 2;
-
-// Button values used by input_buttons
-const int BUTTON_ATTACK = 1;
-const int BUTTON_JUMP = 2;
-const int BUTTON_3 = 4;
-const int BUTTON_4 = 8;
-const int BUTTON_5 = 16;
-const int BUTTON_6 = 32;
-const int BUTTON7 = 64;
-const int BUTTON8 = 128;
-const int BUTTON_USE = 256;
-const int BUTTON_CHAT = 512;
-const int BUTTON_PRYDONCURSOR = 1024;
-const int BUTTON_9 = 2048;
-const int BUTTON_10 = 4096;
-const int BUTTON_11 = 8192;
-const int BUTTON_12 = 16384;
-const int BUTTON_13 = 32768;
-const int BUTTON_14 = 65536;
-const int BUTTON_15 = 131072;
-const int BUTTON_16 = 262144;
-
-const int SOLID_NOT            = 0; // no interaction with other objects
-const int SOLID_TRIGGER        = 1; // touch on edge, but not blocking
-const int SOLID_BBOX           = 2; // touch on edge, block
-const int SOLID_SLIDEBOX       = 3; // touch on edge, but not an onground
-const int SOLID_BSP            = 4; // bsp clip, touch on edge, block
-const int SOLID_CORPSE         = 5; // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
-
-const int MOVE_NORMAL = 0; // same as false
-const int MOVE_NOMONSTERS = 1; // same as true
-const int MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-const int MOVE_HITMODEL = 4;
-const int MOVE_WORLDONLY = 3;
-
-const int CAMERA_FREE = 1;
-const int CAMERA_CHASE = 2;
-
-const int EF_NOMODELFLAGS = 8388608;
diff --git a/qcsrc/client/csqc_constants.qh b/qcsrc/client/csqc_constants.qh
new file mode 100644 (file)
index 0000000..09d217b
--- /dev/null
@@ -0,0 +1,148 @@
+#ifndef CSQC_CONSTANTS
+#define CSQC_CONSTANTS
+
+// MenuQC redefines world, change define it here to be safe
+#define world world
+
+// Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
+const int              MASK_ENGINE                                             = 1;
+const int              MASK_ENGINEVIEWMODELS                   = 2;
+const int              MASK_NORMAL                                             = 4;
+
+// Renderflag Constants (used for CSQC entities)
+const int              RF_VIEWMODEL                                    = 1;
+const int              RF_EXTERNALMODEL                                = 2;
+const int              RF_DEPTHHACK                                    = 4;
+const int              RF_ADDITIVE                                             = 8;
+const int              RF_USEAXIS                                              = 16;
+
+// Viewflag Constants (use with R_SetView)
+const int              VF_MIN                                                  = 1;    //(vector)
+const int              VF_MIN_X                                                = 2;    //(float)
+const int              VF_MIN_Y                                                = 3;    //(float)
+const int              VF_SIZE                                                 = 4;    //(vector) (viewport size)
+const int              VF_SIZE_Y                                               = 5;    //(float)
+const int              VF_SIZE_X                                               = 6;    //(float)
+const int              VF_VIEWPORT                                             = 7;    //(vector, vector)
+const int              VF_FOV                                                  = 8;    //(vector)
+const int              VF_FOVX                                                 = 9;    //(float)
+const int              VF_FOVY                                                 = 10;   //(float)
+const int              VF_ORIGIN                                               = 11;   //(vector)
+const int              VF_ORIGIN_X                                             = 12;   //(float)
+const int              VF_ORIGIN_Y                                             = 13;   //(float)
+const int              VF_ORIGIN_Z                                             = 14;   //(float)
+const int              VF_ANGLES                                               = 15;   //(vector)
+const int              VF_ANGLES_X                                             = 16;   //(float)
+const int              VF_ANGLES_Y                                             = 17;   //(float)
+const int              VF_ANGLES_Z                                             = 18;   //(float)
+const int              VF_DRAWWORLD                                    = 19;   //(float)
+const int              VF_DRAWENGINEHUD                                = 20;   //(float)
+const int              VF_DRAWCROSSHAIR                                = 21;   //(float)
+const int              VF_PERSPECTIVE                                  = 200;  //(float)
+
+const int              VF_CL_VIEWANGLES                                = 33;   //(vector)
+const int              VF_CL_VIEWANGLES_X                              = 34;   //(float)
+const int              VF_CL_VIEWANGLES_Y                              = 35;   //(float)
+const int              VF_CL_VIEWANGLES_Z                              = 36;   //(float)
+
+// Quake-style Point Contents
+const int              CONTENT_EMPTY                                   = -1;
+const int              CONTENT_SOLID                                   = -2;
+const int              CONTENT_WATER                                   = -3;
+const int              CONTENT_SLIME                                   = -4;
+const int              CONTENT_LAVA                                    = -5;
+const int              CONTENT_SKY                                             = -6;
+
+// Vector / Hull Constants
+const vector   VEC_1                                                   = '1 1 1';
+const vector   VEC_0                                                   = '0 0 0';
+const vector   VEC_M1                                                  = '-1 -1 -1';
+
+const vector   VEC_HULL_MIN                                    = '-16 -16 -24';
+const vector   VEC_HULL_MAX                                    = '16 16 32';
+
+// Effect Constants
+const int      EF_NODRAW                                               = 16;
+const int      EF_ADDITIVE                                             = 32;
+const int      EF_BLUE                                                 = 64;
+const int      EF_RED                                                  = 128;
+const int      EF_FULLBRIGHT                                   = 512;
+const int      EF_FLAME                                                = 1024;
+const int      EF_STARDUST                                             = 2048;
+const int      EF_NOSHADOW                                             = 4096;
+const int      EF_NODEPTHTEST                                  = 8192;
+
+// Quake Player Flag Constants
+const int      PFL_ONGROUND                                    = 1;
+const int      PFL_CROUCH                                              = 2;
+const int      PFL_DEAD                                                = 4;
+const int      PFL_GIBBED                                              = 8;
+
+// Quake Temporary Entity Constants
+const int              TE_SPIKE                                                = 0;
+const int              TE_SUPERSPIKE                                   = 1;
+const int              TE_GUNSHOT                                              = 2;
+const int              TE_EXPLOSION                                    = 3;
+const int              TE_TAREXPLOSION                                 = 4;
+const int              TE_LIGHTNING1                                   = 5;
+const int              TE_LIGHTNING2                                   = 6;
+const int              TE_WIZSPIKE                                             = 7;
+const int              TE_KNIGHTSPIKE                                  = 8;
+const int              TE_LIGHTNING3                                   = 9;
+const int              TE_LAVASPLASH                                   = 10;
+const int              TE_TELEPORT                                             = 11;
+const int      TE_EXPLOSION2                                   = 12;
+// Darkplaces Additions
+const int      TE_EXPLOSIONRGB                                 = 53;
+const int              TE_GUNSHOTQUAD                                  = 57;
+const int              TE_EXPLOSIONQUAD                                = 70;
+
+// Math Constants
+const int      EXTRA_LOW                                               = -99999999;
+const int      EXTRA_HIGH                                              = 99999999;
+
+// Frik File Constants
+const int              FILE_READ                                               = 0;
+const int              FILE_APPEND                                             = 1;
+const int              FILE_WRITE                                              = 2;
+
+// Button values used by input_buttons
+const int BUTTON_ATTACK = 1;
+const int BUTTON_JUMP = 2;
+const int BUTTON_3 = 4;
+const int BUTTON_4 = 8;
+const int BUTTON_5 = 16;
+const int BUTTON_6 = 32;
+const int BUTTON7 = 64;
+const int BUTTON8 = 128;
+const int BUTTON_USE = 256;
+const int BUTTON_CHAT = 512;
+const int BUTTON_PRYDONCURSOR = 1024;
+const int BUTTON_9 = 2048;
+const int BUTTON_10 = 4096;
+const int BUTTON_11 = 8192;
+const int BUTTON_12 = 16384;
+const int BUTTON_13 = 32768;
+const int BUTTON_14 = 65536;
+const int BUTTON_15 = 131072;
+const int BUTTON_16 = 262144;
+
+const int SOLID_NOT            = 0; // no interaction with other objects
+const int SOLID_TRIGGER        = 1; // touch on edge, but not blocking
+const int SOLID_BBOX           = 2; // touch on edge, block
+const int SOLID_SLIDEBOX       = 3; // touch on edge, but not an onground
+const int SOLID_BSP            = 4; // bsp clip, touch on edge, block
+const int SOLID_CORPSE         = 5; // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
+
+const int MOVE_NORMAL = 0; // same as false
+const int MOVE_NOMONSTERS = 1; // same as true
+const int MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+const int MOVE_HITMODEL = 4;
+const int MOVE_WORLDONLY = 3;
+
+const int CAMERA_FREE = 1;
+const int CAMERA_CHASE = 2;
+
+const int EF_NOMODELFLAGS = 8388608;
+
+#endif
index dde4461821ee9feef7e501d25961931082a79028..dbe999f8600517220936d3e14470ac83d0cb5e5d 100644 (file)
@@ -1,26 +1,24 @@
-#if defined(CSQC)
-       #include "gibs.qh"
-       #include "miscfunctions.qh"
-       #include "player_skeleton.qh"
-       #include "sortlist.qh"
+#include "csqcmodel_hooks.qh"
+#include "_all.qh"
 
-       #include "../client/weapons/projectile.qh"
+#include "gibs.qh"
+#include "player_skeleton.qh"
+#include "sortlist.qh"
 
-       #include "../common/animdecide.qh"
-       #include "../common/csqcmodel_settings.qh"
+#include "weapons/projectile.qh"
 
-       #include "../csqcmodellib/cl_model.qh"
-       #include "../csqcmodellib/cl_player.qh"
-       #include "../csqcmodellib/interpolate.qh"
+#include "../common/animdecide.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../common/teams.qh"
 
-       #include "../warpzonelib/mathlib.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/cl_player.qh"
+#include "../csqcmodellib/interpolate.qh"
 
-       .float death_time;
-       .int modelflags;
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "../warpzonelib/mathlib.qh"
 
+.float death_time;
+.int modelflags;
 
 void CSQCModel_Hook_PreDraw(bool isplayer);
 
diff --git a/qcsrc/client/csqcmodel_hooks.qh b/qcsrc/client/csqcmodel_hooks.qh
new file mode 100644 (file)
index 0000000..8995880
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef CSQCMODEL_HOOKS
+#define CSQCMODEL_HOOKS
+
+void CSQCPlayer_Precache();
+
+#endif
index 000ef8bcc9f45106d9c33e38c085c1e66653ebb3..924162138234377af35963d04f88ec44050b4e85 100644 (file)
@@ -1,18 +1,23 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/util.qh"
-       #include "../common/weapons/weapons.qh"
-       #include "autocvars.qh"
-       #include "../common/deathtypes.qh"
-       #include "damage.qh"
-       #include "movetypes.qh"
-       #include "prandom.qh"
-       #include "vehicles/vehicles.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "damage.qh"
+#include "_all.qh"
+
+#include "gibs.qh"
+#include "movetypes.qh"
+#include "prandom.qh"
+
+#include "vehicles/vehicles.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+.entity tag_entity;
+
+.float cnt;
+.int state;
+.bool isplayermodel;
 
 void DamageEffect_Think()
 {
index 7c5c74130e41d8e7cf3dd27ade14b5748eef38bc..0de69a02d850a478906840ff353ed81902061059 100644 (file)
@@ -2,4 +2,7 @@
 #define DAMAGE_H
 
 .float total_damages; // number of effects which currently are attached to a player
+
+void Ent_DamageInfo(float isNew);
+
 #endif
index 82c43e2e27a0be796c16d9e008312715d3be540b..6325a8ab3c6651481938e9999f23ecc5f63aae5c 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DEFS_H
-#define DEFS_H
+#ifndef CLIENT_DEFS_H
+#define CLIENT_DEFS_H
 
 // Additional OPTIONAL Fields and Globals
 //float                intermission;
index 95623505b83e297d2a7e63e12a4f78e378838d5b..99a9944d8ed3b276eca38407efa6d6b81cbb51f8 100644 (file)
@@ -1,9 +1,5 @@
-#if defined(CSQC)
-    #include "../dpdefs/csprogsdefs.qh"
-    #include "autocvars.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "effects.qh"
+#include "_all.qh"
 
 /*
 .vector fx_start;
diff --git a/qcsrc/client/effects.qh b/qcsrc/client/effects.qh
new file mode 100644 (file)
index 0000000..0bebdb9
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef EFFECTS_H
+#define EFFECTS_H
+
+void Net_ReadArc();
+
+#endif
index eb7d4787777c0435b67721dd874aff64a87592e7..c617106019b0e0412881b00474ddbb86d8b89ee1 100644 (file)
@@ -1,4 +1,17 @@
 #include "gibs.qh"
+#include "_all.qh"
+
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "rubble.qh"
+
+#include "../common/constants.qh"
+#include "../common/util.qh"
+
+.float scale;
+.float alpha;
+.float cnt;
+.float gravity;
 
 void Gib_Delete()
 {
index 8436ff6225a0ccc0e546bf5007fccec05720c394..2a9be2e0e26602faacaae72f8154aab64b61e487 100644 (file)
@@ -1,12 +1,22 @@
+#include "hook.qh"
+#include "_all.qh"
+
 #include "hud.qh"
 #include "noise.qh"
+
+#include "../common/teams.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
 #include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
 
-.float HookType; // ENT_CLIENT_*
-.vector origin;
-.vector velocity;
-.float HookSilent;
-.float HookRange;
+entityclass(Hook);
+class(Hook) .float HookType; // ENT_CLIENT_*
+class(Hook) .vector origin;
+class(Hook) .vector velocity;
+class(Hook) .float HookSilent;
+class(Hook) .float HookRange;
 
 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
 {
@@ -49,7 +59,7 @@ void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
        Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
 }
 
-.float teleport_time;
+class(Hook) .float teleport_time;
 void Draw_GrapplingHook()
 {
        vector a, b, atrans;
diff --git a/qcsrc/client/hook.qh b/qcsrc/client/hook.qh
new file mode 100644 (file)
index 0000000..8401dce
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef HOOK_H
+#define HOOK_H
+
+void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
+void Hook_Precache();
+
+void Ent_ReadHook(float bIsNew, float type);
+
+#endif
index 0da1b69d2cb71e59a7a48687176f4e97c80ed7f0..33e9cb5f5ff4a436eedcb519840c9e8810cd39e6 100644 (file)
@@ -1,10 +1,23 @@
+#include "hud.qh"
+#include "_all.qh"
+
+#include "hud_config.qh"
 #include "scoreboard.qh"
+#include "sortlist.qh"
 #include "teamradar.qh"
+#include "t_items.qh"
+
 #include "../common/buffs.qh"
+#include "../common/constants.qh"
 #include "../common/counting.qh"
+#include "../common/deathtypes.qh"
 #include "../common/mapinfo.qh"
 #include "../common/nades.qh"
-#include "../server/t_items.qh"
+#include "../common/stats.qh"
+
+#include "../csqcmodellib/cl_player.qh"
+
+#include "../warpzonelib/mathlib.qh"
 
 /*
 ==================
@@ -1485,17 +1498,6 @@ void HUD_Powerups(void)
 // Health/armor (#3)
 //
 
-// prev_* vars contain the health/armor at the previous FRAME
-// set to -1 when player is dead or was not playing
-int prev_health, prev_armor;
-float health_damagetime, armor_damagetime;
-int health_beforedamage, armor_beforedamage;
-// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
-int old_p_health, old_p_armor;
-float old_p_healthtime, old_p_armortime;
-// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
-// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
-int prev_p_health, prev_p_armor;
 
 void HUD_HealthArmor(void)
 {
@@ -2624,15 +2626,6 @@ void HUD_RaceTimer (void)
 
 // Vote window (#9)
 //
-int vote_yescount;
-int vote_nocount;
-int vote_needed;
-int vote_highlighted; // currently selected vote
-
-int vote_active; // is there an active vote?
-int vote_prev; // previous state of vote_active to check for a change
-float vote_alpha;
-float vote_change; // "time" when vote_active changed
 
 void HUD_Vote(void)
 {
index 16a7645fd991819a55fd1b8de4349d318ee15f30..f880a810f6eb2c6a7dc53b797f1b3f67ea1422e1 100644 (file)
@@ -12,6 +12,19 @@ int HUD_PANEL_LAST;
 int panel_order[HUD_PANEL_MAX];
 string hud_panelorder_prev;
 
+void HUD_Reset (void);
+void HUD_Main (void);
+
+int vote_yescount;
+int vote_nocount;
+int vote_needed;
+int vote_highlighted; // currently selected vote
+
+int vote_active; // is there an active vote?
+int vote_prev; // previous state of vote_active to check for a change
+float vote_alpha;
+float vote_change; // "time" when vote_active changed
+
 float hud_draw_maximized;
 float hud_panel_radar_maximized;
 float chat_panel_modified;
@@ -69,18 +82,19 @@ vector panel_size_backup;
 vector panel_size_copied;
 
 entity panel;
-.string panel_name;
-.int panel_id;
-.vector current_panel_pos;
-.vector current_panel_size;
-.string current_panel_bg;
-.float current_panel_bg_alpha;
-.float current_panel_bg_border;
-.vector current_panel_bg_color;
-.float current_panel_bg_color_team;
-.float current_panel_bg_padding;
-.float current_panel_fg_alpha;
-.float update_time;
+entityclass(HUDPanel);
+class(HUDPanel) .string panel_name;
+class(HUDPanel) .int panel_id;
+class(HUDPanel) .vector current_panel_pos;
+class(HUDPanel) .vector current_panel_size;
+class(HUDPanel) .string current_panel_bg;
+class(HUDPanel) .float current_panel_bg_alpha;
+class(HUDPanel) .float current_panel_bg_border;
+class(HUDPanel) .vector current_panel_bg_color;
+class(HUDPanel) .float current_panel_bg_color_team;
+class(HUDPanel) .float current_panel_bg_padding;
+class(HUDPanel) .float current_panel_fg_alpha;
+class(HUDPanel) .float update_time;
 float panel_enabled;
 vector panel_pos;
 vector panel_size;
@@ -97,12 +111,31 @@ string panel_bg_border_str;
 float panel_bg_padding;
 string panel_bg_padding_str;
 
-.void() panel_draw;
+class(HUDPanel) .void() panel_draw;
 
 float current_player;
 
 float GetPlayerColorForce(int i);
 
+float stringwidth_colors(string s, vector theSize);
+int GetPlayerColor(int i);
+string GetPlayerName(int i);
+float stringwidth_nocolors(string s, vector theSize);
+void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag);
+
+
+// prev_* vars contain the health/armor at the previous FRAME
+// set to -1 when player is dead or was not playing
+int prev_health, prev_armor;
+float health_damagetime, armor_damagetime;
+int health_beforedamage, armor_beforedamage;
+// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
+int old_p_health, old_p_armor;
+float old_p_healthtime, old_p_armortime;
+// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
+// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
+int prev_p_health, prev_p_armor;
+
 
 #define HUD_PANELS(HUD_PANEL)                                                                                                                                                                          \
        HUD_PANEL(WEAPONS      , HUD_Weapons      , weapons)                                                                                                                    \
index 4ddc049ba167395173809af150f5cd88707525ac..3352e643abab19f0790d382de3c794dfb5e2a6b4 100644 (file)
@@ -1,13 +1,11 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../dpdefs/keycodes.qh"
-       #include "../common/constants.qh"
-       #include "autocvars.qh"
-       #include "hud.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "hud_config.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+
+#include "../common/constants.qh"
+
+#include "../dpdefs/keycodes.qh"
 
 
 #define HUD_Write(s) fputs(fh, s)
diff --git a/qcsrc/client/hud_config.qh b/qcsrc/client/hud_config.qh
new file mode 100644 (file)
index 0000000..cc1d4d5
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef HUD_CONFIG_H
+#define HUD_CONFIG_H
+
+void HUD_Panel_ExportCfg(string cfgname);
+
+void HUD_Panel_Mouse();
+
+void HUD_Configure_Frame();
+
+void HUD_Configure_PostDraw();
+
+float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary);
+
+#endif
index a74c6683a26824b0d9ac091e48012d6fb0258ab1..f5b6d54a9b32bd8df2fe39d95591981d124a28c7 100644 (file)
@@ -1,25 +1,25 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "../common/buffs.qh"
-       #include "../csqcmodellib/interpolate.qh"
-       #include "main.qh"
-       #include "../csqcmodellib/cl_model.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "laser.qh"
+#include "_all.qh"
 
+#include "hook.qh"
+
+#include "../common/buffs.qh"
+
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
 
 // a laser goes from origin in direction angles
 // it has color 'colormod'
 // and stops when something is in the way
-.int cnt; // end effect
-.vector colormod;
-.int state; // on-off
-.int count; // flags for the laser
-.vector velocity;
-.float alpha;
-.float scale; // scaling factor of the thickness
-.float modelscale; // scaling factor of the dlight
+entityclass(Laser);
+class(Laser) .int cnt; // end effect
+class(Laser) .vector colormod;
+class(Laser) .int state; // on-off
+class(Laser) .int count; // flags for the laser
+class(Laser) .vector velocity;
+class(Laser) .float alpha;
+class(Laser) .float scale; // scaling factor of the thickness
+class(Laser) .float modelscale; // scaling factor of the dlight
 
 void Draw_Laser()
 {
diff --git a/qcsrc/client/laser.qh b/qcsrc/client/laser.qh
new file mode 100644 (file)
index 0000000..86210ee
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef LASER_H
+#define LASER_H
+
+void Ent_Laser();
+
+#endif
index 36ec4f7b8c2525c2712566410ae80be9977ab50f..5343c180cc46c4ba4b4546e3475cc204ea21f9f3 100644 (file)
@@ -1,21 +1,48 @@
+#include "main.qh"
+#include "_all.qh"
+
+#include "casings.qh"
+#include "csqcmodel_hooks.qh"
+#include "damage.qh"
+#include "effects.qh"
+#include "gibs.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "laser.qh"
 #include "mapvoting.qh"
 #include "modeleffects.qh"
 #include "particles.qh"
+#include "prandom.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
+#include "sortlist.qh"
 #include "target_music.qh"
 #include "tturrets.qh"
 #include "tuba.qh"
+#include "t_items.qh"
 #include "wall.qh"
 #include "waypointsprites.qh"
 
+#include "vehicles/bumblebee.qh"
 #include "vehicles/vehicles.qh"
 
-#include "../server/vehicles/bumblebee.qh"
+#include "weapons/projectile.qh"
 
+#include "../common/buffs.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/monsters/monsters.qh"
+#include "../common/nades.qh"
 #include "../common/net_notice.qh"
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
 
-#include "../common/monsters/monsters.qh"
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
 
 #include "../warpzonelib/client.qh"
 
index b8823e6296d4de67aed98f1f2da417aa00ff0381..0bc85a441db9d6e83570061748ba23efa7a05c9e 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef MAIN_H
 #define MAIN_H
 
+#include "../common/constants.qh"
+
 // --------------------------------------------------------------------------
 // MENU Functionality
 
@@ -106,6 +108,8 @@ float current_viewzoom;
 float zoomin_effect;
 float warmup_stage;
 
+void Fog_Force();
+
 string getcommandkey(string text, string command);
 
 string vote_called_vote;
index 28b81fc51ffc9e85c917ff69f34e748bbc18c3a9..665f1b8857d68f91b1b4ad13729d29567f64a474 100644 (file)
@@ -1,6 +1,14 @@
 #include "mapvoting.qh"
+#include "_all.qh"
+
+#include "hud.qh"
 #include "scoreboard.qh"
 
+#include "../common/mapinfo.qh"
+#include "../common/util.qh"
+
+#include "../dpdefs/keycodes.qh"
+
 string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
 {
        string pre, post;
index 8a4133e50ab798a42708012525c11be11da895f9..cb7b4c645c586d38fbd4eff1c675ca0432082d8a 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef MAPVOTING_H
 #define MAPVOTING_H
 
+#include "../common/constants.qh"
+
 int mv_num_maps;
 
 float mv_active;
index d74a24a320142d35e7da242c19f24586ca1e08fe..f9e9705921989b0a290f1e3d8dbbf0c28809d671 100644 (file)
@@ -1,9 +1,19 @@
 #include "miscfunctions.qh"
+#include "_all.qh"
 
-#include "../common/urllib.qh"
+#include "hud.qh"
+#include "sortlist.qh"
 
 #include "../common/command/generic.qh"
 
+#include "../common/teams.qh"
+#include "../common/urllib.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/cl_model.qh"
+
+#include "../warpzonelib/mathlib.qh"
+
 void AuditLists()
 {
        entity e;
index c376085e07aaea1aa3b105e90ec7f06942014d91..c44fbe4dca452dfe702d72e96135a04212284a78 100644 (file)
@@ -1,4 +1,9 @@
 #include "modeleffects.qh"
+#include "_all.qh"
+
+.float cnt;
+.float scale;
+.float alpha;
 
 void ModelEffect_Draw()
 {
index f40cfef5597b5ee87f4c34d106e0cd1a66c001cb..22998f09d689d14c2951969493479c3811ccbbb6 100644 (file)
@@ -1,10 +1,11 @@
 #ifndef MODELEFFECTS_H
 #define MODELEFFECTS_H
 
-.float frame1time;
-.float lifetime, fadetime;
-.float teleport_time;
-.float scale1, scale2;
+entityclass(ModelEffect);
+class(ModelEffect) .float frame1time;
+class(ModelEffect) .float lifetime, fadetime;
+class(ModelEffect) .float teleport_time;
+class(ModelEffect) .float scale1, scale2;
 
 void ModelEffect_Draw();
 
diff --git a/qcsrc/client/movelib.qc b/qcsrc/client/movelib.qc
new file mode 100644 (file)
index 0000000..074f146
--- /dev/null
@@ -0,0 +1 @@
+#include "../server/movelib.qc"
diff --git a/qcsrc/client/movelib.qh b/qcsrc/client/movelib.qh
new file mode 100644 (file)
index 0000000..a0634f6
--- /dev/null
@@ -0,0 +1 @@
+#include "../server/movelib.qh"
index 2f62ae6dcf77741849bde451f5a5cc8189a9f415..beb6230dc541a969effd15505c17b911f7e16f01 100644 (file)
@@ -1,14 +1,12 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/stats.qh"
-       #include "../common/util.qh"
-       #include "movetypes.qh"
-       #include "../csqcmodellib/common.qh"
-       #include "../server/t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "movetypes.qh"
+#include "_all.qh"
+
+#include "t_items.qh"
+
+#include "../common/stats.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/common.qh"
 
 
 const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
index 5635f3f99b44d51cf04af689f36849344c58ee2a..2047410a972c75722908739959645212174f3672 100644 (file)
@@ -1,15 +1,13 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "noise.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "noise.qh"
+#include "_all.qh"
+
+entityclass(Noise);
+class(Noise) .float noise_baccum;
+class(Noise) .float noise_paccum;
+class(Noise) .float noise_paccum2;
+class(Noise) .float noise_paccum3;
+class(Noise) .float noise_bstate;
 
-.float noise_baccum;
-.float noise_paccum;
-.float noise_paccum2;
-.float noise_paccum3;
-.float noise_bstate;
 float Noise_Brown(entity e, float dt)
 {
        e.noise_baccum += random() * sqrt(dt); // same stddev for all dt
index 6d2ddf87d5a431b3cf4c901b60881d868fb0e25b..e61071137dceb41a60888cf2c7b29d90f6887bd2 100644 (file)
@@ -1,4 +1,12 @@
 #include "particles.qh"
+#include "_all.qh"
+
+#include "bgmscript.qh"
+
+#include "../common/stats.qh"
+#include "../common/util.qh"
+
+#include "../warpzonelib/common.qh"
 
 void Draw_PointParticles()
 {
@@ -8,7 +16,7 @@ void Draw_PointParticles()
        vector o;
        o = self.origin;
        sz = self.maxs - self.mins;
-       n = BGMScript(self);
+       n = doBGMScript(self);
        if(self.absolute == 2)
        {
                if(n >= 0)
index 12c999ba2bec219d5fb0adb0089aa66a271bfec1..586f3f00004e35dfe0e0d51b3387f3e3b6f26ac2 100644 (file)
@@ -3,16 +3,17 @@
 
 .int dphitcontentsmask;
 
-.int cnt; // effect number
-.vector velocity; // particle velocity
-.float waterlevel; // direction jitter
-.int count; // count multiplier
-.int impulse; // density
-.string noise; // sound
-.float atten;
-.float volume;
-.float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
-.vector movedir; // trace direction
+entityclass(PointParticles);
+class(PointParticles) .int cnt; // effect number
+class(PointParticles) .vector velocity; // particle velocity
+class(PointParticles) .float waterlevel; // direction jitter
+class(PointParticles) .int count; // count multiplier
+class(PointParticles) .int impulse; // density
+class(PointParticles) .string noise; // sound
+class(PointParticles) .float atten;
+class(PointParticles) .float volume;
+class(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
+class(PointParticles) .vector movedir; // trace direction
 
 void Draw_PointParticles();
 
@@ -20,7 +21,7 @@ void Ent_PointParticles_Remove();
 
 void Ent_PointParticles();
 
-.float glow_color; // palette index
+class(PointParticles) .float glow_color; // palette index
 
 void Draw_Rain();
 
index 0a9ac8cacb9167ddf05fc7eb762aafc8b02b26ff..9df837229692bace30366a8becff7470e79c9e32 100644 (file)
@@ -1,14 +1,16 @@
 #include "player_skeleton.qh"
 
+#include "../common/csqcmodel_settings.qh"
+
 #include "../warpzonelib/anglestransform.qh"
 
-.float skeleton_info_modelindex;
-.float skeleton_info_skin;
+class(Skeleton) .float skeleton_info_modelindex;
+class(Skeleton) .float skeleton_info_skin;
 const int BONETYPE_LOWER = 0;
 const int BONETYPE_UPPER = 1;
 const int MAX_BONES = 128;
-.float skeleton_bonetype[MAX_BONES];
-.float skeleton_numbones;
+class(Skeleton) .float skeleton_bonetype[MAX_BONES];
+class(Skeleton) .float skeleton_numbones;
 
 void skeleton_loadinfo(entity e)
 {
index 6c95ce231051fad1b7315e50476e82c7b280aa94..4a37df5e458b4923b3ca6fa298a3c34feb78aa89 100644 (file)
@@ -1,13 +1,16 @@
 #ifndef PLAYER_SKELETON
 #define PLAYER_SKELETON
 
+#include "../common/util.qh"
+
 void free_skeleton_from_frames(entity e);
 void skeleton_from_frames(entity e, float is_dead);
 void skeleton_loadinfo(entity e);
 
-.float bone_upperbody;
-.int bone_weapon;
-.float bone_aim[MAX_AIM_BONES];
-.float bone_aimweight[MAX_AIM_BONES];
-.float fixbone;
+entityclass(Skeleton);
+class(Skeleton) .float bone_upperbody;
+class(Skeleton) .int bone_weapon;
+class(Skeleton) .float bone_aim[MAX_AIM_BONES];
+class(Skeleton) .float bone_aimweight[MAX_AIM_BONES];
+class(Skeleton) .float fixbone;
 #endif
index 935f1421ed1379f26ce486ce56747fc8cf80385c..12e4e0ea5a23c365a5c8b23a4f6b9fdb09045a84 100644 (file)
@@ -1,10 +1,7 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "../warpzonelib/mathlib.qh"
-       #include "prandom.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "prandom.qh"
+#include "_all.qh"
+
+#include "../warpzonelib/mathlib.qh"
 
 // prandom - PREDICTABLE random number generator (not seeded yet)
 
index f80da18d67309ace7482be0dd4ac37ac784cd1c0..36d159c75e4df54202d7e5c4db0533e5c614f622 100644 (file)
@@ -11,13 +11,14 @@ damage.qc
 effects.qc
 gibs.qc
 hook.qc
-hud_config.qc
 hud.qc
+hud_config.qc
 laser.qc
 main.qc
 mapvoting.qc
 miscfunctions.qc
 modeleffects.qc
+movelib.qc
 movetypes.qc
 noise.qc
 particles.qc
@@ -31,12 +32,15 @@ target_music.qc
 teamradar.qc
 tturrets.qc
 tuba.qc
-vehicles/vehicles.qc
+t_items.qc
 view.qc
 wall.qc
 waypointsprites.qc
 
-command/cl_cmd.qc
+command/commands.qc
+
+vehicles/bumblebee.qc
+vehicles/vehicles.qc
 
 weapons/projectile.qc // TODO
 
@@ -51,10 +55,6 @@ weapons/projectile.qc // TODO
 ../common/urllib.qc
 ../common/util.qc
 
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
-
 ../common/monsters/monsters.qc
 
 ../common/weapons/weapons.qc // TODO
@@ -63,10 +63,6 @@ weapons/projectile.qc // TODO
 ../csqcmodellib/cl_player.qc
 ../csqcmodellib/interpolate.qc
 
-../server/movelib.qc
-../server/t_items.qc
-../server/vehicles/bumblebee.qc
-
 ../warpzonelib/anglestransform.qc
 ../warpzonelib/client.qc
 ../warpzonelib/common.qc
index c09dd18aed4ed8bfe1cc3cc78256e869489efcc1..4e32c0c45490fc9451c17504c5bafb7483368701 100644 (file)
@@ -1,8 +1,4 @@
-#if defined(CSQC)
-       #include "rubble.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "rubble.qh"
 
 // LordHavoc: rewrote this file, it was really bad code
 
index 5ff1b55777e769f40b1446c0f71a1b1e5f1f70d8..b19406c77e3e0afc9ce1719aa49db9dd8db92295 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef RUBBLE_H
 #define RUBBLE_H
-.float creationtime;
+entityclass(Rubble);
+class(Rubble) .float creationtime;
 void RubbleLimit(string cname, float limit, void() deleteproc);
 entity RubbleNew(string cname);
 #endif
index c6d871807f2e7c190af068a4ff192b760d3de57b..905c66c3cc13895b3500915a8631560e747ff4aa 100644 (file)
@@ -1,4 +1,15 @@
 #include "scoreboard.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "sortlist.qh"
+
+#include "../common/constants.qh"
+#include "../common/counting.qh"
+#include "../common/mapinfo.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
 
 float scoreboard_alpha_bg;
 float scoreboard_alpha_fg;
index c0326eb786a854bb2fe69655614752d7dcd67953..e1c5addb49f0474861188f571b5f0520c7a2e181 100644 (file)
@@ -7,6 +7,7 @@ float scoreboard_active;
 float scoreboard_fade_alpha;
 
 void Cmd_HUD_SetFields(float argc);
+void HUD_DrawScoreboard();
 void HUD_InitScores();
 void HUD_UpdatePlayerPos(entity pl);
 void HUD_UpdateTeamPos(entity Team);
index c6edf5040dbd1056b6f639fb4123bdcd0514ffe6..fc4649537a4c689763d13e7452fe7ff0e4ecb1f4 100644 (file)
@@ -1,18 +1,14 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/teams.qh"
-       #include "../common/util.qh"
-       #include "../common/mapinfo.qh"
-       #include "autocvars.qh"
-       #include "main.qh"
-       #include "../csqcmodellib/cl_model.qh"
-       #include "shownames.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "shownames.qh"
+#include "_all.qh"
 
+#include "hud.qh"
+
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/cl_model.qh"
 
 // self.isactive = player is in range and coordinates/status (health and armor) are up to date
 // self.origin = player origin TODO: should maybe move this so it's the origin of the shownames tag already in SSQC for culling?
index f196f8f83340c75dfcffa464534dd2e61f5ca385..63fd92e041da6e2505d0d015e2cac576904f2f86 100644 (file)
@@ -1,9 +1,13 @@
 #ifndef SHOWNAMES_H
 #define SHOWNAMES_H
 
-.float healthvalue;
-.float armorvalue;
-.float sameteam;
-.float fadedelay;
-.float pointtime;
+entityclass(ShowNames);
+class(ShowNames) .float healthvalue;
+class(ShowNames) .float armorvalue;
+class(ShowNames) .float sameteam;
+class(ShowNames) .float fadedelay;
+class(ShowNames) .float pointtime;
+
+void Draw_ShowNames_All();
+
 #endif
index 1b84287139e570c77cd5bdad67ebb9863166528f..298314810063b5e5dfbbaf0e85d648750b2eff61 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef SORTLIST_H
 #define SORTLIST_H
 
+entityclass(Sort);
 //.float(entity,entity) sort_cmp;
-.entity sort_next, sort_prev;
+class(Sort) .entity sort_next, sort_prev;
 
 entity Sort_Spawn();
 
diff --git a/qcsrc/client/t_items.qc b/qcsrc/client/t_items.qc
new file mode 100644 (file)
index 0000000..f9ebb97
--- /dev/null
@@ -0,0 +1,10 @@
+#include "_all.qh"
+
+#include "movetypes.qh"
+#include "../common/buffs.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/common.qh"
+
+#include "../server/t_items.qc"
diff --git a/qcsrc/client/t_items.qh b/qcsrc/client/t_items.qh
new file mode 100644 (file)
index 0000000..eb01624
--- /dev/null
@@ -0,0 +1 @@
+#include "../server/t_items.qh"
index 662a673d7999f901922507b07bc2fe8b974564d3..7711c25bf35a3d268dd53b1764f09afcc48892d1 100644 (file)
@@ -1,4 +1,18 @@
 #include "target_music.qh"
+#include "_all.qh"
+
+#include "../common/constants.qh"
+#include "../common/util.qh"
+
+#include "../warpzonelib/common.qh"
+
+.string noise;
+.float cnt;
+.float count;
+.float fade_time;
+.float fade_rate;
+.float lifetime;
+.float volume;
 
 void TargetMusic_Advance()
 {
index c685214be22bf02150f54a169cf641c71f3f06f2..182e1f4657bc28c1fbf49e877c31a7c784e38c3e 100644 (file)
@@ -7,8 +7,9 @@ entity music_target;
 entity music_trigger;
 // FIXME also control bgmvolume here, to not require a target_music for the default track.
 
-.int state;
-.float lastvol;
+entityclass(TargetMusic);
+class(TargetMusic) .int state;
+class(TargetMusic) .float lastvol;
 
 void TargetMusic_Advance();
 
index 1822acb5e467a2934b7c60aa80353d5c7d019636..aa7923bafc7a74bddc21f3ac08c3dd29a100492b 100644 (file)
@@ -1,8 +1,11 @@
-#if defined(CSQC)
-       #include "teamradar.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "teamradar.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+
+#include "../common/util.qh"
+
+#include "../csqcmodellib/interpolate.qh"
 
 float vlen2d(vector v)
 {
index 31defc8efbd6c3b3bb8f78d03eaf71fa7ee07da6..f7c186ac6258c119f75657e3cb0de13d189d1285 100644 (file)
@@ -3,11 +3,12 @@
 
 const int MAX_TEAMRADAR_TIMES = 32;
 
+entityclass(TeamRadar);
 // to make entities have dots on the team radar
-.float teamradar_icon;
-.float teamradar_times[MAX_TEAMRADAR_TIMES];
-.int teamradar_time_index;
-.vector teamradar_color;
+class(TeamRadar) .float teamradar_icon;
+class(TeamRadar) .float teamradar_times[MAX_TEAMRADAR_TIMES];
+class(TeamRadar) .int teamradar_time_index;
+class(TeamRadar) .vector teamradar_color;
 
 float teamradar_angle; // player yaw angle
 vector teamradar_origin3d_in_texcoord; // player origin
index 24506bef0c18acc5d02f5a3560dd1f386a4c69ab..b74024d508aa09b0bf5dab2b660447aa5f2d5f33 100644 (file)
@@ -1,7 +1,24 @@
 #include "tturrets.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "movelib.qh"
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "teamradar.qh"
 #include "waypointsprites.qh"
 
-#include "../server/movelib.qh"
+#include "../common/teams.qh"
+
+#include "../server/tturrets/include/turrets_early.qh"
+
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/mathlib.qh"
+
+.vector colormod;
+.float cnt;
+.float alpha;
+.float gravity;
 
 string tid2info_base;
 string tid2info_head;
@@ -162,7 +179,7 @@ void turret_remove()
     self.tur_head = world;
 }
 
-.vector glowmod;
+class(Turret) .vector glowmod;
 void turret_changeteam()
 {
        switch(self.team - 1)
index 6316d795b8899e0654a7e041073322a5329c496d..4cf9854c4656f3f69aa0e5abf333fecce6a0f36a 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef TTURRETS_H
 #define TTURRETS_H
 
-#include "../server/tturrets/include/turrets_early.qh"
-
 void ent_turret();
 void turrets_precache();
-.entity tur_head;
+entityclass(Turret);
+class(Turret) .entity tur_head;
 #endif
index cd518e091d3c2ecdd3677aaf7c2ca50a5f6217aa..b9f372db9d9e128d64ecdfda23a2fc336aad33b3 100644 (file)
@@ -1,4 +1,10 @@
 #include "tuba.qh"
+#include "_all.qh"
+
+#include "../common/constants.qh"
+#include "../common/util.qh"
+
+#include "../warpzonelib/mathlib.qh"
 
 #define TUBA_STARTNOTE(i, n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
 
@@ -6,11 +12,11 @@ const int TUBA_MIN = -18;
 const int TUBA_MAX = 27;
 const int TUBA_INSTRUMENTS = 3;
 
-.int note;
-.bool tuba_attenuate;
-.float tuba_volume;
-.float tuba_volume_initial;
-.int tuba_instrument;
+class(Tuba) .int note;
+class(Tuba) .bool tuba_attenuate;
+class(Tuba) .float tuba_volume;
+class(Tuba) .float tuba_volume_initial;
+class(Tuba) .int tuba_instrument;
 
 int Tuba_PitchStep;
 
index bdc1386eab666e352dd4d1ed9413a5d5fe237de3..6fe103f70676c62ff4f156e30aadea7a8f4a075f 100644 (file)
@@ -2,4 +2,7 @@
 #define TUBA_H
 void Ent_TubaNote(bool isNew);
 void Tuba_Precache();
+
+entityclass(Tuba);
+
 #endif
diff --git a/qcsrc/client/vehicles/bumblebee.qc b/qcsrc/client/vehicles/bumblebee.qc
new file mode 100644 (file)
index 0000000..8430668
--- /dev/null
@@ -0,0 +1,11 @@
+#include "../damage.qh"
+#include "../defs.qh"
+#include "../gibs.qh"
+#include "../hook.qh"
+#include "../main.qh"
+#include "../movetypes.qh"
+#include "../wall.qh"
+
+#include "../weapons/projectile.qh"
+
+#include "../../server/vehicles/bumblebee.qc"
diff --git a/qcsrc/client/vehicles/bumblebee.qh b/qcsrc/client/vehicles/bumblebee.qh
new file mode 100644 (file)
index 0000000..411eb36
--- /dev/null
@@ -0,0 +1 @@
+#include "../../server/vehicles/bumblebee.qh"
index 290385e495fcdd389aa4629b22fbe773a159d961..1582ecfcb84f6bc32bffd247bc46d8756bd04d76 100644 (file)
@@ -1,20 +1,20 @@
-#if defined(CSQC)
-    #include "../../dpdefs/csprogsdefs.qh"
-    #include "../defs.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/stats.qh"
-    #include "../../common/util.qh"
-    #include "../../common/buffs.qh"
-    #include "../autocvars.qh"
-    #include "../movetypes.qh"
-    #include "../prandom.qh"
-    #include "../main.qh"
-    #include "vehicles.qh"
-    #include "../../csqcmodellib/cl_model.qh"
-    #include "../../server/t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "vehicles.qh"
+#include "../_all.qh"
+
+#include "../movetypes.qh"
+#include "../movetypes.qh"
+#include "../prandom.qh"
+#include "../scoreboard.qh"
+#include "../t_items.qh"
+
+#include "../../common/buffs.qh"
+#include "../../common/constants.qh"
+#include "../../common/stats.qh"
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/cl_model.qh"
+
+.float cnt;
 
 const string hud_bg = "gfx/vehicles/frame.tga";
 const string hud_sh = "gfx/vehicles/vh-shield.tga";
@@ -51,19 +51,16 @@ const string raptor_bomb = "gfx/vehicles/raptor_bombs.tga";
 const string raptor_drop = "gfx/vehicles/axh-dropcross.tga";
 string raptor_xhair;
 
-void CSQC_WAKIZASHI_HUD();
-void CSQC_SPIDER_HUD();
-void CSQC_RAPTOR_HUD();
-void CSQC_BUMBLE_HUD();
-void CSQC_BUMBLE_GUN_HUD();
+
 
 const int MAX_AXH = 4;
-entity AuxiliaryXhair[MAX_AXH];
+entity AuxiliaryXhairs[MAX_AXH];
 
-.string axh_image;
-.float  axh_fadetime;
-.float  axh_drawflag;
-.float  axh_scale;
+entityclass(AuxiliaryXhair);
+class(AuxiliaryXhair) .string axh_image;
+class(AuxiliaryXhair) .float  axh_fadetime;
+class(AuxiliaryXhair) .float  axh_drawflag;
+class(AuxiliaryXhair) .float  axh_scale;
 
 const string bumb_ico =  "gfx/vehicles/bumb.tga";
 const string bumb_lgun =  "gfx/vehicles/bumb_lgun.tga";
@@ -107,7 +104,7 @@ void AuxiliaryXhair_Draw2D()
 void Net_AuXair2(bool bIsNew)
 {
     int axh_id = bound(0, ReadByte(), MAX_AXH);
-    entity axh                 = AuxiliaryXhair[axh_id];
+    entity axh                 = AuxiliaryXhairs[axh_id];
 
     if(axh == world || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
     {
@@ -119,7 +116,7 @@ void Net_AuXair2(bool bIsNew)
                axh.axh_image           = "gfx/vehicles/axh-ring.tga";
                axh.axh_scale           = 1;
         axh.alpha                      = 1;
-               AuxiliaryXhair[axh_id] = axh;
+               AuxiliaryXhairs[axh_id] = axh;
     }
 
        axh.move_origin_x = ReadCoord();
@@ -157,7 +154,7 @@ void Net_VehicleSetup()
     int i;
     for(i = 0; i < MAX_AXH; ++i)
     {
-        entity axh = AuxiliaryXhair[i];
+        entity axh = AuxiliaryXhairs[i];
         if(axh != world && !wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
             remove(axh);
 
@@ -169,59 +166,59 @@ void Net_VehicleSetup()
                axh.axh_image           = "gfx/vehicles/axh-ring.tga";
                axh.axh_scale           = 1;
         axh.alpha                      = 1;
-               AuxiliaryXhair[i]       = axh;
+               AuxiliaryXhairs[i]      = axh;
     }
 
     switch(hud_id)
     {
         case HUD_SPIDERBOT:
             // Minigun1
-            AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-ring.tga";
-            AuxiliaryXhair[0].axh_scale   = 0.25;
+            AuxiliaryXhairs[0].axh_image   = "gfx/vehicles/axh-ring.tga";
+            AuxiliaryXhairs[0].axh_scale   = 0.25;
             // Minigun2
-            AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-ring.tga";
-            AuxiliaryXhair[1].axh_scale   = 0.25;
+            AuxiliaryXhairs[1].axh_image   = "gfx/vehicles/axh-ring.tga";
+            AuxiliaryXhairs[1].axh_scale   = 0.25;
             // Rocket
-            AuxiliaryXhair[2].axh_image   = "gfx/vehicles/axh-special1.tga";
-            AuxiliaryXhair[2].axh_scale   = 0.5;
+            AuxiliaryXhairs[2].axh_image   = "gfx/vehicles/axh-special1.tga";
+            AuxiliaryXhairs[2].axh_scale   = 0.5;
             break;
 
         case HUD_WAKIZASHI:
-            AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
-            AuxiliaryXhair[0].axh_scale   = 0.25;
+            AuxiliaryXhairs[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
+            AuxiliaryXhairs[0].axh_scale   = 0.25;
             break;
 
         case HUD_RAPTOR:
-            AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-special2.tga";
-            AuxiliaryXhair[0].axh_scale   = 0.5;
+            AuxiliaryXhairs[0].axh_image   = "gfx/vehicles/axh-special2.tga";
+            AuxiliaryXhairs[0].axh_scale   = 0.5;
             //AuxiliaryXhair[0].alpha       = 0.5;
 
-            AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-bracket.tga";
-            AuxiliaryXhair[1].axh_scale   = 0.25;
+            AuxiliaryXhairs[1].axh_image   = "gfx/vehicles/axh-bracket.tga";
+            AuxiliaryXhairs[1].axh_scale   = 0.25;
             //AuxiliaryXhair[1].alpha       = 0.75;
             //AuxiliaryXhair[1].axh_drawflag  = DRAWFLAG_NORMAL;
             break;
 
         case HUD_BUMBLEBEE:
             // Raygun-locked
-            AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
-            AuxiliaryXhair[0].axh_scale   = 0.5;
+            AuxiliaryXhairs[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
+            AuxiliaryXhairs[0].axh_scale   = 0.5;
 
             // Gunner1
-            AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-target.tga";
-            AuxiliaryXhair[1].axh_scale   = 0.75;
+            AuxiliaryXhairs[1].axh_image   = "gfx/vehicles/axh-target.tga";
+            AuxiliaryXhairs[1].axh_scale   = 0.75;
 
             // Gunner2
-            AuxiliaryXhair[2].axh_image   = "gfx/vehicles/axh-target.tga";
-            AuxiliaryXhair[2].axh_scale   = 0.75;
+            AuxiliaryXhairs[2].axh_image   = "gfx/vehicles/axh-target.tga";
+            AuxiliaryXhairs[2].axh_scale   = 0.75;
             break;
         case HUD_BUMBLEBEE_GUN:
             // Plasma cannons
-            AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
-            AuxiliaryXhair[0].axh_scale   = 0.25;
+            AuxiliaryXhairs[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
+            AuxiliaryXhairs[0].axh_scale   = 0.25;
             // Raygun
-            AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-bracket.tga";
-            AuxiliaryXhair[1].axh_scale   = 0.25;
+            AuxiliaryXhairs[1].axh_image   = "gfx/vehicles/axh-bracket.tga";
+            AuxiliaryXhairs[1].axh_scale   = 0.25;
             break;
     }
 }
@@ -341,7 +338,7 @@ void CSQC_BUMBLE_HUD()
     drawresetcliparea();
 
 // Right gunner slot occupied?
-       if(!AuxiliaryXhair[1].draw2d)
+       if(!AuxiliaryXhairs[1].draw2d)
        {
                shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
                drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
@@ -363,7 +360,7 @@ void CSQC_BUMBLE_HUD()
     drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
     drawresetcliparea();
 // Left gunner slot occupied?
-       if(!AuxiliaryXhair[2].draw2d)
+       if(!AuxiliaryXhairs[2].draw2d)
        {
                shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
                drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
index 7e509e91ea8345d9b52914aa4414a50d66941f35..e8d3ddb4f75e5db4a7ea77f054af778627d48557 100644 (file)
@@ -6,4 +6,11 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang);
 void Vehicles_Precache();
 void Net_AuXair2(bool bIsNew);
 void Net_VehicleSetup();
+
+void CSQC_WAKIZASHI_HUD();
+void CSQC_SPIDER_HUD();
+void CSQC_RAPTOR_HUD();
+void CSQC_BUMBLE_HUD();
+void CSQC_BUMBLE_GUN_HUD();
+
 #endif
index 26e709320778a9892ae0493a7452d3a8d5d28257..3ffb4066c5080c2850743d747af51bf07a7aed70 100644 (file)
@@ -1,25 +1,31 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/stats.qh"
-       #include "../warpzonelib/mathlib.qh"
-       #include "../warpzonelib/common.qh"
-       #include "../warpzonelib/client.qh"
-       #include "../common/teams.qh"
-       #include "../common/util.qh"
-       #include "../common/nades.qh"
-       #include "../common/weapons/weapons.qh"
-       #include "../common/mapinfo.qh"
-       #include "autocvars.qh"
-       #include "hud.qh"
-       #include "scoreboard.qh"
-       #include "noise.qh"
-       #include "main.qh"
-       #include "../csqcmodellib/cl_player.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "_all.qh"
+
+#include "announcer.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "mapvoting.qh"
+#include "noise.qh"
+#include "scoreboard.qh"
+#include "shownames.qh"
+#include "target_music.qh"
+#include "vehicles/vehicles.qh"
+#include "waypointsprites.qh"
+
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/nades.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/cl_player.qh"
+
+#include "../warpzonelib/client.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
 
 entity porto;
 vector polyline[16];
index 1ae8fa85a311dccebaecdce7af6fd1216521d0b3..f591268d358919420adcbd57851bf6e98f8b0356 100644 (file)
@@ -1,4 +1,15 @@
 #include "wall.qh"
+#include "_all.qh"
+
+#include "bgmscript.qh"
+
+#include "../common/util.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
+.float alpha;
+.float scale;
+.vector movedir;
 
 void Ent_Wall_Draw()
 {
@@ -9,7 +20,7 @@ void Ent_Wall_Draw()
                fld = angles;
        else
                fld = origin;
-       self.fld = self.saved;
+       self.(fld) = self.saved;
 
        if(self.lodmodelindex1)
        {
@@ -38,16 +49,16 @@ void Ent_Wall_Draw()
 
        InterpolateOrigin_Do();
 
-       self.saved = self.fld;
+       self.saved = self.(fld);
 
-       f = BGMScript(self);
+       f = doBGMScript(self);
        if(f >= 0)
        {
                if(self.lip < 0) // < 0: alpha goes from 1 to 1-|lip| when toggled (toggling subtracts lip)
                        self.alpha = 1 + self.lip * f;
                else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip)
                        self.alpha = 1 - self.lip * (1 - f);
-               self.fld = self.fld + self.movedir * f;
+               self.(fld) = self.(fld) + self.movedir * f;
        }
        else
                self.alpha = 1;
@@ -77,7 +88,7 @@ void Ent_Wall()
                fld = angles;
        else
                fld = origin;
-       self.fld = self.saved;
+       self.(fld) = self.saved;
 
        f = ReadByte();
 
@@ -169,7 +180,7 @@ void Ent_Wall()
 
        InterpolateOrigin_Note();
 
-       self.saved = self.fld;
+       self.saved = self.(fld);
 
        self.entremove = Ent_Wall_Remove;
        self.draw = Ent_Wall_Draw;
index 984b54c88423d848bdc3356951f91d536aa0829a..57aef7e0c51959d9c11eae7b858ded57b3ad2bb9 100644 (file)
@@ -1,11 +1,12 @@
 #ifndef WALL_H
 #define WALL_H
 
-.float lip;
-.float bgmscriptangular;
-.int lodmodelindex0, lodmodelindex1, lodmodelindex2;
-.float loddistance1, loddistance2;
-.vector saved;
+entityclass(Wall);
+class(Wall) .float lip;
+class(Wall) .float bgmscriptangular;
+class(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
+class(Wall) .float loddistance1, loddistance2;
+class(Wall) .vector saved;
 
 void Ent_Wall_Draw();
 
index 788dd871eed84f74e2050375211ef9eca122ee20..dc38219b510c8442620cc27c701dec8258eb8d4d 100644 (file)
@@ -1,4 +1,20 @@
 #include "waypointsprites.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "teamradar.qh"
+
+#include "../common/buffs.qh"
+#include "../common/constants.qh"
+#include "../common/teams.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
+#include "../warpzonelib/mathlib.qh"
+
+.float alpha;
 
 void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
 {
index 3822793da1d0ef2b34260a07a850af138e9ab601..adea76ca7e47a6df9053f7c9edf1d87d24436946 100644 (file)
@@ -26,21 +26,22 @@ float waypointsprite_distancefadescale;
 float waypointsprite_distancefadedistance;
 float waypointsprite_alpha;
 
-.float helpme;
-.float rule;
-.string netname; // primary picture
-.string netname2; // secondary picture
-.string netname3; // tertiary picture
-.float team; // team that gets netname2
-.float lifetime;
-.float fadetime;
-.float maxdistance;
-.int hideflags;
-.float spawntime;
-.float health;
-.float build_started;
-.float build_starthealth;
-.float build_finished;
+entityclass(WaypointSprite);
+class(WaypointSprite) .float helpme;
+class(WaypointSprite) .float rule;
+class(WaypointSprite) .string netname; // primary picture
+class(WaypointSprite) .string netname2; // secondary picture
+class(WaypointSprite) .string netname3; // tertiary picture
+class(WaypointSprite) .int team; // team that gets netname2
+class(WaypointSprite) .float lifetime;
+class(WaypointSprite) .float fadetime;
+class(WaypointSprite) .float maxdistance;
+class(WaypointSprite) .int hideflags;
+class(WaypointSprite) .float spawntime;
+class(WaypointSprite) .float health;
+class(WaypointSprite) .float build_started;
+class(WaypointSprite) .float build_starthealth;
+class(WaypointSprite) .float build_finished;
 
 const float SPRITE_HEALTHBAR_WIDTH = 144;
 const float SPRITE_HEALTHBAR_HEIGHT = 9;
index 1d306fede6d6ce8733529821d373a7e16a371a0f..cd4f9b7441aee5483e0e9207591c8fb8cbe8912a 100644 (file)
@@ -1,5 +1,22 @@
 #include "projectile.qh"
 
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../main.qh"
+#include "../movetypes.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/nades.qh"
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/interpolate.qh"
+
+#include "../../warpzonelib/anglestransform.qh"
+
+.float alpha;
+.float scale;
+.vector colormod;
+
 void SUB_Stop()
 {
        self.move_velocity = self.move_avelocity = '0 0 0';
index 3a4cdcb0432614006f9bd74de807dd06fdf13c21..67e08c224bfd6f2a5f35dd8f3354c36e7d79be07 100644 (file)
@@ -1,20 +1,21 @@
 #ifndef PROJECTILE_H
 #define PROJECTILE_H
 
-.int traileffect;
-
-.vector iorigin1, iorigin2;
-.float spawntime;
-.vector trail_oldorigin;
-.float trail_oldtime;
-.float fade_time, fade_rate;
-
-.float alphamod;
-.int count; // set if clientside projectile
-.int cnt; // sound index
-.float gravity;
-.int snd_looping;
-.bool silent;
+entityclass(Projectile);
+class(Projectile) .int traileffect;
+
+class(Projectile) .vector iorigin1, iorigin2;
+class(Projectile) .float spawntime;
+class(Projectile) .vector trail_oldorigin;
+class(Projectile) .float trail_oldtime;
+class(Projectile) .float fade_time, fade_rate;
+
+class(Projectile) .float alphamod;
+class(Projectile) .int count; // set if clientside projectile
+class(Projectile) .int cnt; // sound index
+class(Projectile) .float gravity;
+class(Projectile) .int snd_looping;
+class(Projectile) .bool silent;
 
 void SUB_Stop();
 
index ecc840f6fbbe41358d381d26a8c12ffaac59de2d..0cba5d7f38b4d49b54f5d779e087571fe1bb7399 100644 (file)
@@ -295,10 +295,10 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f
                        upper = lower;
                if(e.frame1time != upper.y || e.frame2time != lower.y)
                        BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
-               e.fld_frame = upper.x;
-               e.fld_frame1time = upper.y;
-               e.fld_frame2 = lower.x;
-               e.fld_frame2time = lower.y;
+               e.(fld_frame) = upper.x;
+               e.(fld_frame1time) = upper.y;
+               e.(fld_frame2) = lower.x;
+               e.(fld_frame2time) = lower.y;
        }
        else
        {
@@ -308,8 +308,8 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f
                        upper = lower;
                if(e.frame1time != upper.y)
                        BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
-               e.fld_frame = upper.x;
-               e.fld_frame1time = upper.y;
+               e.(fld_frame) = upper.x;
+               e.(fld_frame1time) = upper.y;
        }
 }
 
index a629de6078cb9306fad799d63237bef310467714..f3437326365b87fe22d91b1250a90d7019e59498 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef BUFFS_H
 #define BUFFS_H
 
+#include "teams.qh"
+#include "util.qh"
+
 entity Buff_Type_first;
 entity Buff_Type_last;
 .entity enemy; // internal next pointer
diff --git a/qcsrc/common/command/command.qh b/qcsrc/common/command/command.qh
new file mode 100644 (file)
index 0000000..fa310fd
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef COMMAND_H
+#define COMMAND_H
+
+// =========================================================
+//  Shared declarations for all commands, written by Samual
+//  Last updated: December 13th, 2011
+// =========================================================
+
+// identifiers for subfunction requests by the command code structure
+const int CMD_REQUEST_COMMAND = 1;
+const int CMD_REQUEST_USAGE = 2;
+#endif
diff --git a/qcsrc/common/command/commands.qc b/qcsrc/common/command/commands.qc
new file mode 100644 (file)
index 0000000..dc1c044
--- /dev/null
@@ -0,0 +1,3 @@
+#include "generic.qc"
+#include "markup.qc"
+#include "rpn.qc"
diff --git a/qcsrc/common/command/commands.qh b/qcsrc/common/command/commands.qh
new file mode 100644 (file)
index 0000000..d434a86
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef COMMON_COMMANDS_H
+#define COMMON_COMMANDS_H
+
+#include "generic.qh"
+#include "markup.qh"
+#include "rpn.qh"
+
+#endif
index 7f302e0a27e3e25eff4a196eca39d71bfd7179f5..f0b6d0de5aecf72f81231100431fbc908a0fb037 100644 (file)
@@ -1,5 +1,28 @@
+#include "command.qh"
 #include "generic.qh"
-#include "shared_defs.qh"
+
+#include "markup.qh"
+#include "rpn.qh"
+
+#include "../mapinfo.qh"
+#include "../test.qh"
+
+#ifndef MENUQC
+       #include "../notifications.qh"
+#endif
+
+#ifdef CSQC
+       #include "../../client/command/cl_cmd.qh"
+#endif
+
+#ifdef SVQC
+       #include "../../server/command/banning.qh"
+       #include "../../server/command/cmd.qh"
+       #include "../../server/command/common.qh"
+       #include "../../server/command/sv_cmd.qh"
+
+       #include "../../common/weapons/config.qh"
+#endif
 
 // =========================================================
 //  Generic program common command code, written by Samual
index 0bb09b4e737a9eea3a87a2f20f9f65ff8bf7e6ea..e419824ec8eb8d0aadf82735805bf1193c5bc713 100644 (file)
@@ -1,8 +1,7 @@
-#ifndef GENERIC_H
-#define GENERIC_H
+#ifndef COMMAND_GENERIC_H
+#define COMMAND_GENERIC_H
 
-#include "markup.qh"
-#include "rpn.qh"
+#include "../constants.qh"
 
 // =========================================================
 //  Declarations for common command code, written by Samual
index 8030f9e0076d9a7f128cabdb2c672d4a02f5152b..9f0883bd61ba0ea6696dc9a9e443f1f1e733addb 100644 (file)
@@ -1,3 +1,4 @@
+#include "command.qh"
 #include "markup.qh"
 
 // =========================================================
index e6ac7cfbd3c810eb6e0aa5f40ba3095b567da606..bccc78d0bcd3537d43c4aaa1c91410d47fad7a26 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MARKUP_H
-#define MARKUP_H
+#ifndef COMMAND_MARKUP_H
+#define COMMAND_MARKUP_H
 
 // ==========================================================
 //  Declarations for markup command code, reworked by Samual
index bb920d697e91ce9e2dfc10b1bc4f4fd2e1a2c4a5..700ceb46ea02dc5fa5c210b5fc3e3a5074f98a28 100644 (file)
@@ -1,5 +1,8 @@
+#include "command.qh"
 #include "rpn.qh"
 
+#include "../../warpzonelib/mathlib.qh"
+
 // ========================================
 //  RPN command code, written by divVerent
 //  Last updated: December 28th, 2011
index a28f2946a904250f5c46dac92d609bb9194f8fce..3c5a8019b2a0cfee52c3ab8e9c500edde24563fa 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef RPN_H
-#define RPN_H
+#ifndef COMMAND_RPN_H
+#define COMMAND_RPN_H
 
 // =========================================================
 //  Declarations for RPN command code, written by divVerent
diff --git a/qcsrc/common/command/shared_defs.qh b/qcsrc/common/command/shared_defs.qh
deleted file mode 100644 (file)
index 0056565..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef SHARED_DEFS_H
-#define SHARED_DEFS_H
-
-// =========================================================
-//  Shared declarations for all commands, written by Samual
-//  Last updated: December 13th, 2011
-// =========================================================
-
-// identifiers for subfunction requests by the command code structure
-const int CMD_REQUEST_COMMAND = 1;
-const int CMD_REQUEST_USAGE = 2;
-#endif
index 17c5f89bcddf9968f07ddef29f0e0fadd99abc33..f464cdc32c5b8dce7efa1c7de08ce2ad78deaf79 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef COUNTING_H
 #define COUNTING_H
 
+#include "util.qh"
+
 // ===============================================
 //  Time processing and counting functions/macros
 // ===============================================
index 54255ec8d2aa153abfb6da7242d08b3635c40423..134103b89f3f9b49ea014916403ea772452ebf4b 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef MAPINFO_H
 #define MAPINFO_H
 
+#include "util.qh"
+
 int MAPINFO_TYPE_ALL;
 entity MapInfo_Type_first;
 entity MapInfo_Type_last;
@@ -10,7 +12,7 @@ entity MapInfo_Type_last;
 .string netname; // game type name as in cvar (with g_ prefix)
 .string mdl; // game type short name
 .string message; // human readable name
-.float team; // does this gametype support teamplay?
+.int team; // does this gametype support teamplay?
 .string model2; // game type defaults
 .string gametype_description; // game type description
 
diff --git a/qcsrc/common/monsters/all.inc b/qcsrc/common/monsters/all.inc
new file mode 100644 (file)
index 0000000..d30f298
--- /dev/null
@@ -0,0 +1,5 @@
+#include "monster/zombie.qc"
+#include "monster/spider.qc"
+#include "monster/mage.qc"
+#include "monster/wyvern.qc"
+#include "monster/shambler.qc"
diff --git a/qcsrc/common/monsters/all.qh b/qcsrc/common/monsters/all.qh
deleted file mode 100644 (file)
index c79a4e6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// TODO: include once
-//#ifndef MONSTERS_ALL_H
-//#define MONSTERS_ALL_H
-
-#include "monster/zombie.qc"
-#include "monster/spider.qc"
-#include "monster/mage.qc"
-#include "monster/wyvern.qc"
-#include "monster/shambler.qc"
-
-//#endif
index 096c2e5ea43a864874c37b9ce437215f8ae95e88..72c5ea870dcb832692268b55e7b17079ad576d2b 100644 (file)
@@ -1,6 +1,6 @@
 #include "monsters.qh"
 
-#include "all.qh"
+#include "all.inc"
 
 // MONSTER PLUGIN SYSTEM
 entity monster_info[MON_MAXCOUNT];
index 6fa9dfaf71a095a69a5d0f143e090d3f4ac0d13e..4aa1f7ef4c0625e6d007c6da9e7a0b97dee9445f 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef MONSTERS_H
 #define MONSTERS_H
 
+#include "../util.qh"
+
 // monster requests
 const int MR_SETUP = 1; // (SERVER) setup monster data
 const int MR_THINK = 2; // (SERVER) logic to run every frame
@@ -64,7 +66,7 @@ int MON_LAST;
        REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname)
 #endif
 
-#include "all.qh"
+#include "all.inc"
 
 #undef REGISTER_MONSTER
 ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done);
index 24ea1b9196c27545e56a8cd20750d8b959876d8d..3ff926bf614b9ba86fb38f0907c5bd4117c838a9 100644 (file)
@@ -15,7 +15,7 @@
     #include "../deathtypes.qh"
     #include "../../server/mutators/mutators_include.qh"
     #include "../../server/tturrets/include/turrets_early.qh"
-    #include "../../server/vehicles/vehicles_def.qh"
+    #include "../../server/vehicles/vehicle.qh"
     #include "../../server/campaign.qh"
     #include "../../server/command/common.qh"
     #include "../../server/command/cmd.qh"
@@ -275,9 +275,9 @@ float LoadMonsterSounds(string f, float first)
                field = GetMonsterSoundSampleField(argv(0));
                if(GetMonsterSoundSampleField_notFound)
                        continue;
-               if(self.field)
-                       strunzone(self.field);
-               self.field = strzone(strcat(argv(1), " ", argv(2)));
+               if (self.(field))
+                       strunzone(self.(field));
+               self.(field) = strzone(strcat(argv(1), " ", argv(2)));
        }
        fclose(fh);
        return 1;
@@ -305,7 +305,7 @@ void MonsterSound(.string samplefield, float sound_delay, float delaytoo, float
        if(delaytoo)
        if(time < self.msound_delay)
                return; // too early
-       GlobalSound(self.samplefield, chan, VOICETYPE_PLAYERSOUND);
+       GlobalSound(self.(samplefield), chan, VOICETYPE_PLAYERSOUND);
 
        self.msound_delay = time + sound_delay;
 }
index 505e2e2d541085369e74426b890bd9305f3fdc92..2b2aa857b806e9b7cd9efecb8da9b7017dcfb61e 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef NADES_H
 #define NADES_H
 
+#include "teams.qh"
+
 .float healer_lifetime;
 .float healer_radius;
 
index 7470cb88802edbcfe862ef36665ff800a3408dcc..a406df52419dc71d1bdf985e7aa963e83b988fa1 100644 (file)
@@ -946,8 +946,7 @@ void Create_Notification_Entity(
 #ifdef SVQC
 void Notification_GetCvars(void)
 {
-       float i;
-       for(i = 0; i <= NOTIF_CHOICE_COUNT; ++i)
+       for(int i = 0; i <= NOTIF_CHOICE_COUNT; ++i)
        {
                GetCvars_handleFloat(
                        get_cvars_s,
@@ -1763,8 +1762,7 @@ void Net_Notification_Remove()
        ));
        #endif
 
-       float i;
-       for(i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
+       for(int i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
        remove(self);
 }
 
@@ -1772,12 +1770,11 @@ float Net_Write_Notification(entity client, int sf)
 {
        if(Notification_ShouldSend(self.nent_broadcast, client, self.nent_client))
        {
-               float i;
                WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
                WriteByte(MSG_ENTITY, self.nent_net_type);
                WriteShort(MSG_ENTITY, self.nent_net_name);
-               for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
-               for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
+               for(int i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
+               for(int i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
                return true;
        }
        else { return false; }
@@ -2098,10 +2095,9 @@ void Send_Notification(
                net_notif.nent_stringcount = notif.nent_stringcount;
                net_notif.nent_floatcount = notif.nent_floatcount;
 
-               float i;
-               for(i = 0; i < net_notif.nent_stringcount; ++i)
+               for(int i = 0; i < net_notif.nent_stringcount; ++i)
                        { net_notif.nent_strings[i] = strzone(...(i, string)); }
-               for(i = 0; i < net_notif.nent_floatcount; ++i)
+               for(int i = 0; i < net_notif.nent_floatcount; ++i)
                        { net_notif.nent_floats[i] = ...((net_notif.nent_stringcount + i), float); }
 
                net_notif.think = Net_Notification_Remove;
index 1cb1adf51f368e9e97ad2d3b5afebc2cbb8595ee..83526614ab5e3e7b6ec5e6f9f481797bb5c9df2c 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "constants.qh"
 #include "teams.qh"
+#include "util.qh"
 
 // ================================================
 //  Unified notification system, written by Samual
index 481713cc9cb8f17df86aad4be260f8fd6f5ba76a..f888e1b2c8a10e00668841e8048c2eb9119b8549 100644 (file)
@@ -5,23 +5,38 @@
 // 255 is the current limit (MAX_CL_STATS - 1), engine will need to be modified if you wish to add more stats
 
 const int MAX_CL_STATS                = 256;
-const int STAT_HEALTH                 = 0;
+// -Wdouble-declaration
+// const int STAT_HEALTH                 = 0;
 // 1 empty?
 const int STAT_WEAPON                 = 2;
-const int STAT_AMMO                   = 3;
-const int STAT_ARMOR                  = 4;
-const int STAT_WEAPONFRAME            = 5;
-const int STAT_SHELLS                 = 6;
-const int STAT_NAILS                  = 7;
-const int STAT_ROCKETS                = 8;
-const int STAT_CELLS                  = 9;
-const int STAT_ACTIVEWEAPON           = 10;
-const int STAT_TOTALSECRETS           = 11;
-const int STAT_TOTALMONSTERS          = 12;
-const int STAT_SECRETS                = 13;
-const int STAT_MONSTERS               = 14;
-const int STAT_ITEMS                  = 15;
-const int STAT_VIEWHEIGHT             = 16;
+// -Wdouble-declaration
+// const int STAT_AMMO                   = 3;
+// -Wdouble-declaration
+// const int STAT_ARMOR                  = 4;
+// -Wdouble-declaration
+// const int STAT_WEAPONFRAME            = 5;
+// -Wdouble-declaration
+// const int STAT_SHELLS                 = 6;
+// -Wdouble-declaration
+// const int STAT_NAILS                  = 7;
+// -Wdouble-declaration
+// const int STAT_ROCKETS                = 8;
+// -Wdouble-declaration
+// const int STAT_CELLS                  = 9;
+// -Wdouble-declaration
+// const int STAT_ACTIVEWEAPON           = 10;
+// -Wdouble-declaration
+// const int STAT_TOTALSECRETS           = 11;
+// -Wdouble-declaration
+// const int STAT_TOTALMONSTERS          = 12;
+// -Wdouble-declaration
+// const int STAT_SECRETS                = 13;
+// -Wdouble-declaration
+// const int STAT_MONSTERS               = 14;
+// -Wdouble-declaration
+// const int STAT_ITEMS                  = 15;
+// -Wdouble-declaration
+// const int STAT_VIEWHEIGHT             = 16;
 // 17 empty?
 // 18 empty?
 // 19 empty?
@@ -270,14 +285,19 @@ const int STAT_MOVEVARS_AIRSTOPACCELERATE             = 231;
 const int STAT_MOVEVARS_AIRSTRAFEACCELERATE           = 232;
 const int STAT_MOVEVARS_MAXAIRSTRAFESPEED             = 233;
 const int STAT_MOVEVARS_AIRCONTROL                    = 234;
-const int STAT_FRAGLIMIT                              = 235;
-const int STAT_TIMELIMIT                              = 236;
+// -Wdouble-declaration
+// const int STAT_FRAGLIMIT                              = 235;
+// -Wdouble-declaration
+// const int STAT_TIMELIMIT                              = 236;
 const int STAT_MOVEVARS_WALLFRICTION                  = 237;
 const int STAT_MOVEVARS_FRICTION                      = 238;
 const int STAT_MOVEVARS_WATERFRICTION                 = 239;
-const int STAT_MOVEVARS_TICRATE                       = 240;
-const int STAT_MOVEVARS_TIMESCALE                     = 241;
-const int STAT_MOVEVARS_GRAVITY                       = 242;
+// -Wdouble-declaration
+// const int STAT_MOVEVARS_TICRATE                       = 240;
+// -Wdouble-declaration
+// const int STAT_MOVEVARS_TIMESCALE                     = 241;
+// -Wdouble-declaration
+// const int STAT_MOVEVARS_GRAVITY                       = 242;
 const int STAT_MOVEVARS_STOPSPEED                     = 243;
 const int STAT_MOVEVARS_MAXSPEED                      = 244;
 const int STAT_MOVEVARS_SPECTATORMAXSPEED             = 245;
index f246200378ff5adcccb374212c0972797f4c9661..a1ac7dc7adeabd5793fd129a19e19a366431d67e 100644 (file)
     const int false = 0;
 #endif
 
+#ifndef QCC_SUPPORT_ENTITYCLASS
+    #define entityclass(name) typedef entity name
+    #define class(name)
+    #define new(class) spawn()
+#else
+    #define entityclass(name) entityclass name {}
+    #define class(name) [[class(name)]]
+    #define new(class) ((class) spawn())
+#endif
+
 // Transitional aliases
 [[deprecated("use true")]] [[alias("true")]] const bool TRUE;
 [[deprecated("use false")]] [[alias("false")]] const bool FALSE;
 
+#define BIT(n) (1 << (n))
+#define BITSET(var, mask, flag) (flag ? (var) | (mask) : (var) &~ (mask))
+
 #endif
index f47bcf15ab0a8da92700c6b664c87e2a2e37c8ba..4a3b2dbf4924feebfb9bbf6e5b6a61c25d2bfa3f 100644 (file)
@@ -184,26 +184,26 @@ void depthfirst(entity start, .entity up, .entity downleft, .entity right, void(
        entity e;
        e = start;
        funcPre(pass, e);
-       while(e.downleft)
+       while (e.(downleft))
        {
-               e = e.downleft;
+               e = e.(downleft);
                funcPre(pass, e);
        }
        funcPost(pass, e);
        while(e != start)
        {
-               if(e.right)
+               if (e.(right))
                {
-                       e = e.right;
+                       e = e.(right);
                        funcPre(pass, e);
-                       while(e.downleft)
+                       while (e.(downleft))
                        {
-                               e = e.downleft;
+                               e = e.(downleft);
                                funcPre(pass, e);
                        }
                }
                else
-                       e = e.up;
+                       e = e.(up);
                funcPost(pass, e);
        }
 }
@@ -2294,7 +2294,7 @@ float xdecode(string s)
        return ((a * 22 + b) * 22 + c) * 22 + d;
 }
 
-float lowestbit(int f)
+int lowestbit(int f)
 {
        f &= ~(f * 2);
        f &= ~(f * 4);
@@ -2539,11 +2539,11 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
 
        // start with a 1-element queue
        queue_start = queue_end = e;
-       queue_end.fld = world;
+       queue_end.(fld) = world;
        queue_end.FindConnectedComponent_processing = 1;
 
        // for each queued item:
-       for (; queue_start; queue_start = queue_start.fld)
+       for (; queue_start; queue_start = queue_start.(fld))
        {
                // find all neighbors of queue_start
                entity t;
@@ -2554,16 +2554,16 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
                        if(iscon(t, queue_start, pass))
                        {
                                // it is connected? ADD IT. It will look for neighbors soon too.
-                               queue_end.fld = t;
+                               queue_end.(fld) = t;
                                queue_end = t;
-                               queue_end.fld = world;
+                               queue_end.(fld) = world;
                                queue_end.FindConnectedComponent_processing = 1;
                        }
                }
        }
 
        // unmark
-       for(queue_start = e; queue_start; queue_start = queue_start.fld)
+       for (queue_start = e; queue_start; queue_start = queue_start.(fld))
                queue_start.FindConnectedComponent_processing = 0;
 }
 
index a59d31cacf18b1c9a5c64cf556ad14acffd0ab25..2e41ce76ca796a1868b06085ff6dc197e06e7c86 100644 (file)
@@ -296,7 +296,7 @@ float xdecode(string s);
 // Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
 #define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0)
 
-float lowestbit(float f);
+int lowestbit(float f);
 
 #ifdef CSQC
 entity ReadCSQCEntity();
@@ -385,12 +385,12 @@ string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimport
 string CCR(string input);
 
 #ifndef MENUQC
-#ifdef CSQC
-#define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
-#else
-#define GENTLE autocvar_sv_gentle
-#endif
-#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
+       #ifdef CSQC
+               #define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
+       #else
+               #define GENTLE autocvar_sv_gentle
+       #endif
+       #define normal_or_gentle(normal, gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
 #endif
 
 // allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
diff --git a/qcsrc/common/weapons/all.inc b/qcsrc/common/weapons/all.inc
new file mode 100644 (file)
index 0000000..4f4cd2b
--- /dev/null
@@ -0,0 +1,29 @@
+// ONLY EVER ADD NEW WEAPONS AT THE END. IF YOU REMOVE ONE, PUT THE LAST ONE ON
+// ITS PLACE. THIS IS TO AVOID UNNECESSARY RENUMBERING OF WEAPON IMPULSES.
+// IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
+
+// core weapons
+#include "w_blaster.qc"
+#include "w_shotgun.qc"
+#include "w_machinegun.qc"
+#include "w_mortar.qc"
+#include "w_minelayer.qc"
+#include "w_electro.qc"
+#include "w_crylink.qc"
+#include "w_vortex.qc"
+#include "w_hagar.qc"
+#include "w_devastator.qc"
+
+// other weapons
+#include "w_porto.qc"
+#include "w_vaporizer.qc"
+#include "w_hook.qc"
+#include "w_hlac.qc"
+#include "w_tuba.qc"
+#include "w_rifle.qc"
+#include "w_fireball.qc"
+#include "w_seeker.qc"
+#include "w_shockwave.qc"
+#include "w_arc.qc"
+#include "w_hmg.qc"
+#include "w_rpc.qc"
diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh
deleted file mode 100644 (file)
index b4ee1e2..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// TODO: include once
-//#ifndef WEAPONS_ALL_H
-//#define WEAPONS_ALL_H
-
-#include "../util.qh"
-
-#ifdef SVQC
-#   include "config.qh"
-#   include "../../server/bot/aim.qh"
-#endif
-
-// ONLY EVER ADD NEW WEAPONS AT THE END. IF YOU REMOVE ONE, PUT THE LAST ONE ON
-// ITS PLACE. THIS IS TO AVOID UNNECESSARY RENUMBERING OF WEAPON IMPULSES.
-// IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
-
-// core weapons
-#include "w_blaster.qc"
-#include "w_shotgun.qc"
-#include "w_machinegun.qc"
-#include "w_mortar.qc"
-#include "w_minelayer.qc"
-#include "w_electro.qc"
-#include "w_crylink.qc"
-#include "w_vortex.qc"
-#include "w_hagar.qc"
-#include "w_devastator.qc"
-
-// other weapons
-#include "w_porto.qc"
-#include "w_vaporizer.qc"
-#include "w_hook.qc"
-#include "w_hlac.qc"
-#include "w_tuba.qc"
-#include "w_rifle.qc"
-#include "w_fireball.qc"
-#include "w_seeker.qc"
-#include "w_shockwave.qc"
-#include "w_arc.qc"
-#include "w_hmg.qc"
-#include "w_rpc.qc"
-
-//#endif
index 3ab584fc1e7fb63d8be9dd8ec2b73c88d0996819..58fdbaed44b9e05473888bb39a3ceb0012c278be 100644 (file)
@@ -54,7 +54,7 @@
 #ifndef MENUQC
 #include "calculations.qc"
 #endif
-#include "all.qh"
+#include "all.inc"
 
 // WEAPON PLUGIN SYSTEM
 entity weapon_info[WEP_MAXCOUNT];
index 593a40e3e8d8f40d9620096981ad4082954a9ab6..5f17ccb8f10fd28f5d18c09533f1a5aa34d59cff 100644 (file)
@@ -5,6 +5,10 @@
 #include "calculations.qh"
 #endif
 
+#include "../util.qh"
+#ifdef SVQC
+#include "../../server/bot/aim.qh"
+#endif
 const int MAX_SHOT_DISTANCE = 32768;
 
 // weapon pickup ratings for bot logic
@@ -199,7 +203,7 @@ void register_weapons_done();
        REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname)
 #endif
 
-#include "all.qh"
+#include "all.inc"
 
 #undef WEP_ADD_CVAR_MO_PRI
 #undef WEP_ADD_CVAR_MO_SEC
index 4effe6492446b65192b91d838bebd11da4828c1b..c4d8c54ce05c4b6b847a36f54d1d6672beda0379 100644 (file)
 
 #pragma noref 1
 
-/*
-==============================================================================
+#define true _true
+#define false _false
+#define TRUE _TRUE
+#define FALSE _FALSE
 
-                       SOURCE FOR GLOBALVARS_T C STRUCTURE
-                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+#include "upstream/csprogsdefs.qc"
 
-==============================================================================
-*/
-
-//
-// system globals
-//
-entity         self;
-entity         other;
-entity         world;
-float          time;
-float          frametime;
-
-int            player_localentnum;     //the entnum
-int            player_localnum;        //the playernum
-float          maxclients;     //a constant filled in by the engine. gah, portability eh?
-
-float          clientcommandframe;     //player movement
-float          servercommandframe;     //clientframe echoed off the server
-
-string         mapname;
-
-//
-// global variables set by built in functions
-//
-vector         v_forward, v_up, v_right;       // set by makevectors()
-
-// set by traceline / tracebox
-float          trace_allsolid;
-float          trace_startsolid;
-float          trace_fraction;
-vector         trace_endpos;
-vector         trace_plane_normal;
-float          trace_plane_dist;
-entity         trace_ent;
-float          trace_inopen;
-float          trace_inwater;
-
-//
-// required prog functions
-//
-void()         CSQC_Init;
-void()         CSQC_Shutdown;
-float(float f, float t, float n)       CSQC_InputEvent;
-void(float w, float h)         CSQC_UpdateView;
-bool(string s) CSQC_ConsoleCommand;
-
-//these fields are read and set by the default player physics
-vector         pmove_org;
-vector         pmove_vel;
-vector         pmove_mins;
-vector         pmove_maxs;
-//retrieved from the current movement commands (read by player physics)
-float          input_timelength;
-vector         input_angles;
-vector         input_movevalues;       //forwards, right, up.
-int                    input_buttons;          //attack, use, jump (default physics only uses jump)
-
-float          movevar_gravity;
-float          movevar_stopspeed;
-float          movevar_maxspeed;
-float          movevar_spectatormaxspeed;      //used by NOCLIP movetypes.
-float          movevar_accelerate;
-float          movevar_airaccelerate;
-float          movevar_wateraccelerate;
-float          movevar_friction;
-float          movevar_waterfriction;
-float          movevar_entgravity;     //the local player's gravity field. Is a multiple (1 is the normal value)
-
-//================================================
-void           end_sys_globals;                // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
-                       SOURCE FOR ENTVARS_T C STRUCTURE
-                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
-
-==============================================================================
-*/
-
-//
-// system fields (*** = do not set in prog code, maintained by C code)
-//
-.int           modelindex;             // *** model index in the precached list
-.vector                absmin, absmax; // *** origin + mins / maxs
-
-.int           entnum; // *** the ent number as on the server
-.float         drawmask;
-.void()                predraw;
-
-.float         movetype;
-.float         solid;
-
-.vector                origin;                 // ***
-.vector                oldorigin;              // ***
-.vector                velocity;
-.vector                angles;
-.vector                avelocity;
-
-.string                classname;              // spawn function
-.string                model;
-.int           frame;
-.int           skin;
-.int           effects;
-
-.vector                mins, maxs;             // bounding box extents reletive to origin
-.vector                size;                   // maxs - mins
-
-.void()                touch;
-.void()                use;
-.void()                think;
-.void()                blocked;                // for doors or plats, called when can't push other
-
-.float         nextthink;
-
-.entity                chain;
-
-.string                netname;
-
-.entity        enemy;
-
-.int           flags;
-
-.int           colormap;
-
-.entity                owner;          // who launched a missile
-
-//================================================
-void           end_sys_fields;                 // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
-                       OPTIONAL FIELDS AND GLOBALS
-
-==============================================================================
-*/
-
-// Additional OPTIONAL Fields and Globals
-float          intermission; // indicates intermission state (0 = normal, 1 = scores, 2 = finale text)
-
-vector         view_angles; // same as input_angles
-vector         view_punchangle; // from server
-vector         view_punchvector; // from server
-
-/*
-==============================================================================
-
-                       CONSTANT DEFINITIONS
-
-==============================================================================
-*/
-
-const int MASK_ENGINE                  = 1;
-const int MASK_ENGINEVIEWMODELS        = 2;
-const int MASK_NORMAL                  = 4;
-
-const int RF_VIEWMODEL                 = 1;
-const int RF_EXTERNALMODEL             = 2;
-const int RF_DEPTHHACK                 = 4;
-const int RF_ADDITIVE                  = 8;
-const int RF_USEAXIS                   = 16;
-
-const int VF_MIN                               = 1;    //(vector)
-const int VF_MIN_X                             = 2;    //(float)
-const int VF_MIN_Y                             = 3;    //(float)
-const int VF_SIZE                              = 4;    //(vector) (viewport size)
-const int VF_SIZE_Y                            = 5;    //(float)
-const int VF_SIZE_X                            = 6;    //(float)
-const int VF_VIEWPORT                  = 7;    //(vector, vector)
-const int VF_FOV                               = 8;    //(vector)
-const int VF_FOVX                              = 9;    //(float)
-const int VF_FOVY                              = 10;   //(float)
-const int VF_ORIGIN                            = 11;   //(vector)
-const int VF_ORIGIN_X                  = 12;   //(float)
-const int VF_ORIGIN_Y                  = 13;   //(float)
-const int VF_ORIGIN_Z                  = 14;   //(float)
-const int VF_ANGLES                            = 15;   //(vector)
-const int VF_ANGLES_X                  = 16;   //(float)
-const int VF_ANGLES_Y                  = 17;   //(float)
-const int VF_ANGLES_Z                  = 18;   //(float)
-const int VF_DRAWWORLD                 = 19;   //(float)
-const int VF_DRAWENGINESBAR            = 20;   //(float)
-const int VF_DRAWCROSSHAIR             = 21;   //(float)
-
-const int VF_CL_VIEWANGLES             = 33;   //(vector)
-const int VF_CL_VIEWANGLES_X   = 34;   //(float)
-const int VF_CL_VIEWANGLES_Y   = 35;   //(float)
-const int VF_CL_VIEWANGLES_Z   = 36;   //(float)
-
-const int VF_PERSPECTIVE       = 200;
-
-//const int STAT_HEALTH                        = 0;
-//const int STAT_WEAPONMODEL   = 2;
-//const int STAT_AMMO                  = 3;
-//const int STAT_ARMOR                 = 4;
-//const int STAT_WEAPONFRAME   = 5;
-//const int STAT_SHELLS                        = 6;
-//const int STAT_NAILS                 = 7;
-//const int STAT_ROCKETS               = 8;
-//const int STAT_CELLS                 = 9;
-//const int STAT_ACTIVEWEAPON  = 10;
-//const int STAT_TOTALSECRETS  = 11;
-//const int STAT_TOTALMONSTERS = 12;
-//const int STAT_SECRETS               = 13;
-//const int STAT_MONSTERS              = 14;
-//const int STAT_ITEMS                 = 15;
-//const int STAT_VIEWHEIGHT            = 16;
-
-// Quake Sound Constants
-const int CHAN_AUTO                            = 0;
-const int CHAN_WEAPON                  = 1;
-const int CHAN_VOICE                   = 2;
-const int CHAN_ITEM                            = 3;
-const int CHAN_BODY                            = 4;
-
-const int ATTN_NONE                            = 0;
-const int ATTN_NORM                            = 1;
-const int ATTN_IDLE                            = 2;
-const int ATTN_STATIC                  = 3;
-
-// Frik File Constants
-const int FILE_READ                            = 0;
-const int FILE_APPEND                  = 1;
-const int FILE_WRITE                   = 2;
-
-// Quake Point Contents
-const int CONTENT_EMPTY                        = -1;
-const int CONTENT_SOLID                        = -2;
-const int CONTENT_WATER                        = -3;
-const int CONTENT_SLIME                        = -4;
-const int CONTENT_LAVA                 = -5;
-const int CONTENT_SKY                  = -6;
-
-// Quake Solid Constants
-const int SOLID_NOT                            = 0;
-const int SOLID_TRIGGER                        = 1;
-const int SOLID_BBOX                   = 2;
-const int SOLID_SLIDEBOX               = 3;
-const int SOLID_BSP                            = 4;
-const int SOLID_CORPSE                 = 5;
-
-// Quake Move Constants
-const int MOVE_NORMAL                  = 0;
-const int MOVE_NOMONSTERS              = 1;
-const int MOVE_MISSILE                 = 2;
-
-const float EXTRA_LOW                  = -99999999;
-const float EXTRA_HIGH                 = 99999999;
-
-const vector VEC_1                             = '1 1 1';
-const vector VEC_0                             = '0 0 0';
-const vector VEC_M1                            = '-1 -1 -1';
-
-//const float M_PI                             = 3.14159265358979323846;
-
-vector VEC_HULL_MIN                            = '-16 -16 -24';
-vector VEC_HULL_MAX                            = '16 16 32';
-
-// Quake Temporary Entity Constants
-const int TE_SPIKE                             = 0;
-const int TE_SUPERSPIKE                        = 1;
-const int TE_GUNSHOT                   = 2;
-const int TE_EXPLOSION                 = 3;
-const int TE_TAREXPLOSION              = 4;
-const int TE_LIGHTNING1                        = 5;
-const int TE_LIGHTNING2                        = 6;
-const int TE_WIZSPIKE                  = 7;
-const int TE_KNIGHTSPIKE               = 8;
-const int TE_LIGHTNING3                        = 9;
-const int TE_LAVASPLASH                        = 10;
-const int TE_TELEPORT                  = 11;
-const int TE_EXPLOSION2                        = 12;
-
-// Darkplaces Additions
-const int TE_EXPLOSIONRGB              = 53;
-const int TE_GUNSHOTQUAD               = 57;
-const int TE_EXPLOSIONQUAD             = 70;
-const int TE_SPIKEQUAD                 = 58;
-const int TE_SUPERSPIKEQUAD            = 59;
-
-// PFlags for Dynamic Lights
-const int PFLAGS_NOSHADOW              = 1;
-const int PFLAGS_CORONA                        = 2;
-const int PFLAGS_FULLDYNAMIC   = 128;
-
-const int EF_ADDITIVE                  = 32;
-const int EF_BLUE                              = 64;
-const int EF_FLAME                             = 1024;
-const int EF_FULLBRIGHT                        = 512;
-const int EF_NODEPTHTEST               = 8192;
-const int EF_NODRAW                            = 16;
-const int EF_NOSHADOW                  = 4096;
-const int EF_RED                               = 128;
-const int EF_STARDUST                  = 2048;
-const int EF_SELECTABLE                = 16384;
-
-const int PFL_ONGROUND                 = 1;
-const int PFL_CROUCH                   = 2;
-const int PFL_DEAD                             = 4;
-const int PFL_GIBBED                   = 8;
-
-// draw flags
-const int DRAWFLAG_NORMAL              = 0;
-const int DRAWFLAG_ADDITIVE    = 1;
-const int DRAWFLAG_MODULATE    = 2;
-const int DRAWFLAG_2XMODULATE  = 3;
-const int DRAWFLAG_SCREEN              = 4;
-const int DRAWFLAG_MIPMAP              = 0x100; // only for R_BeginPolygon
-
-/*
-==============================================================================
-
-                       BUILTIN DEFINITIONS
-                       EXTENSIONS ARE NOT ADDED HERE, BUT BELOW!
-
-==============================================================================
-*/
-
-void(vector ang) makevectors = #1;
-void(entity e, vector o) setorigin = #2;
-void(entity e, string m) setmodel = #3;
-void(entity e, vector min, vector max) setsize = #4;
-
-void() break_to_debugger = #6;
-float() random = #7;
-void(entity e, float chan, string samp) sound = #8;
-vector(vector v) normalize = #9;
-void(string e) error = #10;
-void(string e) objerror = #11;
-float(vector v) vlen = #12;
-float(vector v) vectoyaw = #13;
-entity() spawn = #14;
-void(entity e) remove = #15;
-float(vector v1, vector v2, float tryents, entity ignoreentity) traceline = #16;
-
-entity(entity start, .string fld, string match) find = #18;
-void(string s) precache_sound = #19;
-void(string s) precache_model = #20;
-
-entity(vector org, float rad) findradius = #22;
-
-void(string s, ...) dprint = #25;
-string(float f) ftos = #26;
-string(vector v) vtos = #27;
-void() coredump = #28;
-void() traceon = #29;
-void() traceoff = #30;
-void(entity e) eprint = #31;
-// settrace optional
-float(float yaw, float dist, float settrace) walkmove = #32;
-
-float() droptofloor = #34;
-void(float style, string value) lightstyle = #35;
-int(float v) rint      = #36;
-int(float v) floor     = #37;
-int(float v) ceil      = #38;
-
-float(entity e) checkbottom = #40;
-float(vector v) pointcontents = #41;
-
-float(float f) fabs = #43;
-
-float(string s) cvar = #45;
-void(string s, ...) localcmd = #46;
-entity(entity e) nextent = #47;
-void(vector o, vector d, float color, float count) particle = #48;
-void() ChangeYaw = #49;
-
-vector(vector v) vectoangles = #51;
-vector(vector v, vector w) vectoangles2 = #51;
-
-float(float f) sin = #60;
-float(float f) cos = #61;
-float(float f) sqrt = #62;
-void(entity ent) changepitch = #63;
-void(entity e, entity ignore) tracetoss = #64;
-string(entity ent) etos = #65;
-
-string(string s) precache_file = #68;
-void(entity e) makestatic = #69;
-
-void(string name, string value) cvar_set = #72;
-
-void(vector pos, string samp, float vol, float atten) ambientsound = #74;
-string(string s) precache_model2 = #75;
-string(string s) precache_sound2 = #76;
-string(string s) precache_file2 = #77;
-
-float(string s) stof = #81;
-
-
-void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
-vector() randomvec = #91;
-vector(vector org) getlight = #92;
-vector(vector org, float lpflags) getlight2 = #92;
-vector getlight_dir;
-vector getlight_ambient;
-vector getlight_diffuse;
-const float LP_LIGHTMAP        = 1;
-const float LP_RTWORLD = 2;
-const float LP_DYNLIGHT = 4;
-const float LP_COMPLETE = 7;
-
-float(string name, string value) registercvar = #93;
-float( float a, ... ) min = #94;
-float( float b, ... ) max = #95;
-float(float minimum, float val, float maximum) bound = #96;
-float(float f, float f) pow = #97;
-entity(entity start, .float fld, float match) findfloat = #98;
-float(string s) checkextension = #99;
-// FrikaC and Telejano range #100-#199
-
-int(string filename, int mode) fopen = #110;
-void(float fhandle) fclose = #111;
-string(float fhandle) fgets = #112;
-void(float fhandle, string s) fputs = #113;
-float(string s) strlen = #114;
-string(...) strcat = #115;
-string(string s, float start, float length) substring = #116;
-vector(string) stov = #117;
-string(string s) strzone = #118;
-void(string s) strunzone = #119;
-
-// FTEQW range #200-#299
-
-float(float number, float quantity) bitshift = #218;
-
-//float(string str, string sub[, float startpos]) strstrofs = #221;
-int(string str, string sub, float startpos) strstrofs = #221;
-int(string str, float ofs) str2chr = #222;
-string(int c, ...) chr2str = #223;
-string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
-string(float chars, string s, ...) strpad = #225;
-string(string info, string key, string value, ...) infoadd = #226;
-string(string info, string key) infoget = #227;
-int(string s1, string s2) strcmp = #228;
-int(string s1, string s2, float len) strncmp = #228;
-int(string s1, string s2) strcasecmp = #229;
-int(string s1, string s2, float len) strncasecmp = #230;
-
-// CSQC range #300-#399
-void() clearscene = #300;
-void(float mask) addentities = #301;
-void(entity ent) addentity = #302;
-float(float property, ...) setproperty = #303;
-float(float property) getproperty = #309;
-vector(float property) getpropertyvec = #309;
-void() renderscene = #304;
-void(vector org, float radius, vector lightcolours) adddynamiclight = #305;
-void(vector org, float radius, vector lightcolours, float style, string cubemapname, float pflags) adddynamiclight2 = #305;
-//void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon = #306;
-void(string texturename, float flag, ...) R_BeginPolygon = #306;
-void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
-void() R_EndPolygon = #308;
-vector (vector v) cs_unproject = #310;
-vector (vector v) cs_project = #311;
-
-void(float width, vector pos1, vector pos2, float flag) drawline = #315;
-float(string name) iscachedpic = #316;
-string(string name, ...) precache_pic = #317;
-string(string name) precache_cubemap = #317;
-vector(string picname) draw_getimagesize = #318;
-void(string name) freepic = #319;
-float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter = #320;
-float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #321;
-float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic = #322;
-float(vector position, vector size, vector rgb, float alpha, float flag) drawfill = #323;
-void(float x, float y, float width, float height) drawsetcliparea = #324;
-void(void) drawresetcliparea = #325;
-float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
-vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
-
-float(int stnum) getstatf = #330;
-int(int stnum, ...) getstati = #331; // can optionally take first bit and count
-string(float firststnum) getstats = #332;
-void(entity e, float mdlindex) setmodelindex = #333;
-string(float mdlindex) modelnameforindex = #334;
-int(string effectname) particleeffectnum = #335;
-void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
-//void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
-void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
-void(string s, ...) centerprint = #338;
-void(string s, ...) print = #339;
-string(float keynum) keynumtostring = #340;
-float(string keyname) stringtokeynum = #341;
-string(float keynum) getkeybind = #342;
-void(float usecursor) setcursormode = #343;
-vector() getmousepos = #344;
-float(float framenum) getinputstate = #345;
-void(float sens) setsensitivityscale = #346;
-void(...) runstandardplayerphysics = #347; // this may or may not take a player ent
-string(float playernum, string keyname) getplayerkeyvalue = #348;
-float() isdemo = #349;
-float() isserver = #350;
-void(vector origin, vector forward, vector right, vector up) SetListener = #351;
-void(string cmdname) registercommand = #352;
-float(entity ent) wasfreed = #353;
-string(string key) serverkey = #354;
-
-// Use proper case; refer to the id1 Write* functions!
-int() ReadByte         = #360;
-int() ReadChar         = #361;
-int() ReadShort                = #362;
-int() ReadLong         = #363;
-float() ReadCoord      = #364;
-float() ReadAngle      = #365;
-string() ReadString    = #366;
-float() ReadFloat      = #367;
-
-// LordHavoc's range #400-#499
-void(entity from, entity to) copyentity = #400;
-
-entity(.string fld, string match) findchain = #402;
-entity(.float fld, float match) findchainfloat = #403;
-void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
-void(vector org, vector velocity, float howmany) te_blood = #405;
-void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
-void(vector org, vector color) te_explosionrgb = #407;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
-void(vector org, vector vel, float howmany) te_spark = #411;
-void(vector org) te_gunshotquad = #412;
-void(vector org) te_spikequad = #413;
-void(vector org) te_superspikequad = #414;
-void(vector org) te_explosionquad = #415;
-void(vector org) te_smallflash = #416;
-void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
-void(vector org) te_gunshot = #418;
-void(vector org) te_spike = #419;
-void(vector org) te_superspike = #420;
-void(vector org) te_explosion = #421;
-void(vector org) te_tarexplosion = #422;
-void(vector org) te_wizspike = #423;
-void(vector org) te_knightspike = #424;
-void(vector org) te_lavasplash = #425;
-void(vector org) te_teleport = #426;
-void(vector org, float colorstart, float colorlength) te_explosion2 = #427;
-void(entity own, vector start, vector end) te_lightning1 = #428;
-void(entity own, vector start, vector end) te_lightning2 = #429;
-void(entity own, vector start, vector end) te_lightning3 = #430;
-void(entity own, vector start, vector end) te_beam = #431;
-void(vector dir) vectorvectors = #432;
-void(vector org) te_plasmaburn = #433;
-//float(entity e, float s) getsurfacenumpoints = #434;
-//vector(entity e, float s, float n) getsurfacepoint = #435;
-//vector(entity e, float s) getsurfacenormal = #436;
-//string(entity e, float s) getsurfacetexture = #437;
-//float(entity e, vector p) getsurfacenearpoint = #438;
-//vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
-
-int(string s) tokenize = #441;
-string(float n) argv = #442;
-void(entity e, entity tagentity, string tagname) setattachment = #443;
-float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
-void(float handle) search_end = #445;
-float(float handle) search_getsize = #446;
-string(float handle, float num) search_getfilename = #447;
-string(string s) cvar_string = #448;
-entity(entity start, .float fld, float match) findflags = #449;
-entity(.float fld, float match) findchainflags = #450;
-int(entity ent, string tagname) gettagindex = #451;
-vector(entity ent, float tagindex) gettaginfo = #452;
-
-void(vector org, vector vel, float howmany) te_flamejet = #457;
-
-entity(float num) entitybyindex = #459;
-int() buf_create = #460;
-void(float bufhandle) buf_del = #461;
-float(float bufhandle) buf_getsize = #462;
-void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
-void(float bufhandle, float sortpower, float backward) buf_sort = #464;
-string(float bufhandle, string glue) buf_implode = #465;
-string(float bufhandle, float string_index) bufstr_get = #466;
-void(float bufhandle, float string_index, string str) bufstr_set = #467;
-float(float bufhandle, string str, float order) bufstr_add = #468;
-void(float bufhandle, float string_index) bufstr_free = #469;
-
-//float(float s) asin = #471;
-//float(float c) acos = #472;
-//float(float t) atan = #473;
-//float(float c, float s) atan2 = #474;
-//float(float a) tan = #475;
-float(string s) strippedstringlen = #476;
-float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
-string(string s) decolorizedstring = #477;
-string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
-string(float uselocaltime, string format, ...) strftime = #478;
-string(string s) strtolower = #480;
-string(string s) strtoupper = #481;
-string(string s) cvar_defstring = #482;
-void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
-string(string search, string replace, string subject) strreplace = #484;
-string(string search, string replace, string subject) strireplace = #485;
-//vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-#ifdef SUPPORT_GECKO
-float gecko_create( string name ) = #487;
-void gecko_destroy( string name ) = #488;
-void gecko_navigate( string name, string URI ) = #489;
-float gecko_keyevent( string name, float key, float eventtype ) = #490;
-void gecko_mousemove( string name, float x, float y ) = #491;
-void gecko_resize( string name, float w, float h ) = #492;
-vector gecko_get_texture_extent( string name ) = #493;
-#else
-
-#endif
-
-/*
-==============================================================================
-
-                       EXTENSION DEFINITIONS
-
-==============================================================================
-*/
-
-// DP_CSQC_SPAWNPARTICLE
-// idea: VorteX
-// darkplaces implementation: VorteX
-// constant definitions:
-// particle base behavior:
-float PT_ALPHASTATIC = 1;
-float PT_STATIC = 2;
-float PT_SPARK = 3;
-float PT_BEAM = 4;
-float PT_RAIN = 5;
-float PT_RAINDECAL = 6;
-float PT_SNOW = 7;
-float PT_BUBBLE = 8;
-float PT_BLOOD = 9;
-float PT_SMOKE = 10;
-float PT_DECAL = 11;
-float PT_ENTITYPARTICLE = 12;
-// particle blendtypes:
-float PBLEND_ALPHA = 0;
-float PBLEND_ADD = 1;
-float PBLEND_INVMOD = 2;
-// particle orientation:
-float PARTICLE_BILLBOARD = 0;
-float PARTICLE_SPARK = 1;
-float PARTICLE_ORIENTED_DOUBLESIDED = 2;
-float PARTICLE_BEAM = 3;
-// global definitions:
-float particle_type; // one of PT_
-float particle_blendmode; // one of PBLEND_ values
-float particle_orientation; // one of PARTICLE_ values
-vector particle_color1;
-vector particle_color2;
-float particle_tex; // number of chunk in particlefont
-float particle_size;
-float particle_sizeincrease;
-float particle_alpha;
-float particle_alphafade;
-float particle_time;
-float particle_gravity;
-float particle_bounce;
-float particle_airfriction;
-float particle_liquidfriction;
-float particle_originjitter;
-float particle_velocityjitter;
-float particle_qualityreduction; // enable culling of this particle when FPS is low
-float particle_stretch;
-vector particle_staincolor1;
-vector particle_staincolor2;
-float particle_staintex;
-float particle_stainalpha;
-float particle_stainsize;
-float particle_delayspawn;
-float particle_delaycollision;
-float particle_angle;
-float particle_spin;
-// builtin definitions:
-float(float max_themes) initparticlespawner = #522; // check fields/globals for integration and enable particle spawner, return 1 is succeded, otherwise returns 0
-void() resetparticle = #523; // reset p_ globals to default theme #0
-void(float theme) particletheme = #524; // restore p_ globals from saved theme
-float() particlethemesave = #525; // save p_ globals to new particletheme and return it's index
-void(float theme) particlethemeupdate = #525; // save p_ globals to new particletheme and return it's index
-void(float theme) particlethemefree = #526; // delete a particle theme
-float(vector org, vector vel) spawnparticle = #527; // returns 0 when failed, 1 when spawned
-float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
-float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
-float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
-// description: this builtin provides an easy and flexible way to spawn particles,
-// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
-// With this extension you can create a specific particles like rain particles, or entity particles
-// notes:
-// 1) 0 is default particle template, it could be changed
-// 2) color vectors could have value 0-255 of each component
-// restrictions: max themes could be between 4 and 2048
-// warning: you should call initparticlespawner() at very beginning BEFORE all other particle spawner functions
-// function to query particle info
-// don't remove this function as it protects all particle_ globals from FTEQCC/FRIKQCC non-referenced removal optimisation
-void() printparticle =
-{
-       // vortex: this also protects from 'non-referenced' optimisation on some compilers
-       print("PARTICLE:\n");
-       print(strcat("  type: ", ftos(particle_type), "\n"));
-       print(strcat("  blendmode: ", ftos(particle_blendmode), "\n"));
-       print(strcat("  orientation: ", ftos(particle_orientation), "\n"));
-       print(strcat("  color1: ", vtos(particle_color1), "\n"));
-       print(strcat("  color2: ", vtos(particle_color2), "\n"));
-       print(strcat("  tex: ", ftos(particle_tex), "\n"));
-       print(strcat("  size: ", ftos(particle_size), "\n"));
-       print(strcat("  sizeincrease: ", ftos(particle_sizeincrease), "\n"));
-       print(strcat("  alpha: ", ftos(particle_alpha), "\n"));
-       print(strcat("  alphafade: ", ftos(particle_alphafade), "\n"));
-       print(strcat("  time: ", ftos(particle_time), "\n"));
-       print(strcat("  gravity: ", ftos(particle_gravity), "\n"));
-       print(strcat("  bounce: ", ftos(particle_bounce), "\n"));
-       print(strcat("  airfriction: ", ftos(particle_airfriction), "\n"));
-       print(strcat("  liquidfriction: ", ftos(particle_liquidfriction), "\n"));
-       print(strcat("  originjitter: ", ftos(particle_originjitter), "\n"));
-       print(strcat("  velocityjitter: ", ftos(particle_velocityjitter), "\n"));
-       print(strcat("  qualityreduction: ", ftos(particle_qualityreduction), "\n"));
-       print(strcat("  stretch: ", ftos(particle_stretch), "\n"));
-       print(strcat("  staincolor1: ", vtos(particle_staincolor1), "\n"));
-       print(strcat("  staincolor2: ", vtos(particle_staincolor2), "\n"));
-       print(strcat("  staintex: ", ftos(particle_staintex), "\n"));
-       print(strcat("  stainalpha: ", ftos(particle_stainalpha), "\n"));
-       print(strcat("  stainsize: ", ftos(particle_stainsize), "\n"));
-       print(strcat("  delayspawn: ", ftos(particle_delayspawn), "\n"));
-       print(strcat("  delaycollision: ", ftos(particle_delaycollision), "\n"));
-       print(strcat("  angle: ", ftos(particle_angle), "\n"));
-       print(strcat("  spin: ", ftos(particle_spin), "\n"));
-}
-
-// DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET
-// idea: VorteX
-// darkplaces implementation: VorteX
-float RF_USETRANSPARENTOFFSET = 64; // enables transparent origin offsetting
-// global definitions
-float transparent_offset; // should be set before entity is added
-// description: offset a model's meshes origin used for transparent sorting. Could be used to tweak sorting bugs on very large transparent entities or hacking transparent sorting order for certain objects
-// example: transparent_offset = 1000000; // entity always appear on background of other transparents
-// note: offset is done in view forward axis
-
-// DP_CSQC_ENTITYWORLDOBJECT
-// idea: VorteX
-// darkplaces implementation: VorteX
-const float RF_WORLDOBJECT = 128;
-// description: when renderflag is set, engine will not use culling methods for this entity, e.g. it will always be drawn
-// useful for large outdoor objects (like asteroids on sky horizon or sky models)
-
-// DP_CSQC_ENTITYMODELLIGHT
-// idea: VorteX
-// darkplaces implementation: VorteX
-const float RF_MODELLIGHT = 4096;
-.vector modellight_ambient;
-.vector modellight_diffuse;
-.vector modellight_dir;
-// description: allows CSQC to override directional model lightning on entity
-
-// DP_CSQC_SETPAUSE
-// idea: VorteX
-// darkplaces implementation: VorteX
-// builtin definitions:
-void(float ispaused) setpause = #531;
-// description: provides ability to set pause in local games (similar to one set once console is activated)
-// not stopping sound/cd track, useful for inventory screens, ingame menus with input etc.
-
-// DP_CSQC_QUERYRENDERENTITY
-// idea: VorteX
-// darkplaces implementation: VorteX
-// constant definitions:
-// render entity fields:
-float E_ACTIVE             = 0; // float 0/1
-float E_ORIGIN      = 1; // vector
-float E_FORWARD     = 2; // vector
-float E_RIGHT       = 3; // vector
-float E_UP          = 4; // vector
-float E_SCALE       = 5; // float
-float E_ORIGINANDVECTORS = 6; // returns origin, + sets v_* vectors to orientation
-float E_ALPHA       = 7; // float
-float E_COLORMOD    = 8; // vector
-float E_PANTSCOLOR  = 9; // vector
-float E_SHIRTCOLOR  = 10; // vector
-float E_SKIN        = 11; // float
-float E_MINS        = 12; // vector
-float E_MAXS        = 13; // vector
-float E_ABSMIN      = 14; // vector
-float E_ABSMAX      = 15; // vector
-float E_LIGHT       = 16; // vector - modellight
-// builtin definitions:
-float(float entitynum, float fldnum) getentity = #504;
-vector(float entitynum, float fldnum) getentityvec = #504;
-// description: allows to query parms from render entities, especially useful with attaching CSQC ents to
-// server entities networked and interpolated by engine (monsters, players), number of entity is it's SVQC number
-// you can send it via tempentity/CSQC entity message. Note that this builtin doesnt know about entity removing/reallocating
-// so it's meaning to work for short period of time, dont use it on missiles/grenades whatever will be removed next five seconds
-
-//DP_GFX_FONTS
-//idea: Blub\0, divVerent
-//darkplaces implementation: Blub\0
-//console commands:
-//  loadfont fontname fontmaps size1 size2 ...
-//   A font can simply be gfx/tgafile (freetype fonts doent need extension),
-//   or alternatively you can specify multiple fonts and faces
-//   Like this: gfx/vera-sans:2,gfx/fallback:1
-//   to load face 2 of the font gfx/vera-sans and use face 1
-//   of gfx/fallback as fallback font
-//   You can also specify a list of font sizes to load, like this:
-//   loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32
-//   In many cases, 8 12 16 24 32 should be a good choice.
-//   for slots see:
-//constant definitions:
-float drawfont;            // set it before drawstring()/drawchar() calls
-float FONT_DEFAULT = 0;    // 'default'
-float FONT_CONSOLE = 1;    // 'console', REALLY should be fixed width (ls!)
-float FONT_SBAR = 2;       // 'sbar', used on hud, must be fixed width
-float FONT_NOTIFY = 3;     // 'notify', used on sprint/bprint
-float FONT_CHAT = 4;       // 'chat'
-float FONT_CENTERPRINT = 5;// 'centerprint'
-float FONT_INFOBAR = 6;    // 'infobar'
-float FONT_MENU = 7;       // 'menu', should be fixed width
-float FONT_USER0 = 8;      // 'user0', userdefined fonts
-float FONT_USER1 = 9;      // 'user1', userdefined fonts
-float FONT_USER2 = 10;     // 'user2', userdefined fonts
-float FONT_USER3 = 11;     // 'user3', userdefined fonts
-float FONT_USER4 = 12;     // 'user4', userdefined fonts
-float FONT_USER5 = 13;     // 'user5', userdefined fonts
-float FONT_USER6 = 14;     // 'user6', userdefined fonts
-float FONT_USER7 = 15;     // 'user7' slot, userdefined fonts
-//builtin definitions:
-float findfont(string s) = #356; // find font by fontname and return it's index
-float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
-// loads font immediately so stringwidth() function can be used just after builtin call
-// returns a font slotnum (which is used to set drawfont to)
-// first 3 parms are identical to "loadfont" console command ones
-// slot could be one of FONT_ constants or result of findfont() or -1 to not use it
-// if slot is given, font will be loaded to this slotnum and fontname become new title for it
-// this way you can rename user* fonts to something more usable
-// fix_* parms let you fix badly made fonts by applying some transformations to them
-// fix_scale : per-character center-oriented scale (doesn't change line height at all)
-// fix_voffset : vertical offset for each character, it's a multiplier to character height
-float stringwidth(string text, float allowColorCodes, vector size) = #327; // get a width of string with given font and char size
-float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // in menu.dat it has different builtin #
-//description: engine support for custom fonts in console, hud, qc etc.
-// limits:
-//  max 128 chars for font name
-//  max 3 font fallbacks
-//  max 8 sizes per font
-
-//DP_GFX_FONTS_FREETYPE
-//idea: Blub\0, divVerent
-//darkplaces implementation: Blub\0
-//cvar definitions:
-//   r_font_disable_freetype 0/1 : disable freetype fonts loading (uttetly disables freetype library initialization)
-//   r_font_antialias 0/1 : antialiasing when loading font
-//   r_font_hint 0/1/2/3  : hinting when loading font, 0 is no hinting, 1 light autohinting , 2 full autohinting, 3 full hinting
-//   r_font_postprocess_blur X      : font outline blur amount
-//   r_font_postprocess_outline X   : font outline width
-//   r_font_postprocess_shadow_x X  : font outline shadow x shift amount, applied during outlining
-//   r_font_postprocess_shadow_y X  : font outline shadow y shift amount, applied during outlining
-//   r_font_postprocess_shadow_z X  : font outline shadow z shift amount, applied during blurring
-//description: engine support for truetype/freetype fonts
-//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
-//(console command version will support them as well)
-
-//DP_CSQC_BINDMAPS
-//idea: daemon, motorsep
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(float key, float bindmap) getkeybind_bindmap = #342;
-float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
-vector(void) getbindmaps = #631;
-float(vector bm) setbindmaps = #632;
-string(string command, float bindmap) findkeysforcommand = #610;
-//<already in EXT_CSQC> float(string key) stringtokeynum = #341;
-//<already in EXT_CSQC> string(float keynum) keynumtostring = #340;
-//description: key bind setting/getting including support for switchable
-//bindmaps.
-
-//DP_CRYPTO
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions: (CSQC)
-float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
-//description:
-//use -1 as buffer handle to justs end delim as postdata
-
-//DP_CSQC_MAINVIEW
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-const int VF_MAINVIEW         = 400;
-//use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render
-//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
-//this flag is set for the first scene, and not cleared by R_ClearScene
-//this flag is automatically cleared by R_RenderView
-//so when not using this extension, the first view rendered is the main view
-
-//DP_CSQC_MINFPS_QUALITY
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-const int VF_MINFPS_QUALITY   = 401;
-//use getproperty(VF_MINFPS_QUALITY); to do CSQC based LOD based on cl_minfps
-//1 should lead to an unmodified view
-
-//DP_CSQC_V_CALCREFDEF_WIP1
-//DP_CSQC_V_CALCREFDEF_WIP2
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(entity e, float refdefflags) V_CalcRefdef = #640;
-//constant definitions:
-const int PMF_DUCKED = 4;
-const int PMF_ONGROUND = 8;
-const int REFDEFFLAG_TELEPORTED = 1;
-const int REFDEFFLAG_JUMPING = 2;
-const int REFDEFFLAG_DEAD = 4;
-const int REFDEFFLAG_INTERMISSION = 8;
-//- use this on the player entity after performing prediction
-//- pass REFDEFFLAG_TELEPORTED if the player teleported since last frame
-//- pass REFDEFFLAG_JUMPING if jump button is pressed
-//- pass REFDEFFLAG_DEAD if dead (DP_CSQC_V_CALCREFDEF_WIP2)
-//- pass REFDEFFLAG_INTERMISSION if in intermission (DP_CSQC_V_CALCREFDEF_WIP2)
-//- the player entity needs to have origin, velocity, pmove_flags set according
-//  to prediction (the above two PMF_ flags are used in the player's pmove_flags)
-//- NOTE: to check for this, ALSO OR a check with DP_CSQC_V_CALCREFDEF to also support
-//  the finished extension once done
-
-// assorted builtins
-float  drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
-vector drawgetimagesize(string pic) = #318;
-const float SPA_POSITION =  0;
-const float SPA_S_AXIS =  1;
-const float SPA_T_AXIS =  2;
-const float SPA_R_AXIS =  3;
-const float SPA_TEXCOORDS0 =  4;
-const float SPA_LIGHTMAP0_TEXCOORDS =  5;
-const float SPA_LIGHTMAP_COLOR =  6;
-float (entity e, float s)                                              getsurfacenumpoints = #434;
-vector (entity e, float s, float n)                                    getsurfacepoint = #435;
-vector (entity e, float s)                                             getsurfacenormal = #436;
-string (entity e, float s)                                             getsurfacetexture = #437;
-float (entity e, vector p)                                             getsurfacenearpoint = #438;
-vector (entity e, float s, vector p)                                   getsurfaceclippedpoint = #439;
-vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-float(entity e, float s) getsurfacenumtriangles = #628;
-vector(entity e, float s, float n) getsurfacetriangle = #629;
-
-//DP_QC_ASINACOSATANATAN2TAN
-//idea: Urre
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
-float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
-float PI      = 3.1415926535897932384626433832795028841971693993751058209749445923;
-//builtin definitions:
-float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
-float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
-float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
-//description:
-//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
-//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
-
-//DP_QC_SPRINTF
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(string format, ...) sprintf = #627;
-//description:
-//you know sprintf :P
-//supported stuff:
-//  %
-//  optional: <argpos>$ for the argument to format
-//  flags: #0- +
-//  optional: <width>, *, or *<argpos>$ for the field width
-//  optional: .<precision>, .*, or .*<argpos>$ for the precision
-//  length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int)
-//  conversions:
-//    d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int
-//    i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int
-//    ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int
-//    eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double
-//    s takes a string
-//    vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
-//    For conversions s and c, the flag # makes precision and width interpreted
-//      as byte count, by default it is interpreted as character count in UTF-8
-//      enabled engines. No other conversions can create wide characters, and #
-//      has another meaning in these.
-
-//DP_QC_GETTIME
-//idea: tZork
-//darkplaces implementation: tZork, divVerent
-//constant definitions:
-float GETTIME_FRAMESTART = 0; // time of start of frame
-float GETTIME_REALTIME = 1; // current time (may be OS specific)
-float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
-float GETTIME_UPTIME = 3; // time since start of the engine
-//builtin definitions:
-float(float tmr) gettime = #519;
-//description:
-//some timers to query...
-
-//DP_QC_GETTIME_CDTRACK
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float GETTIME_CDTRACK = 4;
-//description:
-//returns the playing time of the current cdtrack when passed to gettime()
-//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
-
-//DP_QC_TOKENIZEBYSEPARATOR
-//idea: Electro, SavageX, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-int(string s, string separator1, ...) tokenizebyseparator = #479;
-//description:
-//this function returns tokens separated by any of the supplied separator strings, example:
-//numnumbers = tokenizebyseparator("10.2.3.4", ".");
-//returns 4 and the tokens are "10" "2" "3" "4"
-//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
-
-//DP_QC_TOKENIZE_CONSOLE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-int(string s) tokenize_console = #514;
-int(float i) argv_start_index = #515;
-int(float i) argv_end_index = #516;
-//description:
-//this function returns tokens separated just like the console does
-//also, functions are provided to get the index of the first and last character of each token in the original string
-//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
-
-//DP_SND_SOUND7_WIP1
-//DP_SND_SOUND7_WIP2
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
-float SOUNDFLAG_RELIABLE = 1;
-//description:
-//plays a sound, with some more flags
-//extensions to sound():
-//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
-//  i.e. support multiple sounds at once, but cannot be stopped/restarted
-//- a value 0 in the speed parameter means no change; otherwise, it is a
-//  percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
-//  half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
-//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
-//  to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
-//  similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
-//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
-//  snd_channel1volume, etc. (so, a channel shares the cvar with its respective
-//  auto-channel); however, the mod MUST define snd_channel8volume and upwards
-//  in default.cfg if they are to be used, as the engine does not create them
-//  to not litter the cvar list
-//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
-//  flags as extra 7th and 8th argument
-//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
-//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
-//  the finished extension once done
-
-//DP_PRECACHE_PIC_FLAGS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
-float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
-float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
-//notes: these constants are given as optional second argument to precache_pic()
-
-//DP_QC_TRACE_MOVETYPE_WORLDONLY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_WORLDONLY = 3;
-//description:
-//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
-
-//DP_SND_GETSOUNDTIME
-//idea: VorteX
-//darkplaces implementation: VorteX
-//constant definitions:
-float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
-float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
-//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
-//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
-//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
-//examples of use:
-//  - QC-driven looped sounds
-//  - QC events when sound playing is finished
-//  - toggleable ambientsounds
-//  - subtitles
-
-//DP_QC_NUM_FOR_EDICT
-//idea: Blub\0
-//darkplaces implementation: Blub\0
-//Function to get the number of an entity - a clean way.
-float(entity num) num_for_edict = #512;
-
-//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//globals:
-.int dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
-float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
-int trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
-int trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
-string trace_dphittexturename; // texture name of impacted surface
-//constants:
-const int DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
-const int DPCONTENTS_WATER = 2;
-const int DPCONTENTS_SLIME = 4;
-const int DPCONTENTS_LAVA = 8;
-const int DPCONTENTS_SKY = 16;
-const int DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
-const int DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
-const int DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
-const int DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
-const int DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
-const int DPCONTENTS_DONOTENTER = 1024; // AI hint brush
-const int DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
-const int DPCONTENTS_BOTCLIP = 2048; // AI hint brush
-const int DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
-const int Q3SURFACEFLAG_NODAMAGE = 1;
-const int Q3SURFACEFLAG_SLICK = 2; // low friction surface
-const int Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-const int Q3SURFACEFLAG_LADDER = 8; // climbable surface
-const int Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-const int Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
-const int Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
-const int Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
-const int Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
-const int Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-const int Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
-//description:
-//adds additional information after a traceline/tracebox/tracetoss call.
-//also (very important) sets trace_* globals before calling .touch functions,
-//this allows them to inspect the nature of the collision (for example
-//determining if a projectile hit sky), clears trace_* variables for the other
-//object in a touch event (that is to say, a projectile moving will see the
-//trace results in its .touch function, but the player it hit will see very
-//little information in the trace_ variables as it was not moving at the time)
-
-//DP_QC_CVAR_TYPE
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-float(string name) cvar_type = #495;
-const int CVAR_TYPEFLAG_EXISTS = 1;
-const int CVAR_TYPEFLAG_SAVED = 2;
-const int CVAR_TYPEFLAG_PRIVATE = 4;
-const int CVAR_TYPEFLAG_ENGINE = 8;
-const int CVAR_TYPEFLAG_HASDESCRIPTION = 16;
-const int CVAR_TYPEFLAG_READONLY = 32;
-
-//DP_QC_CRC16
-//idea: divVerent
-//darkplaces implementation: divVerent
-//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
-//When caseinsensitive is set, the CRC is calculated of the lower cased string.
-int(bool caseinsensitive, string s, ...) crc16 = #494;
-
-//DP_QC_URI_ESCAPE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//URI::Escape's functionality
-string(string in) uri_escape = #510;
-string(string in) uri_unescape = #511;
-
-//DP_QC_DIGEST
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string digest, string data, ...) digest_hex = #639;
-//description:
-//returns a given hex digest of given data
-//the returned digest is always encoded in hexadecimal
-//only the "MD4" digest is always supported!
-//if the given digest is not supported, string_null is returned
-//the digest string is matched case sensitively, use "MD4", not "md4"!
-
-//DP_QC_DIGEST_SHA256
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//description:
-//"SHA256" is also an allowed digest type
-
-//DP_QC_LOG
-//darkplaces implementation: divVerent
-//builtin definitions:
-float log(float f) = #532;
-//description:
-//logarithm
-
-//FTE_CSQC_SKELETONOBJECTS
-//idea: Spike, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-// all skeleton numbers are 1-based (0 being no skeleton)
-// all bone numbers are 1-based (0 being invalid)
-float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
-float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
-float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
-string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
-int(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
-int(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
-vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
-vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
-void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
-void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
-void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
-float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
-float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
-//fields:
-.float skeletonindex; // active skeleton overriding standard animation on model
-.int frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
-.int frame2; // secondary framegroup animation (strength = lerpfrac)
-.int frame3; // tertiary framegroup animation (strength = lerpfrac3)
-.int frame4; // quaternary framegroup animation (strength = lerpfrac4)
-.float lerpfrac; // strength of framegroup blend
-.float lerpfrac3; // strength of framegroup blend
-.float lerpfrac4; // strength of framegroup blend
-.float frame1time; // start time of framegroup animation
-.float frame2time; // start time of framegroup animation
-.float frame3time; // start time of framegroup animation
-.float frame4time; // start time of framegroup animation
-//description:
-//this extension provides a way to do complex skeletal animation on an entity.
-//
-//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
-//
-//notes:
-//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
-//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
-//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
-//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
-//
-//features include:
-//multiple animations blended together.
-//animating a model with animations from another model with a compatible skeleton.
-//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
-//custom bone controllers - for example making eyes track a target location.
-//
-//
-//
-//example code follows...
-//
-//this helper function lets you identify (by parentage) what group a bone
-//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
-//all children of the bone named "torso", unless they are children of
-//"leftarm" (which is a child of "torso") which would return 2 instead...
-float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
-{
-       string bonename;
-       while (bonenum >= 0)
-       {
-               bonename = skel_get_bonename(skel, bonenum);
-               if (bonename == g1) return 1;
-               if (bonename == g2) return 2;
-               if (bonename == g3) return 3;
-               if (bonename == g4) return 4;
-               if (bonename == g5) return 5;
-               if (bonename == g6) return 6;
-               bonenum = skel_get_boneparent(skel, bonenum);
-       }
-       return 0;
-};
-// create a skeletonindex for our player using current modelindex
-void() example_skel_player_setup =
-{
-       self.skeletonindex = skel_create(self.modelindex);
-};
-// setup bones of skeleton based on an animation
-// note: animmodelindex can be a different model than self.modelindex
-void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
-{
-       // start with our standard animation
-       self.frame = framegroup;
-       self.frame2 = 0;
-       self.frame3 = 0;
-       self.frame4 = 0;
-       self.frame1time = framegroupstarttime;
-       self.frame2time = 0;
-       self.frame3time = 0;
-       self.frame4time = 0;
-       self.lerpfrac = 0;
-       self.lerpfrac3 = 0;
-       self.lerpfrac4 = 0;
-       skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
-};
-// apply a different framegroup animation to bones with a specified parent
-void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
-{
-       self.frame = framegroup;
-       self.frame2 = 0;
-       self.frame3 = 0;
-       self.frame4 = 0;
-       self.frame1time = framegroupstarttime;
-       self.frame2time = 0;
-       self.frame3time = 0;
-       self.frame4time = 0;
-       self.lerpfrac = 0;
-       self.lerpfrac3 = 0;
-       self.lerpfrac4 = 0;
-       float bonenum = 0;
-       float numbones = skel_get_numbones(self.skeletonindex);
-       while (bonenum < numbones)
-       {
-               if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
-                       skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
-               bonenum = bonenum + 1;
-       }
-};
-// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
-void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
-{
-       float bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
-       if (bonenum < 0)
-               return;
-       vector oldforward = v_forward;
-       vector oldright = v_right;
-       vector oldup = v_up;
-       vector v = eyetarget - self.origin;
-       vector modeleyetarget;
-       modeleyetarget.x =   v * v_forward;
-       modeleyetarget.y = 0-v * v_right;
-       modeleyetarget.z =   v * v_up;
-       // this is an eyeball, make it point at the target location
-       // first get all the data we can...
-       vector relorg = skel_get_bonerel(self.skeletonindex, bonenum);
-       vector relforward = v_forward;
-       vector relright = v_right;
-       vector relup = v_up;
-       vector boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
-       vector boneforward = v_forward;
-       vector boneright = v_right;
-       vector boneup = v_up;
-       vector parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
-       vector parentforward = v_forward;
-       vector parentright = v_right;
-       vector parentup = v_up;
-       // get the vector from the eyeball to the target
-       vector u = modeleyetarget - boneorg;
-       // now transform it inversely by the parent matrix to produce new rel vectors
-       v.x = u * parentforward;
-       v.y = u * parentright;
-       v.z = u * parentup;
-       vector ang = vectoangles2(v, relup);
-       ang.x = 0 - ang.x;
-       makevectors(ang);
-       // set the relative bone matrix
-       skel_set_bone(self.skeletonindex, bonenum, relorg);
-       // restore caller's v_ vectors
-       v_forward = oldforward;
-       v_right = oldright;
-       v_up = oldup;
-};
-// delete skeleton when we're done with it
-// note: skeleton remains valid until next frame when it is really deleted
-void() example_skel_player_delete =
-{
-       skel_delete(self.skeletonindex);
-       self.skeletonindex = 0;
-};
-//
-// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
-//
-
-//DP_QC_ENTITYDATA
-//idea: KrimZon
-//darkplaces implementation: KrimZon
-//builtin definitions:
-float() numentityfields = #496;
-string(float fieldnum) entityfieldname = #497;
-float(float fieldnum) entityfieldtype = #498;
-string(float fieldnum, entity ent) getentityfieldstring = #499;
-float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
-//constants:
-//Returned by entityfieldtype
-float FIELD_STRING   = 1;
-float FIELD_FLOAT    = 2;
-float FIELD_VECTOR   = 3;
-float FIELD_ENTITY   = 4;
-float FIELD_FUNCTION = 6;
-//description:
-//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
-//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
-//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
-//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
-//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
-//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
-//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
-
-//DP_QC_ENTITYSTRING
-void(string s) loadfromdata = #529;
-void(string s) loadfromfile = #530;
-void(string s) callfunction = #605;
-void(float fh, entity e) writetofile = #606;
-float(string s) isfunction = #607;
-void(entity e, string s) parseentitydata = #608;
-
-//DP_COVERAGE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//function definitions:
-void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
-
-// assorted builtins
-//const int STAT_MOVEVARS_TICRATE              = 240;
-//const int STAT_MOVEVARS_TIMESCALE            = 241;
-//const int STAT_FRAGLIMIT                             = 235;
-//const int STAT_TIMELIMIT                             = 236;
-//const int STAT_MOVEVARS_GRAVITY       = 242;
-string(void) ReadPicture                               = #501;
-const int PARTICLES_USEALPHA = 1;
-float particles_alphamin, particles_alphamax;
-const int PARTICLES_USECOLOR = 2;
-vector particles_colormin, particles_colormax;
-const int PARTICLES_USEFADE = 4;  // fades the COUNT (fade alpha using alphamin/alphamax)
-float particles_fade;
-const int PARTICLES_DRAWASTRAIL = 128;
-void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags) boxparticles = #502;
-float trace_networkentity;
-const int RF_FULLBRIGHT        = 256;
-const int RF_NOSHADOW  = 512;
-const int RF_DYNAMICMODELLIGHT = 8192;
-
-float gettaginfo_parent;
-string gettaginfo_name;
-vector gettaginfo_offset;
-vector gettaginfo_forward;
-vector gettaginfo_right;
-vector gettaginfo_up;
-float checkpvs(vector viewpos, entity viewee) = #240;
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
 
 #pragma noref 0
 
index 109e9195bb03cda7212ef627a29fbe8cd5785e4c..2487da4ff357a8751c3ab8e643ce0168ad02c47a 100644 (file)
 #ifndef DPEXTENSIONS_H
 #define DPEXTENSIONS_H
-//DarkPlaces supported extension list, draft version 1.04
 
-//things that don't have extensions yet:
-.float disableclientprediction;
+#pragma noref 1
 
-//definitions that id Software left out:
-//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
-float MOVE_NORMAL = 0; // same as false
-float MOVE_NOMONSTERS = 1; // same as true
-float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+#include "upstream/dpextensions.qc"
 
-//checkextension function
-//idea: expected by almost everyone
-//darkplaces implementation: LordHavoc
-float(string s) checkextension = #99;
-//description:
-//check if (cvar("pr_checkextension")) before calling this, this is the only
-//guaranteed extension to be present in the extension system, it allows you
-//to check if an extension is available, by name, to check for an extension
-//use code like this:
-//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
-//if (cvar("pr_checkextension"))
-//if (checkextension("DP_SV_SETCOLOR"))
-//     ext_setcolor = true;
-//from then on you can check ext_setcolor to know if that extension is available
+int(entity ent, string tagname) _gettagindex = #451;
+#define gettagindex _gettagindex
 
-//BX_WAL_SUPPORT
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates the engine supports .wal textures for filenames in the textures/ directory
-//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
+int(string effectname) _particleeffectnum = #335;
+#define particleeffectnum _particleeffectnum
 
-//DP_BUTTONCHAT
-//idea: Vermeulen
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float buttonchat;
-//description:
-//true if the player is currently chatting (in messagemode, menus or console)
+int(string s, string separator1, ...) _tokenizebyseparator = #479;
+#define tokenizebyseparator _tokenizebyseparator
 
-//DP_BUTTONUSE
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float buttonuse;
-//client console commands:
-//+use
-//-use
-//description:
-//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
+int(string s) _tokenize_console = #514;
+#define tokenize_console _tokenize_console
 
-//DP_CL_LOADSKY
-//idea: Nehahra, LordHavoc
-//darkplaces implementation: LordHavoc
-//client console commands:
-//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
-//description:
-//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
+int(int i) _argv_start_index = #515;
+#define argv_start_index _argv_start_index
 
-//DP_CON_SET
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+int(int i) _argv_end_index = #516;
+#define argv_end_index _argv_end_index
 
-//DP_CON_SETA
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+int(string s) _strlen = #114;
+#define strlen _strlen
 
-//DP_CON_ALIASPARAMETERS
-//idea: many
-//darkplaces implementation: Black
-//description:
-//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
+float(float skel, float bonenum) _skel_get_boneparent = #267;
+#define skel_get_boneparent _skel_get_boneparent
 
-//DP_CON_EXPANDCVAR
-//idea: many, PHP
-//darkplaces implementation: Black
-//description:
-//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
+float(float skel, string tagname) _skel_find_bone = #268;
+#define skel_find_bone _skel_find_bone
 
-//DP_CON_STARTMAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
+float(string str, string sub, float startpos) _strstrofs = #221;
+#define strstrofs _strstrofs
 
-//DP_EF_ADDITIVE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_ADDITIVE     = 32;
-//description:
-//additive blending when this object is rendered
+float(string str, float ofs) _str2chr = #222;
+#define str2chr _str2chr
 
-//DP_EF_BLUE
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_BLUE         = 64;
-//description:
-//entity emits blue light (used for quad)
+string(int c, ...) _chr2str = #223;
+#define chr2str _chr2str
 
-//DP_EF_DOUBLESIDED
-//idea: LordHavoc
-//darkplaces implementation: [515] and LordHavoc
-//effects bit:
-const int EF_DOUBLESIDED = 32768;
-//description:
-//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
+int(string s1, string s2) _strcmp = #228;
+#define strcmp _strcmp
 
-//DP_EF_DYNAMICMODELLIGHT
-//idea: C.Brutail, divVerent, maikmerten
-//darkplaces implementation: divVerent
-//effects bit:
-const int   EF_DYNAMICMODELLIGHT     = 131072;
-//description:
-//force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors)
+int(string s1, string s2, int len) _strncmp = #228;
+#define strncmp _strncmp
 
-//DP_EF_FLAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_FLAME        = 1024;
-//description:
-//entity is on fire
+int(string s1, string s2) _strcasecmp = #229;
+#define strcasecmp _strcasecmp
 
-//DP_EF_FULLBRIGHT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_FULLBRIGHT   = 512;
-//description:
-//entity is always brightly lit
+int(string s1, string s2, int len) _strncasecmp = #230;
+#define strncasecmp _strncasecmp
 
-//DP_EF_NODEPTHTEST
-//idea: Supa
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_NODEPTHTEST       = 8192;
-//description:
-//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
+int() _buf_create = #460;
+#define buf_create _buf_create
 
-//DP_EF_NODRAW
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_NODRAW       = 16;
-//description:
-//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
+#pragma noref 0
 
-//DP_EF_NOGUNBOB
-//idea: Chris Page, Dresk
-//darkplaces implementation: LordHAvoc
-//effects bit:
-const int   EF_NOGUNBOB     = 256;
-//description:
-//this has different meanings depending on the entity it is used on:
-//player entity - prevents gun bobbing on player.viewmodel
-//viewmodelforclient entity - prevents gun bobbing on an entity attached to the player's view
-//other entities - no effect
-//uses:
-//disabling gun bobbing on a diving mask or other model used as a .viewmodel.
-//disabling gun bobbing on view-relative models meant to be part of the heads up display.  (note: if fov is changed these entities may be off-screen, or too near the center of the screen, so use fov 90 in this case)
-
-//DP_EF_NOSHADOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_NOSHADOW     = 4096;
-//description:
-//realtime lights will not cast shadows from this entity (but can still illuminate it)
-
-//DP_EF_RED
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_RED          = 128;
-//description:
-//entity emits red light (used for invulnerability)
-
-//DP_EF_RESTARTANIM_BIT
-//idea: id software
-//darkplaces implementation: divVerent
-//effects bit:
-const int   EF_RESTARTANIM_BIT = 1048576;
-//description:
-//when toggled, the current animation is restarted. Useful for weapon animation.
-//to toggle this bit in QC, you can do:
-//  self.effects += (EF_RESTARTANIM_BIT - 2 * (self.effects & EF_RESTARTANIM_BIT));
-
-//DP_EF_STARDUST
-//idea: MythWorks Inc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int   EF_STARDUST     = 2048;
-//description:
-//entity emits bouncing sparkles in every direction
-
-//DP_EF_TELEPORT_BIT
-//idea: id software
-//darkplaces implementation: divVerent
-//effects bit:
-const int   EF_TELEPORT_BIT = 2097152;
-//description:
-//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting.
-//to toggle this bit in QC, you can do:
-//  self.effects += (EF_TELEPORT_BIT - 2 * (self.effects & EF_TELEPORT_BIT));
-
-//DP_ENT_ALPHA
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//fields:
-.float alpha;
-//description:
-//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
-
-//DP_ENT_COLORMOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definition:
-.vector colormod;
-//description:
-//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal).
-
-//DP_ENT_CUSTOMCOLORMAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number.
-
-/*
-//NOTE: no longer supported by darkplaces because all entities are delta compressed now
-//DP_ENT_DELTACOMPRESS // no longer supported
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float EF_DELTA = 8388608;
-//description:
-//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc).
-*/
-
-//DP_ENT_EXTERIORMODELTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//fields:
-.entity exteriormodeltoclient;
-//description:
-//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown.  Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
-
-//DP_ENT_GLOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float glow_color;
-.float glow_size;
-.float glow_trail;
-//description:
-//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
-
-//DP_ENT_GLOWMOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definition:
-.vector glowmod;
-//description:
-//controls color of the entity's glow texture (fullbrights), '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, see colormod (same color restrictions apply).
-
-//DP_ENT_LOWPRECISION
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_LOWPRECISION = 4194304;
-//description:
-//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
-
-//DP_ENT_SCALE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float scale;
-//description:
-//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller.
-
-//DP_ENT_TRAILEFFECTNUM
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float traileffectnum;
-//description:
-//use a custom effectinfo.txt effect on this entity, assign it like this:
-//self.traileffectnum = particleeffectnum("mycustomeffect");
-//this will do both the dlight and particle trail as described in the effect, basically equivalent to trailparticles() in CSQC but performed on a server entity.
-
-//DP_ENT_VIEWMODEL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity viewmodelforclient;
-//description:
-//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)...  the entity is not visible to any other client.
-
-//DP_GFX_EXTERNALTEXTURES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//loads external textures found in various directories (tenebrae compatible)...
-/*
-in all examples .tga is merely the base texture, it can be any of these:
-.tga (base texture)
-_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha)
-_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend)
-_shirt.tga (same idea as pants, but for shirt color)
-_diffuse.tga (this may be used instead of base texture for per pixel lighting)
-_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale))
-_norm.tga (normalmap texture for per pixel lighting)
-_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility)
-_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility)
-
-due to glquake's incomplete Targa(r) loader, this section describes
-required Targa(r) features support:
-types:
-type 1 (uncompressed 8bit paletted with 24bit/32bit palette)
-type 2 (uncompressed 24bit/32bit true color, glquake supported this)
-type 3 (uncompressed 8bit greyscale)
-type 9 (RLE compressed 8bit paletted with 24bit/32bit palette)
-type 10 (RLE compressed 24bit/32bit true color, glquake supported this)
-type 11 (RLE compressed 8bit greyscale)
-attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
-
-image formats guaranteed to be supported: tga, pcx, lmp
-image formats that are optional: png, jpg
-
-mdl/spr/spr32 examples:
-skins are named _A (A being a number) and skingroups are named like _A_B
-these act as suffixes on the model name...
-example names for skin _2_1 of model "progs/armor.mdl":
-game/override/progs/armor.mdl_2_1.tga
-game/textures/progs/armor.mdl_2_1.tga
-game/progs/armor.mdl_2_1.tga
-example names for skin _0 of the model "progs/armor.mdl":
-game/override/progs/armor.mdl_0.tga
-game/textures/progs/armor.mdl_0.tga
-game/progs/armor.mdl_0.tga
-note that there can be more skins files (of the _0 naming) than the mdl
-contains, this is only useful to save space in the .mdl file if classic quake
-compatibility is not a concern.
-
-bsp/md2/md3 examples:
-example names for the texture "quake" of model "maps/start.bsp":
-game/override/quake.tga
-game/textures/quake.tga
-game/quake.tga
-
-sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
-game/override/gfx/conchars.tga
-game/textures/gfx/conchars.tga
-game/gfx/conchars.tga
-*/
-
-//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES
-//idea: Fuh?
-//darkplaces implementation: LordHavoc
-//description:
-//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/.
-//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed)
-//example:
-//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/
-//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/
-//as a more extreme example:
-//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/
-
-//DP_GFX_FOG
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
-//description:
-//global fog for the map, can not be changed by QC
-
-//DP_GFX_QUAKE3MODELTAGS
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity tag_entity; // entity this is attached to (call setattachment to set this)
-.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
-//builtin definitions:
-void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
-//description:
-//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
-//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
-//note 3: attaching to world turns off attachment
-//note 4: the entity that this is attached to must be visible for this to work
-//note 5: if an entity is attached to the player entity it will not be drawn in first person.
-
-//DP_GFX_SKINFILES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as:
-//progs/test.md3_0.skin
-//progs/test.md3_1.skin
-//...
-//
-//these files contain replace commands (replace meshname shadername), example:
-//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement
-//replace "teamstripes" "progs/test/redstripes.tga"
-//replace "visor" "common/nodraw" // this makes the visor mesh invisible
-////it is not possible to rename tags using this format
-//
-//Or the Quake3 syntax (100% compatible with Quake3's .skin files):
-//helmet,progs/test/helmet1.tga // this is a mesh shader replacement
-//teamstripes,progs/test/redstripes.tga
-//visor,common/nodraw // this makes the visor mesh invisible
-//tag_camera, // this defines that the first tag in the model is called tag_camera
-//tag_test, // this defines that the second tag in the model is called tag_test
-//
-//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible.
-//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
-//other commands might be added someday but it is not expected.
-
-//DP_GFX_SKYBOX
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
-//description:
-//global skybox for the map, can not be changed by QC
-
-//DP_UTF8
-//idea: Blub\0, divVerent
-//darkplaces implementation: Blub\0
-//cvar definitions:
-//   utf8_enable: enable utf8 encoding
-//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., 
-//and count as 1 char for string functions like strlen, substring, etc.
-// note: utf8_enable is run-time cvar, could be changed during execution
-// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
-
-//DP_HALFLIFE_MAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30).
-
-//DP_HALFLIFE_MAP_CVAR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//cvars:
-//halflifebsp 0/1
-//description:
-//engine sets this cvar when loading a map to indicate if it is halflife format or not.
-
-//DP_HALFLIFE_SPRITE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//simply indicates that the engine supports HalfLife sprites.
-
-//DP_INPUTBUTTONS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float button3;
-.float button4;
-.float button5;
-.float button6;
-.float button7;
-.float button8;
-.float button9;
-.float button10;
-.float button11;
-.float button12;
-.float button13;
-.float button14;
-.float button15;
-.float button16;
-//description:
-//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
-//the exact mapping of protocol button bits on the server is:
-//self.button0 = (bits & 1) != 0;
-///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */
-//self.button2 = (bits & 2) != 0;
-//self.button3 = (bits & 4) != 0;
-//self.button4 = (bits & 8) != 0;
-//self.button5 = (bits & 16) != 0;
-//self.button6 = (bits & 32) != 0;
-//self.button7 = (bits & 64) != 0;
-//self.button8 = (bits & 128) != 0;
-
-// DP_LIGHTSTYLE_STATICVALUE
-// idea: VorteX
-// darkplaces implementation: VorteX
-// description: allows alternative 'static' lightstyle syntax : "=value"
-// examples: "=0.5", "=2.0", "=2.75"
-// could be used to control switchable lights or making styled lights with brightness > 2
-// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact 
-// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
-
-//DP_LITSPRITES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
-
-//DP_LITSUPPORT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
-//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course...  see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
-
-//DP_MONSTERWALK
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player.
-
-//DP_MOVETYPEBOUNCEMISSILE
-//idea: id Software
-//darkplaces implementation: id Software
-//movetype definitions:
-//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
-//description:
-//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
-
-//DP_MOVETYPEFLYWORLDONLY
-//idea: Samual
-//darkplaces implementation: Samual
-//movetype definitions:
-float MOVETYPE_FLY_WORLDONLY = 33;
-//description:
-//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
-
-//DP_NULL_MODEL
-//idea: Chris
-//darkplaces implementation: divVerent
-//definitions:
-//string dp_null_model = "null";
-//description:
-//setmodel(e, "null"); makes an entity invisible, have a zero bbox, but
-//networked. useful for shared CSQC entities.
-
-//DP_MOVETYPEFOLLOW
-//idea: id Software, LordHavoc (redesigned)
-//darkplaces implementation: LordHavoc
-//movetype definitions:
-float MOVETYPE_FOLLOW = 12;
-//description:
-//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:
-//aiment - the entity this is attached to.
-//punchangle - the original angles when the follow began.
-//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
-//v_angle - the relative angles.
-//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:
-//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
-//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid
-//hole.aiment = bmodel; // make the hole follow bmodel
-//hole.punchangle = bmodel.angles; // the original angles of bmodel
-//hole.view_ofs = hole.origin - bmodel.origin; // relative origin
-//hole.v_angle = hole.angles - bmodel.angles; // relative angles
-
-//DP_QC_ASINACOSATANATAN2TAN
-//idea: Urre
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
-float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
-float PI      = 3.1415926535897932384626433832795028841971693993751058209749445923;
-//builtin definitions:
-float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
-float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
-float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
-//description:
-//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
-//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
-
-//DP_QC_AUTOCVARS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//description:
-//allows QC variables to be bound to cvars
-//(works for float, string, vector types)
-//example:
-// float autocvar_developer;
-// float autocvar_registered;
-// string autocvar__cl_name;
-//NOTE: copying a string-typed autocvar to another variable/field, and then
-//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar
-//globals is UNDEFINED. Accessing autocvar globals after changing that cvar in
-//the same frame by any means other than cvar_set() from the same QC VM is
-//IMPLEMENTATION DEFINED (an implementation may either yield the previous, or
-//the current, value). Changing them via cvar_set() in the same QC VM
-//immediately must reflect on the autocvar globals. Whether autocvar globals,
-//after restoring a savegame, have the cvar's current value, or the original
-//value at time of saving, is UNDEFINED. Restoring a savegame however must not
-//restore the cvar values themselves.
-//In case the cvar does NOT exist, then it is automatically created with the
-//value of the autocvar initializer, if given. This is possible with e.g.
-//frikqcc and fteqcc the following way:
-// var float autocvar_whatever = 42;
-//If no initializer is given, the cvar will be initialized to a string
-//equivalent to the NULL value of the given data type, that is, the empty
-//string, 0, or '0 0 0'. However, when automatic cvar creation took place, a
-//warning is printed to the game console.
-//NOTE: to prevent an ambiguity with float names for vector types, autocvar
-//names MUST NOT end with _x, _y or _z!
-
-//DP_QC_CHANGEPITCH
-//idea: id Software
-//darkplaces implementation: id Software
-//field definitions:
-.float idealpitch;
-.float pitch_speed;
-//builtin definitions:
-void(entity ent) changepitch = #63;
-//description:
-//equivalent to changeyaw, ent is normally self. (this was a Q2 builtin)
-
-//DP_QC_COPYENTITY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity from, entity to) copyentity = #400;
-//description:
-//copies all data in the entity to another entity.
-
-//DP_QC_CRC16
-//idea: divVerent
-//darkplaces implementation: divVerent
-//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
-//When caseinsensitive is set, the CRC is calculated of the lower cased string.
-float(float caseinsensitive, string s, ...) crc16 = #494;
-
-//DP_QC_CVAR_DEFSTRING
-//idea: id Software (Doom3), LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-string(string s) cvar_defstring = #482;
-//description:
-//returns the default value of a cvar, as a tempstring.
-
-//DP_QC_CVAR_DESCRIPTION
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string name) cvar_description = #518;
-//description:
-//returns the description of a cvar
-
-//DP_QC_CVAR_STRING
-//idea: VorteX
-//DarkPlaces implementation: VorteX, LordHavoc
-//builtin definitions:
-string(string s) cvar_string = #448;
-//description:
-//returns the value of a cvar, as a tempstring.
-
-//DP_QC_CVAR_TYPE
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-float(string name) cvar_type = #495;
-float CVAR_TYPEFLAG_EXISTS = 1;
-float CVAR_TYPEFLAG_SAVED = 2;
-float CVAR_TYPEFLAG_PRIVATE = 4;
-float CVAR_TYPEFLAG_ENGINE = 8;
-float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
-float CVAR_TYPEFLAG_READONLY = 32;
-
-//DP_QC_DIGEST
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string digest, string data, ...) digest_hex = #639;
-//description:
-//returns a given hex digest of given data
-//the returned digest is always encoded in hexadecimal
-//only the "MD4" digest is always supported!
-//if the given digest is not supported, string_null is returned
-//the digest string is matched case sensitively, use "MD4", not "md4"!
-
-//DP_QC_DIGEST_SHA256
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//description:
-//"SHA256" is also an allowed digest type
-
-//DP_QC_EDICT_NUM
-//idea: 515
-//DarkPlaces implementation: LordHavoc
-//builtin definitions:
-entity(float entnum) edict_num = #459;
-float(entity ent) wasfreed = #353; // same as in EXT_CSQC extension
-//description:
-//edict_num returns the entity corresponding to a given number, this works even for freed entities, but you should call wasfreed(ent) to see if is currently active.
-//wasfreed returns whether an entity slot is currently free (entities that have never spawned are free, entities that have had remove called on them are also free).
-
-//DP_QC_ENTITYDATA
-//idea: KrimZon
-//darkplaces implementation: KrimZon
-//builtin definitions:
-float() numentityfields = #496;
-string(float fieldnum) entityfieldname = #497;
-float(float fieldnum) entityfieldtype = #498;
-string(float fieldnum, entity ent) getentityfieldstring = #499;
-float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
-//constants:
-//Returned by entityfieldtype
-float FIELD_STRING   = 1;
-float FIELD_FLOAT    = 2;
-float FIELD_VECTOR   = 3;
-float FIELD_ENTITY   = 4;
-float FIELD_FUNCTION = 6;
-//description:
-//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
-//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
-//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
-//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
-//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
-//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
-//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
-
-//DP_QC_ENTITYSTRING
-void(string s) loadfromdata = #529;
-void(string s) loadfromfile = #530;
-void(string s) callfunction = #605;
-void(float fh, entity e) writetofile = #606;
-float(string s) isfunction = #607;
-void(entity e, string s) parseentitydata = #608;
-
-//DP_QC_ETOS
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-string(entity ent) etos = #65;
-//description:
-//prints "entity 1" or similar into a string. (this was a Q2 builtin)
-
-//DP_QC_EXTRESPONSEPACKET
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(void) getextresponse = #624;
-//description:
-//returns a string of the form "\"ipaddress:port\" data...", or the NULL string
-//if no packet was found. Packets can be queued into the client/server by
-//sending a packet starting with "\xFF\xFF\xFF\xFFextResponse " to the
-//listening port.
-
-//DP_QC_FINDCHAIN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.string fld, string match) findchain = #402;
-//description:
-//similar to find() but returns a chain of entities like findradius.
-
-//DP_QC_FINDCHAIN_TOFIELD
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-entity(.string fld, float match, .entity tofield) findradius_tofield = #22;
-entity(.string fld, string match, .entity tofield) findchain_tofield = #402;
-entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450;
-entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403;
-//description:
-//similar to findchain() etc, but stores the chain into .tofield instead of .chain
-//actually, the .entity tofield is an optional field of the the existing findchain* functions
-
-//DP_QC_FINDCHAINFLAGS
-//idea: Sajt
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.float fld, float match) findchainflags = #450;
-//description:
-//similar to findflags() but returns a chain of entities like findradius.
-
-//DP_QC_FINDCHAINFLOAT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.entity fld, entity match) findchainentity = #403;
-entity(.float fld, float match) findchainfloat = #403;
-//description:
-//similar to findentity()/findfloat() but returns a chain of entities like findradius.
-
-//DP_QC_FINDFLAGS
-//idea: Sajt
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(entity start, .float fld, float match) findflags = #449;
-//description:
-//finds an entity with the specified flag set in the field, similar to find()
-
-//DP_QC_FINDFLOAT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(entity start, .entity fld, entity match) findentity = #98;
-entity(entity start, .float fld, float match) findfloat = #98;
-//description:
-//finds an entity or float field value, similar to find(), but for entity and float fields.
-
-//DP_QC_FS_SEARCH
-//idea: Black
-//darkplaces implementation: Black
-//builtin definitions:
-float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
-void(float handle) search_end = #445;
-float(float handle) search_getsize = #446;
-string(float handle, float num) search_getfilename = #447;
-//description:
-//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
-//search_end frees a search slot (also done at progs reload).
-//search_getsize returns how many filenames were found.
-//search_getfilename returns a filename from the search.
-
-//DP_QC_GETLIGHT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector(vector org) getlight = #92;
-//description:
-//returns the lighting at the requested location (in color), 0-255 range (can exceed 255).
-
-//DP_QC_GETSURFACE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(entity e, float s) getsurfacenumpoints = #434;
-vector(entity e, float s, float n) getsurfacepoint = #435;
-vector(entity e, float s) getsurfacenormal = #436;
-string(entity e, float s) getsurfacetexture = #437;
-float(entity e, vector p) getsurfacenearpoint = #438;
-vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
-//description:
-//functions to query surface information.
-
-//DP_QC_GETSURFACEPOINTATTRIBUTE
-//idea: BlackHC
-//darkplaces implementation: BlackHC
-// constants
-float SPA_POSITION = 0;
-float SPA_S_AXIS = 1;
-float SPA_T_AXIS = 2;
-float SPA_R_AXIS = 3; // same as SPA_NORMAL
-float SPA_TEXCOORDS0 = 4;
-float SPA_LIGHTMAP0_TEXCOORDS = 5;
-float SPA_LIGHTMAP0_COLOR = 6;
-//builtin definitions:
-vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-
-//description:
-//function to query extended information about a point on a certain surface
-
-//DP_QC_GETSURFACETRIANGLE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-float(entity e, float s) getsurfacenumtriangles = #628;
-vector(entity e, float s, float n) getsurfacetriangle = #629;
-//description:
-//function to query triangles of a surface
-
-//DP_QC_GETTAGINFO
-//idea: VorteX, LordHavoc
-//DarkPlaces implementation: VorteX
-//builtin definitions:
-int(entity ent, string tagname) gettagindex = #451;
-vector(entity ent, float tagindex) gettaginfo = #452;
-//description:
-//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
-//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
-
-//DP_QC_GETTAGINFO_BONEPROPERTIES
-//idea: daemon
-//DarkPlaces implementation: divVerent
-//global definitions:
-float gettaginfo_parent;
-string gettaginfo_name;
-vector gettaginfo_offset;
-vector gettaginfo_forward;
-vector gettaginfo_right;
-vector gettaginfo_up;
-//description:
-//when this extension is present, gettaginfo fills in some globals with info about the bone that had been queried
-//gettaginfo_parent is set to the number of the parent bone, or 0 if it is a root bone
-//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo
-//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component.
-
-//DP_QC_GETTIME
-//idea: tZork
-//darkplaces implementation: tZork, divVerent
-//constant definitions:
-float GETTIME_FRAMESTART = 0; // time of start of frame
-float GETTIME_REALTIME = 1; // current time (may be OS specific)
-float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
-float GETTIME_UPTIME = 3; // time since start of the engine
-//builtin definitions:
-float(float tmr) gettime = #519;
-//description:
-//some timers to query...
-
-//DP_QC_GETTIME_CDTRACK
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float GETTIME_CDTRACK = 4;
-//description:
-//returns the playing time of the current cdtrack when passed to gettime()
-//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
-
-//DP_QC_I18N
-//idea: divVerent
-//darkplaces implementation: divVerent
-//description:
-//
-//The engine supports translating by gettext compatible .po files.
-//progs.dat uses progs.dat.<LANGUAGE>.po
-//menu.dat uses menu.dat.<LANGUAGE>.po
-//csprogs.dat uses csprogs.dat.<LANGUAGE>.po
-//
-//To create a string that can be translated, define it as
-//  string dotranslate_FILENOTFOUND = "File not found";
-//Note: if the compiler does constant folding, this will only work if there is
-//no other "File not found" string in the progs!
-//
-//Alternatively, if using the Xonotic patched fteqcc compiler, you can simplify
-//this by using _("File not found") directly in the source code.
-//
-//The language is set by the "prvm_language" cvar: if prvm_language is set to
-//"de", it will read progs.dat.de.po for translating strings in progs.dat.
-//
-//If prvm_language is set to the special name "dump", progs.dat.pot will be
-//written, which is a translation template to be edited by filling out the
-//msgstr entries.
-
-//DP_QC_LOG
-//darkplaces implementation: divVerent
-//builtin definitions:
-float log(float f) = #532;
-//description:
-//logarithm
-
-//DP_QC_MINMAXBOUND
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(float a, float b, ...) min = #94;
-float(float a, float b, float c) min3 = #94;
-float(float a, float b, float c, float d) min4 = #94;
-float(float a, float b, float c, float d, float e) min5 = #94;
-float(float a, float b, float c, float d, float e, float f) min6 = #94;
-float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
-float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
-float(float a, float b, ...) max = #95;
-float(float a, float b, float c) max3 = #95;
-float(float a, float b, float c, float d) max4 = #95;
-float(float a, float b, float c, float d, float e) max5 = #95;
-float(float a, float b, float c, float d, float e, float f) max6 = #95;
-float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
-float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
-float(float minimum, float val, float maximum) bound = #96;
-//description:
-//min returns the lowest of all the supplied numbers.
-//max returns the highest of all the supplied numbers.
-//bound clamps the value to the range and returns it.
-
-//DP_QC_MULTIPLETEMPSTRINGS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//this extension makes all builtins returning tempstrings (ftos for example)
-//cycle through a pool of multiple tempstrings (at least 16), allowing
-//multiple ftos results to be gathered before putting them to use, normal
-//quake only had 1 tempstring, causing many headaches.
-//
-//Note that for longer term storage (or compatibility on engines having
-//FRIK_FILE but not this extension) the FRIK_FILE extension's
-//strzone/strunzone builtins provide similar functionality (slower though).
-//
-//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS
-
-//DP_QC_NUM_FOR_EDICT
-//idea: Blub\0
-//darkplaces implementation: Blub\0
-//Function to get the number of an entity - a clean way.
-float(entity num) num_for_edict = #512;
-
-//DP_QC_RANDOMVEC
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector() randomvec = #91;
-//description:
-//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
-
-//DP_QC_SINCOSSQRTPOW
-//idea: id Software, LordHavoc
-//darkplaces implementation: id Software, LordHavoc
-//builtin definitions:
-float(float val) sin = #60;
-float(float val) cos = #61;
-float(float val) sqrt = #62;
-float(float a, float b) pow = #97;
-//description:
-//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
-
-//DP_QC_SPRINTF
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(string format, ...) sprintf = #627;
-//description:
-//you know sprintf :P
-//supported stuff:
-//  %
-//  optional: <argpos>$ for the argument to format
-//  flags: #0- +
-//  optional: <width>, *, or *<argpos>$ for the field width
-//  optional: .<precision>, .*, or .*<argpos>$ for the precision
-//  length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int)
-//  conversions:
-//    d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int
-//    i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int
-//    ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int
-//    eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double
-//    s takes a string
-//    vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
-//    For conversions s and c, the flag # makes precision and width interpreted
-//      as byte count, by default it is interpreted as character count in UTF-8
-//      enabled engines. No other conversions can create wide characters, and #
-//      has another meaning in these. When in character count mode, color codes
-//      are ignored. To get UTF-8 semantics WITHOUT color code parsing, use
-//      the + flag.
-
-//DP_QC_STRFTIME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-string(float uselocaltime, string format, ...) strftime = #478;
-//description:
-//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice:
-//example: "%Y-%m-%d %H:%M:%S"   (result looks like: 2007-02-08 01:03:15)
-//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time)
-//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function.
-//
-//practical uses:
-//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(true, "%H");hour = stof(s);
-//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time.
-//activating eastereggs in singleplayer games on certain dates.
-//
-//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries.
-//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)".
-//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!).
-//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing.
-
-//DP_QC_STRINGCOLORFUNCTIONS
-//idea: Dresk
-//darkplaces implementation: Dresk
-//builtin definitions:
-float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes
-string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided
-//description:
-//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes
-
-//DP_QC_STRING_CASE_FUNCTIONS
-//idea: Dresk
-//darkplaces implementation: LordHavoc / Dresk
-//builtin definitions:
-string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
-string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
-//description:
-//provides simple string uppercase and lowercase functions
-
-//DP_QC_TOKENIZEBYSEPARATOR
-//idea: Electro, SavageX, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-int(string s, string separator1, ...) tokenizebyseparator = #479;
-//description:
-//this function returns tokens separated by any of the supplied separator strings, example:
-//numnumbers = tokenizebyseparator("10.2.3.4", ".");
-//returns 4 and the tokens are "10" "2" "3" "4"
-//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
-
-//DP_QC_TOKENIZE_CONSOLE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-int(string s) tokenize_console = #514;
-int(float i) argv_start_index = #515;
-int(float i) argv_end_index = #516;
-//description:
-//this function returns tokens separated just like the console does
-//also, functions are provided to get the index of the first and last character of each token in the original string
-//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
-
-//DP_QC_TRACEBOX
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
-//description:
-//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
-
-//DP_QC_TRACETOSS
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-void(entity ent, entity ignore) tracetoss = #64;
-//description:
-//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
-
-//DP_QC_TRACE_MOVETYPE_HITMODEL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_HITMODEL = 4;
-//description:
-//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
-
-//DP_QC_TRACE_MOVETYPE_WORLDONLY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_WORLDONLY = 3;
-//description:
-//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
-
-//DP_QC_UNLIMITEDTEMPSTRINGS
-//idea: divVerent
-//darkplaces implementation: LordHavoc
-//description:
-//this extension alters Quake behavior such that instead of reusing a single
-//tempstring (or multiple) there are an unlimited number of tempstrings, which
-//are removed only when a QC function invoked by the engine returns,
-//eliminating almost all imaginable concerns with string handling in QuakeC.
-//
-//in short:
-//you can now use and abuse tempstrings as much as you like, you still have to
-//use strzone (FRIK_FILE) for permanent storage however.
-//
-//
-//
-//implementation notes for other engine coders:
-//these tempstrings are expected to be stored in a contiguous buffer in memory
-//which may be fixed size or controlled by a cvar, or automatically grown on
-//demand (in the case of DarkPlaces).
-//
-//this concept is similar to quake's Zone system, however these are all freed
-//when the QC interpreter returns.
-//
-//this is basically a poor man's garbage collection system for strings.
-
-//DP_QC_VECTOANGLES_WITH_ROLL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector(vector forward, vector up) vectoangles2 = #51; // same number as vectoangles
-//description:
-//variant of vectoangles that takes an up vector to calculate roll angle (also uses this to calculate yaw correctly if the forward is straight up or straight down)
-//note: just like normal vectoangles you need to negate the pitch of the returned angles if you want to feed them to makevectors or assign to self.v_angle
-
-//DP_QC_VECTORVECTORS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector dir) vectorvectors = #432;
-//description:
-//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles.
-
-//DP_QC_WHICHPACK
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(string filename) whichpack = #503;
-//description:
-//returns the name of the pak/pk3/whatever containing the given file, in the same path space as FRIK_FILE functions use (that is, possibly with a path name prefix)
-
-//DP_QC_URI_ESCAPE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//URI::Escape's functionality
-string(string in) uri_escape = #510;
-string(string in) uri_unescape = #511;
-
-//DP_QC_URI_GET
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string
-//returns 1 on success of initiation, 0 if there are too many concurrent
-//connections already or if the URL is invalid
-//the following callback will receive the data and MUST exist!
-//  void(float id, float status, string data) URI_Get_Callback;
-//status is either
-//  negative for an internal error,
-//  0 for success, or
-//  the HTTP response code on server error (e.g. 404)
-//if 1 is returned by uri_get, the callback will be called in the future
-float(string url, float id) uri_get = #513;
-
-//DP_QC_URI_POST
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string after POSTing via HTTP
-//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
-//and uri_post sends the string buffer buf, joined using the delimiter delim
-float(string url, float id, string content_type, string data) uri_post = #513;
-float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
-
-//DP_SKELETONOBJECTS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//this extension indicates that FTE_CSQC_SKELETONOBJECTS functionality is available in server QC (as well as CSQC).
-
-//DP_SV_SPAWNFUNC_PREFIX
-//idea: divVerent
-//darkplaces implementation: divVerent
-//Make functions whose name start with spawnfunc_ take precedence as spawn function for loading entities.
-//Useful if you have a field ammo_shells (required in any Quake mod) but want to support spawn functions called ammo_shells (like in Q3A).
-//Optionally, you can declare a global "float require_spawnfunc_prefix;" which will require ANY spawn function to start with that prefix.
-
-
-//DP_QUAKE2_MODEL
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake2 .md2 files.
-
-//DP_QUAKE2_SPRITE
-//idea: LordHavoc
-//darkplaces implementation: Elric
-//description:
-//shows that the engine supports Quake2 .sp2 files.
-
-//DP_QUAKE3_MAP
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake3 .bsp files.
-
-//DP_QUAKE3_MODEL
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake3 .md3 files.
-
-//DP_REGISTERCVAR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(string name, string value) registercvar = #93;
-//description:
-//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
-//NOTE: DP_CON_SET is much better.
-
-//DP_SND_DIRECTIONLESSATTNNONE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
-
-//DP_SND_FAKETRACKS
-//idea: requested
-
-//darkplaces implementation: Elric
-//description:
-//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
-//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
-
-//DP_SND_SOUND7_WIP1
-//DP_SND_SOUND7_WIP2
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
-float SOUNDFLAG_RELIABLE = 1;
-//description:
-//plays a sound, with some more flags
-//extensions to sound():
-//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
-//  i.e. support multiple sounds at once, but cannot be stopped/restarted
-//- a value 0 in the speed parameter means no change; otherwise, it is a
-//  percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
-//  half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
-//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
-//  to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
-//  similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
-//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
-//  snd_channel1volume, etc. (so, a channel shares the cvar with its respective
-//  auto-channel); however, the mod MUST define snd_channel8volume and upwards
-//  in default.cfg if they are to be used, as the engine does not create them
-//  to not litter the cvar list
-//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
-//  flags as extra 7th and 8th argument
-//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
-//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
-//  the finished extension once done
-
-//DP_SND_OGGVORBIS
-//idea: Transfusion
-//darkplaces implementation: Elric
-//description:
-//the engine supports loading Ogg Vorbis sound files.  Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
-
-//DP_SND_STEREOWAV
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//the engine supports stereo WAV files.  (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
-
-//DP_SND_GETSOUNDTIME
-//idea: VorteX
-//darkplaces implementation: VorteX
-//constant definitions:
-float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
-float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
-//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
-//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
-//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
-//examples of use:
-//  - QC-driven looped sounds
-//  - QC events when sound playing is finished
-//  - toggleable ambientsounds
-//  - subtitles
-
-//DP_VIDEO_DPV
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//console commands:
-//  playvideo <videoname> - start playing video
-//  stopvideo - stops current video
-//description: indicated that engine support playing videos in DPV format
-
-//DP_VIDEO_SUBTITLES
-//idea: VorteX
-//darkplaces implementation: VorteX
-//cvars:
-//  cl_video_subtitles - toggles subtitles showing
-//  cl_video_subtitles_lines - how many lines to reserve for subtitles
-//  cl_video_subtitles_textsize - font size
-//console commands:
-//  playvideo <videoname> <custom_subtitles_file> - start playing video
-//  stopvideo - stops current video
-//description: indicates that engine support subtitles on videos
-//subtitles stored in external text files, each video file has it's default subtitles file ( <videoname>.dpsubs )
-//example: for video/act1.dpv default subtitles file will be video/act1.dpsubs
-//also video could be played with custom subtitles file by utilizing second parm of playvideo command
-//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
-//   <start> <end> "string"
-//   start: subtitle start time in seconds
-//     end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, 
-//          if below 0 - show until next subtitles minus this number of seconds
-//    text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
-//example of subtitle file:
-//   3 0       "Vengeance! Vengeance for my eternity of suffering!"
-//   9 0       "Whelp! As if you knew what eternity was!"
-//   13        0       "Grovel before your true master."
-//   17        0       "Never!" 
-//   18        7       "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
-
-//DP_SOLIDCORPSE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//solid definitions:
-float SOLID_CORPSE = 5;
-//description:
-//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline.
-
-//DP_SPRITE32
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//the engine supports .spr32 sprites.
-
-//DP_SV_BOTCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constants:
-float CLIENTTYPE_DISCONNECTED = 0;
-float CLIENTTYPE_REAL = 1;
-float CLIENTTYPE_BOT = 2;
-float CLIENTTYPE_NOTACLIENT = 3;
-//builtin definitions:
-entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available
-float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants
-//description:
-//spawns a client with no network connection, to allow bots to use client slots with no hacks.
-//How to use:
-/*
-       // to spawn a bot
-       local entity oldself;
-       oldself = self;
-       self = spawnclient();
-       if (!self)
-       {
-               bprint("Can not add bot, server full.\n");
-               self = oldself;
-               return;
-       }
-       self.netname = "Yoyobot";
-       self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants
-       ClientConnect();
-       PutClientInServer();
-       self = oldself;
-
-       // to remove all bots
-       local entity head;
-       head = find(world, classname, "player");
-       while (head)
-       {
-               if (clienttype(head) == CLIENTTYPE_BOT)
-                       dropclient(head);
-               head = find(head, classname, "player");
-       }
-
-       // to identify if a client is a bot (for example in PlayerPreThink)
-       if (clienttype(self) == CLIENTTYPE_BOT)
-               botthink();
-*/
-//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT
-//How it works:
-//creates a new client, calls SetNewParms and stores the parms, and returns the client.
-//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually
-//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is).
-//parms work the same on bot clients as they do on real clients, and do carry from level to level
-
-//DP_SV_BOUNCEFACTOR
-//idea: divVerent
-//darkplaces implementation: divVerent
-//field definitions:
-.float bouncefactor; // velocity multiplier after a bounce
-.float bouncestop; // bounce stops if velocity to bounce plane is < bouncestop * gravity AFTER the bounce
-//description:
-//allows qc to customize MOVETYPE_BOUNCE a bit
-
-//DP_SV_CLIENTCAMERA
-//idea: LordHavoc, others
-//darkplaces implementation: Black
-//field definitions:
-.entity clientcamera; // override camera entity
-//description:
-//allows another entity to be the camera for a client, for example a remote camera, this is similar to sending svc_setview manually except that it also changes the network culling appropriately.
-
-//DP_SV_CLIENTCOLORS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float clientcolors; // colors of the client (format: pants + shirt * 16)
-//description:
-//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
-
-//DP_SV_CLIENTNAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
-
-//DP_SV_CUSTOMIZEENTITYFORCLIENT
-//idea: LordHavoc
-//darkplaces implementation: [515] and LordHavoc
-//field definitions:
-.float() customizeentityforclient; // self = this entity, other = client entity
-//description:
-//allows qc to modify an entity before it is sent to each client, the function returns true if it should send, false if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
-//tips on writing customize functions:
-//it is a good idea to return false early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
-//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
-//example ideas for use of this extension:
-//making icons over teammates' heads which are only visible to teammates.  for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
-//making cloaked players more visible to their teammates than their enemies.  for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return true;};
-//making explosion models that face the viewer (does not work well with chase_active).  for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
-//implementation notes:
-//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
-
-//DP_SV_DISCARDABLEDEMO
-//idea: parasti
-//darkplaces implementation: parasti
-//field definitions:
-.float discardabledemo;
-//description:
-//when this field is set to a non-zero value on a player entity, a possibly recorded server-side demo for the player is discarded
-//Note that this extension only works if:
-//  auto demos are enabled (the cvar sv_autodemo_perclient is set)
-//  discarding demos is enabled (the cvar sv_autodemo_perclient_discardable is set)
-
-//DP_SV_DRAWONLYTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity drawonlytoclient;
-//description:
-//the entity is only visible to the specified client.
-
-//DP_SV_DROPCLIENT
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity clent) dropclient = #453;
-//description:
-//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
-
-//DP_SV_EFFECT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
-//SVC definitions:
-//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
-//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate
-//description:
-//clientside playback of simple custom sprite effects (explosion sprites, etc).
-
-//DP_SV_ENTITYCONTENTSTRANSITION
-//idea: Dresk
-//darkplaces implementation: Dresk
-//field definitions:
-.void(float nOriginalContents, float nNewContents) contentstransition;
-//description:
-//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed.
-//The first parameter provides the entities original contents, prior to the transition.  The second parameter provides the new contents.
-//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds.
-
-//DP_SV_MOVETYPESTEP_LANDEVENT
-//idea: Dresk
-//darkplaces implementation: Dresk
-//field definitions:
-.void(vector vImpactVelocity) movetypesteplandevent;
-//description:
-//This field function, when provided, is triggered on a MOVETYPE_STEP entity when it experiences  "land event".
-// The standard engine behavior for this event is to play the sv_sound_land CVar sound.
-//The parameter provides the velocity of the entity at the time of the impact.  The z value may therefore be used to calculate how "hard" the entity struck the surface.
-//NOTE: If this field function is provided on a MOVETYPE_STEP entity, the standard sv_sound_land sound IS SUPPRESSED to allow for authors to create their own feedback.
-
-//DP_SV_POINTSOUND
-//idea: Dresk
-//darkplaces implementation: Dresk
-//builtin definitions:
-void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
-//description:
-//Similar to the standard QC sound function, this function takes an origin instead of an entity and omits the channel parameter.
-// This allows sounds to be played at arbitrary origins without spawning entities.
-
-//DP_SV_ONENTITYNOSPAWNFUNCTION
-//idea: Dresk
-//darkplaces implementation: Dresk
-//engine-called QC prototypes:
-//void() SV_OnEntityNoSpawnFunction;
-//description:
-// This function is called whenever an entity on the server has no spawn function, and therefore has no defined QC behavior.
-// You may as such dictate the behavior as to what happens to the entity.
-// To mimic the engine's default behavior, simply call remove(self).
-
-//DP_SV_ONENTITYPREPOSTSPAWNFUNCTION
-//idea: divVerent
-//darkplaces implementation: divVerent
-//engine-called QC prototypes:
-//void() SV_OnEntityPreSpawnFunction;
-//void() SV_OnEntityPostSpawnFunction;
-//description:
-// These functions are called BEFORE or AFTER an entity is spawned the regular way.
-// You may as such dictate the behavior as to what happens to the entity.
-// SV_OnEntityPreSpawnFunction is called before even looking for the spawn function, so you can even change its classname in there. If it remove()s the entity, the spawn function will not be looked for.
-// SV_OnEntityPostSpawnFunction is called ONLY after its spawn function or SV_OnEntityNoSpawnFunction was called, and skipped if the entity got removed by either.
-
-//DP_SV_MODELFLAGS_AS_EFFECTS
-//idea: LordHavoc, Dresk
-//darkplaces implementation: LordHavoc
-//field definitions:
-.int modelflags;
-//constant definitions:
-float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own
-float MF_ROCKET  =   1; // leave a trail
-float MF_GRENADE =   2; // leave a trail
-float MF_GIB     =   4; // leave a trail
-float MF_ROTATE  =   8; // rotate (bonus items)
-float MF_TRACER  =  16; // green split trail
-float MF_ZOMGIB  =  32; // small blood trail
-float MF_TRACER2 =  64; // orange split trail
-float MF_TRACER3 = 128; // purple trail
-//description:
-//this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc.
-//setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS.
-//
-//silly example modification #1 to W_FireRocket in weapons.qc:
-//missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail
-//silly example modification #2 to W_FireRocket in weapons.qc:
-//missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail
-//
-//note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm.
-//
-//note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values.
-
-//DP_SV_NETADDRESS
-//idea: Dresk
-//darkplaces implementation: Dresk
-//field definitions:
-.string netaddress;
-//description:
-// provides the netaddress of the associated entity (ie. 127.0.0.1) and "null/botclient" if the netconnection of the entity is invalid
-
-//DP_SV_NODRAWTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity nodrawtoclient;
-//description:
-//the entity is not visible to the specified client.
-
-//DP_SV_PING
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float ping;
-//description:
-//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
-
-//DP_SV_PING_PACKETLOSS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float ping_packetloss;
-.float ping_movementloss;
-//description:
-//continuously updated field indicating client's packet loss, and movement loss (i.e. packet loss affecting player movement).
-
-//DP_SV_POINTPARTICLES
-//idea: Spike
-//darkplaces implementation: LordHavoc
-//function definitions:
-int(string effectname) particleeffectnum = #335; // same as in CSQC
-void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC
-void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
-//SVC definitions:
-//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end
-//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count
-//float svc_pointparticles1 = 62; // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
-//description:
-//provides the ability to spawn non-standard particle effects, typically these are defined in a particle effect information file such as effectinfo.txt in darkplaces.
-//this is a port of particle effect features from clientside QC (EXT_CSQC) to server QC, as these effects are potentially useful to all games even if they do not make use of EXT_CSQC.
-//warning: server must have same order of effects in effectinfo.txt as client does or the numbers would not match up, except for standard quake effects which are always the same numbers.
-
-//DP_SV_PUNCHVECTOR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.vector punchvector;
-//description:
-//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
-
-//DP_SV_PLAYERPHYSICS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.vector movement;
-//cvar definitions:
-//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
-//engine-called QC prototypes:
-//void() SV_PlayerPhysics;
-//description:
-//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
-
-//DP_PHYSICS_ODE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//globals:
-//new movetypes:
-const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builtins applied
-//new solid types (deprecated):
-const float SOLID_PHYSICS_BOX = 32;
-const float SOLID_PHYSICS_SPHERE = 33;
-const float SOLID_PHYSICS_CAPSULE = 34;
-const float SOLID_PHYSICS_TRIMESH = 35;
-const float SOLID_PHYSICS_CYLINDER = 36;
-//geometry types:
-const float GEOMTYPE_NONE = -1;       // entity will be entirely skipped by ODE
-const float GEOMTYPE_SOLID = 0;       // geometry type will be set based on .solid field
-const float GEOMTYPE_BOX = 1;         // entity bound box
-const float GEOMTYPE_SPHERE = 2;      // sphere with radius picked from x axis of entity bound box
-const float GEOMTYPE_CAPSULE = 3;     // with leading axis automatically determined from longest one, radius is picked as minimal of the rest 2 axes
-const float GEOMTYPE_TRIMESH = 4;     // triangle mesh
-const float GEOMTYPE_CYLINDER = 5;    // like capsule but not capped
-                                      // note that ODE's builtin cylinder support is experimental, somewhat bugged and unfinished (no cylinder-cylinder collision)
-                                                                         // to use properly working cylinder should build ODE with LIBCCD extension
-const float GEOMTYPE_CAPSULE_X = 6;   // capsule with fixed leading axis
-const float GEOMTYPE_CAPSULE_Y = 7;
-const float GEOMTYPE_CAPSULE_Z = 8;
-const float GEOMTYPE_CYLINDER_X        = 9;  // cylinder with fixed leading axis
-const float GEOMTYPE_CYLINDER_Y        = 10;
-const float GEOMTYPE_CYLINDER_Z        = 11;
-//joint types:
-const float JOINTTYPE_NONE = 0;
-const float JOINTTYPE_POINT = 1;
-const float JOINTTYPE_HINGE = 2;
-const float JOINTTYPE_SLIDER = 3;
-const float JOINTTYPE_UNIVERSAL = 4;
-const float JOINTTYPE_HINGE2 = 5;
-const float JOINTTYPE_FIXED = -1;
-//force types:
-const float FORCETYPE_NONE = 0;
-const float FORCETYPE_FORCE = 1; // applied at center of mass
-const float FORCETYPE_FORCEATPOS = 2;
-const float FORCETYPE_TORQUE = 3;
-// common joint properties:
-// .entity aiment; // connected objects
-// .entity enemy; // connected objects, forces
-// .vector movedir;
-//   for a spring:
-//     movedir_x = spring constant (force multiplier, must be > 0)
-//     movedir_y = spring dampening constant to prevent oscillation (must be > 0)
-//     movedir_z = spring stop position (+/-)
-//   for a motor:
-//     movedir_x = desired motor velocity
-//     movedir_y = -1 * max motor force to use
-//     movedir_z = stop position (+/-), set to 0 for no stop
-//   note that ODE does not support both in one anyway
-//   for a force:
-//     force vector to apply
-//field definitions:
-.float  geomtype;     // see GEOMTYPE_*, a more correct way to set collision shape, allows to set SOLID_CORPSE and trimesh collisions
-.float  maxcontacts;  // maximum number of contacts to make for this object, lesser = faster (but setting it too low will could make object pass though walls), default is 16, maximum is 32
-.float  mass;         // ODE mass, standart value is 1
-.vector massofs;      // offsets a mass center out of object center, if not set a center of model bounds is used
-.float  friction;     // a friction of object, get multiplied by second objects's friction on contact
-.float  bouncefactor;
-.float  bouncestop; 
-.float  jointtype;    // type of joint
-.float  forcetype;    // type of force
-.float  erp;          // error restitution parameter, makes ODE solver attempt to fix errors in contacts, 
-                      // bringing together 2 joints or fixing object being stuch in other object, 
-                                 // a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
-                                 // use with care as high values makes system unstable and likely to explode
-//builtin definitions:
-void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
-void(entity e, vector force, vector force_pos) physics_addforce = #541; // deprecated, apply a force from certain origin, length of force vector is power of force
-void(entity e, vector torque) physics_addtorque = #542; // deprecated, add relative torque
-//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option
-//be sure to checkextension for it to know if library is loaded and ready, also to enable physics set "physics_ode" cvar to 1
-//note: this extension is highly experimental and may be unstable
-
-//DP_SV_PRINT
-//idea: id Software (QuakeWorld Server)
-//darkplaces implementation: Black, LordHavoc
-void(string s, ...) print = #339; // same number as in EXT_CSQC
-//description:
-//this is identical to dprint except that it always prints regardless of the developer cvar.
-
-//DP_SV_PRECACHEANYTIME
-//idea: id Software (Quake2)
-//darkplaces implementation: LordHavoc
-//description:
-//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
-
-//DP_SV_QCSTATUS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//1. A global variable
-string worldstatus;
-//Its content is set as "qcstatus" field in the rules.
-//It may be at most 255 characters, and must not contain newlines or backslashes.
-//2. A per-client field
-.string clientstatus;
-//It is sent instead of the "frags" in status responses.
-//It should always be set in a way so that stof(player.clientstatus) is a meaningful score value. Other info may be appended. If used this way, the cvar sv_status_use_qcstatus may be set to 1, and then this value will replace the frags in "status".
-//Currently, qstat does not support this and will not show player info if used and set to anything other than ftos(some integer).
-
-//DP_SV_ROTATINGBMODEL
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
-//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
-
-//DP_SV_SETCOLOR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity ent, float colors) setcolor = #401;
-//engine called QC functions (optional):
-//void(float color) SV_ChangeTeam;
-//description:
-//setcolor sets the color on a client and updates internal color information accordingly (equivalent to stuffing a "color" command but immediate)
-//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.
-//the color format is pants + shirt * 16 (0-255 potentially)
-
-//DP_SV_SLOWMO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//cvars:
-//"slowmo" (0+, default 1)
-//description:
-//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
-//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
-
-//DP_SV_WRITEPICTURE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(float to, string s, float sz) WritePicture = #501;
-//description:
-//writes a picture to the data stream so CSQC can read it using ReadPicture, which has the definition
-//  string(void) ReadPicture = #501;
-//The picture data is sent as at most sz bytes, by compressing to low quality
-//JPEG. The data being sent will be equivalent to:
-//  WriteString(to, s);
-//  WriteShort(to, imagesize);
-//  for(i = 0; i < imagesize; ++i)
-//    WriteByte(to, [the i-th byte of the compressed JPEG image]);
-
-//DP_SV_WRITEUNTERMINATEDSTRING
-//idea: FrikaC
-//darkplaces implementation: Sajt
-//builtin definitions:
-void(float to, string s) WriteUnterminatedString = #456;
-//description:
-//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
-//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivalent of it in his FrikBot mod years ago involving WriteByte calls on each character.
-
-//DP_TE_BLOOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector velocity, float howmany) te_blood = #405;
-//temp entity definitions:
-float TE_BLOOD = 50;
-//protocol:
-//vector origin
-//byte xvelocity (-128 to +127)
-//byte yvelocity (-128 to +127)
-//byte zvelocity (-128 to +127)
-//byte count (0 to 255, how much blood)
-//description:
-//creates a blood effect.
-
-//DP_TE_BLOODSHOWER
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
-//temp entity definitions:
-//float TE_BLOODSHOWER = 52;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//coord explosionspeed (velocity of blood particles flying out of the center)
-//short count (number of blood particles)
-//description:
-//creates an exploding shower of blood, for making gibbings more convincing.
-
-//DP_TE_CUSTOMFLASH
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
-//temp entity definitions:
-//float TE_CUSTOMFLASH = 73;
-//protocol:
-//vector origin
-//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius)
-//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime)
-//byte red (0.0 to 1.0 converted to 0-255)
-//byte green (0.0 to 1.0 converted to 0-255)
-//byte blue (0.0 to 1.0 converted to 0-255)
-//description:
-//creates a customized light flash.
-
-//DP_TE_EXPLOSIONRGB
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector color) te_explosionrgb = #407;
-//temp entity definitions:
-//float TE_EXPLOSIONRGB = 53;
-//protocol:
-//vector origin
-//byte red (0.0 to 1.0 converted to 0 to 255)
-//byte green (0.0 to 1.0 converted to 0 to 255)
-//byte blue (0.0 to 1.0 converted to 0 to 255)
-//description:
-//creates a colored explosion effect.
-
-//DP_TE_FLAMEJET
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector vel, float howmany) te_flamejet = #457;
-//temp entity definitions:
-//float TE_FLAMEJET = 74;
-//protocol:
-//vector origin
-//vector velocity
-//byte count (0 to 255, how many flame particles)
-//description:
-//creates a single puff of flame particles.  (not very useful really)
-
-//DP_TE_PARTICLECUBE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
-//temp entity definitions:
-//float TE_PARTICLECUBE = 54;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity
-//short count
-//byte color (palette color)
-//byte gravity (true or false, FIXME should this be a scaler instead?)
-//coord randomvel (how much to jitter the velocity)
-//description:
-//creates a cloud of particles, useful for forcefields but quite customizable.
-
-//DP_TE_PARTICLERAIN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
-//temp entity definitions:
-//float TE_PARTICLERAIN = 55;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity (velocity of particles)
-//short count (number of particles)
-//byte color (8bit palette color)
-//description:
-//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube.
-
-//DP_TE_PARTICLESNOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
-//temp entity definitions:
-//float TE_PARTICLERAIN = 56;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity (velocity of particles)
-//short count (number of particles)
-//byte color (8bit palette color)
-//description:
-//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
-
-//DP_TE_PLASMABURN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_plasmaburn = #433;
-//temp entity definitions:
-//float TE_PLASMABURN = 75;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2) and marks the walls.
-
-//DP_TE_QUADEFFECTS1
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_gunshotquad = #412;
-void(vector org) te_spikequad = #413;
-void(vector org) te_superspikequad = #414;
-void(vector org) te_explosionquad = #415;
-//temp entity definitions:
-//float   TE_GUNSHOTQUAD  = 57; // [vector] origin
-//float   TE_SPIKEQUAD    = 58; // [vector] origin
-//float   TE_SUPERSPIKEQUAD = 59; // [vector] origin
-//float   TE_EXPLOSIONQUAD = 70; // [vector] origin
-//protocol:
-//vector origin
-//description:
-//all of these just take a location, and are equivalent in function (but not appearance :) to the original TE_GUNSHOT, etc.
-
-//DP_TE_SMALLFLASH
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_smallflash = #416;
-//temp entity definitions:
-//float TE_SMALLFLASH = 72;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2).
-
-//DP_TE_SPARK
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector vel, float howmany) te_spark = #411;
-//temp entity definitions:
-//float TE_SPARK = 51;
-//protocol:
-//vector origin
-//byte xvelocity (-128 to 127)
-//byte yvelocity (-128 to 127)
-//byte zvelocity (-128 to 127)
-//byte count (number of sparks)
-//description:
-//creates a shower of sparks and a smoke puff.
-
-//DP_TE_STANDARDEFFECTBUILTINS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_gunshot = #418;
-void(vector org) te_spike = #419;
-void(vector org) te_superspike = #420;
-void(vector org) te_explosion = #421;
-void(vector org) te_tarexplosion = #422;
-void(vector org) te_wizspike = #423;
-void(vector org) te_knightspike = #424;
-void(vector org) te_lavasplash = #425;
-void(vector org) te_teleport = #426;
-void(vector org, float color, float colorlength) te_explosion2 = #427;
-void(entity own, vector start, vector end) te_lightning1 = #428;
-void(entity own, vector start, vector end) te_lightning2 = #429;
-void(entity own, vector start, vector end) te_lightning3 = #430;
-void(entity own, vector start, vector end) te_beam = #431;
-//description:
-//to make life easier on mod coders.
-
-//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//globals:
-.int dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
-int trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
-int trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
-int trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
-string trace_dphittexturename; // texture name of impacted surface
-//constants:
-const int DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
-const int DPCONTENTS_WATER = 2;
-const int DPCONTENTS_SLIME = 4;
-const int DPCONTENTS_LAVA = 8;
-const int DPCONTENTS_SKY = 16;
-const int DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
-const int DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
-const int DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
-const int DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
-const int DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
-const int DPCONTENTS_DONOTENTER = 1024; // AI hint brush
-const int DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
-const int DPCONTENTS_BOTCLIP = 2048; // AI hint brush
-const int DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
-const int Q3SURFACEFLAG_NODAMAGE = 1;
-const int Q3SURFACEFLAG_SLICK = 2; // low friction surface
-const int Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-const int Q3SURFACEFLAG_LADDER = 8; // climbable surface
-const int Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-const int Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
-const int Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
-const int Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
-const int Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
-const int Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-const int Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
-//description:
-//adds additional information after a traceline/tracebox/tracetoss call.
-//also (very important) sets trace_* globals before calling .touch functions,
-//this allows them to inspect the nature of the collision (for example
-//determining if a projectile hit sky), clears trace_* variables for the other
-//object in a touch event (that is to say, a projectile moving will see the
-//trace results in its .touch function, but the player it hit will see very
-//little information in the trace_ variables as it was not moving at the time)
-
-//DP_VIEWZOOM
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float viewzoom;
-//description:
-//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
-
-//EXT_BITSHIFT
-//idea: Spike
-//darkplaces implementation: [515]
-//builtin definitions:
-float(float number, float quantity) bitshift = #218;
-//description:
-//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like).
-//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you.
-
-//FRIK_FILE
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(string s) stof = #81; // get numerical value from a string
-float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
-void(float fhandle) fclose = #111; // closes a file
-string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
-void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file
-int(string s) strlen = #114; // returns how many characters are in a string
-string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
-string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version
-vector(string s) stov = #117; // returns vector value from a string
-string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
-void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
-//constants:
-float FILE_READ = 0;
-float FILE_APPEND = 1;
-float FILE_WRITE = 2;
-//cvars:
-//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
-//description:
-//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
-//
-//NOTE: strzone functionality is partially superseded by
-//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed
-//NOTE: substring is upgraded by FTE_STRINGS extension with negative start/length handling identical to php 5.2.0
-
-//FTE_CSQC_SKELETONOBJECTS
-//idea: Spike, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-// all skeleton numbers are 1-based (0 being no skeleton)
-// all bone numbers are 1-based (0 being invalid)
-float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
-float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
-float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
-string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
-int(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
-int(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
-vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
-vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
-void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
-void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
-void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
-float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
-float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
-//fields:
-.int skeletonindex; // active skeleton overriding standard animation on model
-.int frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
-.int frame2; // secondary framegroup animation (strength = lerpfrac)
-.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
-.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
-.float lerpfrac; // strength of framegroup blend
-.float lerpfrac3; // strength of framegroup blend
-.float lerpfrac4; // strength of framegroup blend
-.float frame1time; // start time of framegroup animation
-.float frame2time; // start time of framegroup animation
-.float frame3time; // start time of framegroup animation
-.float frame4time; // start time of framegroup animation
-//description:
-//this extension provides a way to do complex skeletal animation on an entity.
-//
-//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
-//
-//notes:
-//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
-//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
-//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
-//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
-//
-//features include:
-//multiple animations blended together.
-//animating a model with animations from another model with a compatible skeleton.
-//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
-//custom bone controllers - for example making eyes track a target location.
-//
-//
-//
-//example code follows...
-//
-//this helper function lets you identify (by parentage) what group a bone
-//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
-//all children of the bone named "torso", unless they are children of
-//"leftarm" (which is a child of "torso") which would return 2 instead...
-float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
-{
-       while (bonenum >= 0)
-       {
-               string bonename = skel_get_bonename(skel, bonenum);
-               if (bonename == g1) return 1;
-               if (bonename == g2) return 2;
-               if (bonename == g3) return 3;
-               if (bonename == g4) return 4;
-               if (bonename == g5) return 5;
-               if (bonename == g6) return 6;
-               bonenum = skel_get_boneparent(skel, bonenum);
-       }
-       return 0;
-};
-// create a skeletonindex for our player using current modelindex
-void() example_skel_player_setup =
-{
-       self.skeletonindex = skel_create(self.modelindex);
-};
-// setup bones of skeleton based on an animation
-// note: animmodelindex can be a different model than self.modelindex
-void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
-{
-       // start with our standard animation
-       self.frame = framegroup;
-       self.frame2 = 0;
-       self.frame3 = 0;
-       self.frame4 = 0;
-       self.frame1time = framegroupstarttime;
-       self.frame2time = 0;
-       self.frame3time = 0;
-       self.frame4time = 0;
-       self.lerpfrac = 0;
-       self.lerpfrac3 = 0;
-       self.lerpfrac4 = 0;
-       skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
-};
-// apply a different framegroup animation to bones with a specified parent
-void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
-{
-       self.frame = framegroup;
-       self.frame2 = 0;
-       self.frame3 = 0;
-       self.frame4 = 0;
-       self.frame1time = framegroupstarttime;
-       self.frame2time = 0;
-       self.frame3time = 0;
-       self.frame4time = 0;
-       self.lerpfrac = 0;
-       self.lerpfrac3 = 0;
-       self.lerpfrac4 = 0;
-       float bonenum = 0;
-       float numbones = skel_get_numbones(self.skeletonindex);
-       while (bonenum < numbones)
-       {
-               if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
-                       skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
-               bonenum = bonenum + 1;
-       }
-};
-// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
-void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
-{
-       float bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
-       if (bonenum < 0)
-               return;
-       vector oldforward = v_forward;
-       vector oldright = v_right;
-       vector oldup = v_up;
-       vector v = eyetarget - self.origin;
-       vector modeleyetarget;
-       modeleyetarget.x =   v * v_forward;
-       modeleyetarget.y = 0-v * v_right;
-       modeleyetarget.z =   v * v_up;
-       // this is an eyeball, make it point at the target location
-       // first get all the data we can...
-       vector relorg = skel_get_bonerel(self.skeletonindex, bonenum);
-       vector relforward = v_forward;
-       vector relright = v_right;
-       vector relup = v_up;
-       vector boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
-       vector boneforward = v_forward;
-       vector boneright = v_right;
-       vector boneup = v_up;
-       vector parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
-       vector parentforward = v_forward;
-       vector parentright = v_right;
-       vector parentup = v_up;
-       // get the vector from the eyeball to the target
-       vector u = modeleyetarget - boneorg;
-       // now transform it inversely by the parent matrix to produce new rel vectors
-       v.x = u * parentforward;
-       v.y = u * parentright;
-       v.z = u * parentup;
-       vector ang = vectoangles2(v, relup);
-       ang.x = 0 - ang.x;
-       makevectors(ang);
-       // set the relative bone matrix
-       skel_set_bone(self.skeletonindex, bonenum, relorg);
-       // restore caller's v_ vectors
-       v_forward = oldforward;
-       v_right = oldright;
-       v_up = oldup;
-};
-// delete skeleton when we're done with it
-// note: skeleton remains valid until next frame when it is really deleted
-void() example_skel_player_delete =
-{
-       skel_delete(self.skeletonindex);
-       self.skeletonindex = 0;
-};
-//
-// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
-//
-
-//KRIMZON_SV_PARSECLIENTCOMMAND
-//idea: KrimZon
-//darkplaces implementation: KrimZon, LordHavoc
-//engine-called QC prototypes:
-//void(string s) SV_ParseClientCommand;
-//builtin definitions:
-void(entity e, string s) clientcommand = #440;
-int(string s) tokenize = #441;
-string(float n) argv = #442;
-//description:
-//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
-
-//NEH_CMD_PLAY2
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports the "play2" console command (plays a sound without spatialization).
-
-//NEH_RESTOREGAME
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//engine-called QC prototypes:
-//void() RestoreGame;
-//description:
-//when a savegame is loaded, this function is called
-
-//NEXUIZ_PLAYERMODEL
-//idea: Nexuiz
-//darkplaces implementation: Black
-//console commands:
-//playermodel <name> - FIXME: EXAMPLE NEEDED
-//playerskin <name> - FIXME: EXAMPLE NEEDED
-//field definitions:
-.string playermodel; // name of player model sent by client
-.string playerskin; // name of player skin sent by client
-//description:
-//these client properties are used by Nexuiz.
-
-//NXQ_GFX_LETTERBOX
-//idea: nxQuake
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
-
-//PRYDON_CLIENTCURSOR
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
-//field definitions:
-.float cursor_active; // true if cl_prydoncursor mode is on
-.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
-.vector cursor_trace_start; // position of camera
-.vector cursor_trace_endpos; // position of cursor in world (as traced from camera)
-.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt)
-//cvar definitions:
-//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented)
-//description:
-//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit.
-//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen.
-//the clientside trace skips transparent entities (except those marked EF_SELECTABLE).
-//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2).
-//intended to be used by Prydon Gate.
-
-//TENEBRAE_GFX_DLIGHTS
-//idea: Tenebrae
-//darkplaces implementation: LordHavoc
-//fields:
-.float light_lev; // radius (does not affect brightness), typical value 350
-.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast)
-.float style; // light style (like normal light entities, flickering torches or switchable, etc)
-.float pflags; // flags (see PFLAGS_ constants)
-.vector angles; // orientation of the light
-.int skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
-//constants:
-float PFLAGS_NOSHADOW = 1; // light does not cast shadows
-float PFLAGS_CORONA = 2; // light has a corona flare
-float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!)
-//description:
-//more powerful dynamic light settings
-//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
-//changes compared to tenebrae (because they're too 'leet' for standards):
-//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
-//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
-
-//TW_SV_STEPCONTROL
-//idea: Transfusion
-//darkplaces implementation: LordHavoc
-//cvars:
-//sv_jumpstep (0/1, default 1)
-//sv_stepheight (default 18)
-//description:
-//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
-
-//FTE_QC_CHECKPVS
-//idea: Urre
-//darkplaces implementation: divVerent
-//builtin definitions:
-float checkpvs(vector viewpos, entity viewee) = #240;
-//description:
-//returns true if viewee can be seen from viewpos according to PVS data
-
-//FTE_STRINGS
-//idea: many
-//darkplaces implementation: KrimZon
-//builtin definitions:
-int(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive
-int(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character
-string(int c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127.
-string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum.
-string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
-string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
-string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
-int(string s1, string s2) strcmp = #228; // compare two strings
-int(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
-int(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
-int(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
-//string(string s, float start, float length) substring = #116; // see note below
-//description:
-//various string manipulation functions
-//note: substring also exists in FRIK_FILE but this extension adds negative start and length as valid cases (see note above), substring is consistent with the php 5.2.0 substr function (not 5.2.3 behavior)
-//substring returns a section of a string as a tempstring, if given negative
-// start the start is measured back from the end of the string, if given a
-// negative length the length is the offset back from the end of the string to
-// stop at, rather than being relative to start, if start is negative and
-// larger than length it is treated as 0.
-// examples of substring:
-// substring("blah", -3, 3) returns "lah"
-// substring("blah", 3, 3) returns "h"
-// substring("blah", -10, 3) returns "bla"
-// substring("blah", -10, -3) returns "b"
-
-//DP_CON_BESTWEAPON
-//idea: many
-//darkplaces implementation: divVerent
-//description:
-//allows QC to register weapon properties for use by the bestweapon command, for mods that change required ammo count or type for the weapons
-//it is done using console commands sent via stuffcmd:
-//  register_bestweapon quake
-//  register_bestweapon clear
-//  register_bestweapon <shortname> <impulse> <itemcode> <activeweaponcode> <ammostat> <ammomin>
-//for example, this is what Quake uses:
-//  register_bestweapon 1 1 4096 4096 6 0 // STAT_SHELLS is 6
-//  register_bestweapon 2 2    1    1 6 1
-//  register_bestweapon 3 3    2    2 6 1
-//  register_bestweapon 4 4    4    4 7 1 // STAT_NAILS is 7
-//  register_bestweapon 5 5    8    8 7 1
-//  register_bestweapon 6 6   16   16 8 1 // STAT_ROCKETS is 8
-//  register_bestweapon 7 7   32   32 8 1
-//  register_bestweapon 8 8   64   64 9 1 // STAT_CELLS is 9
-//after each map client initialization, this is reset back to Quake settings. So you should send these data in ClientConnect.
-//also, this extension introduces a new "cycleweapon" command to the user.
-
-//DP_QC_STRINGBUFFERS
-//idea: ??
-//darkplaces implementation: LordHavoc
-//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
-int() buf_create = #460;
-void(float bufhandle) buf_del = #461;
-float(float bufhandle) buf_getsize = #462;
-void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
-void(float bufhandle, float sortpower, float backward) buf_sort = #464;
-string(float bufhandle, string glue) buf_implode = #465;
-string(float bufhandle, float string_index) bufstr_get = #466;
-void(float bufhandle, float string_index, string str) bufstr_set = #467;
-float(float bufhandle, string str, float order) bufstr_add = #468;
-void(float bufhandle, float string_index) bufstr_free = #469;
-
-//DP_QC_STRINGBUFFERS_CVARLIST
-//idea: divVerent
-//darkplaces implementation: divVerent
-//functions to list cvars and store their names into a stringbuffer
-//cvars that start with pattern but not with antipattern will be stored into the buffer
-void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
-
-//DP_QC_STRINGBUFFERS_EXT_WIP
-//idea: VorteX
-//darkplaces implementation: VorteX
-//constant definitions:
-const float MATCH_AUTO = 0;
-const float MATCH_WHOLE = 1;
-const float MATCH_LEFT = 2;
-const float MATCH_RIGHT = 3;
-const float MATCH_MIDDLE = 4;
-const float MATCH_PATTERN = 5;
-//builtin definitions:
-float(string filename, float bufhandle) buf_loadfile = #535; // append each line of file as new buffer string, return 1 if succesful
-float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile = #536; // writes buffer strings as lines, returns 1 if succesful
-float(float bufhandle, string match, float matchrule, float startpos, float step) bufstr_find = #537; // returns string index
-float(string s, string pattern, float matchrule) matchpattern = #538; // returns 0/1
-float(string s, string pattern, float matchrule, float pos) matchpatternofs = #538;
-//description:
-//provides a set of functions to manipulate with string buffers
-//pattern wildcards: * - any character (or no characters), ? - any 1 character
-//Warning: This extension is work-in-progress, it may be changed/revamped/removed at any time, dont use it if you dont want any trouble
-//wip note: UTF8 is not supported yet
-
-//DP_QC_STRREPLACE
-//idea: Sajt
-//darkplaces implementation: Sajt
-//builtin definitions:
-string(string search, string replace, string subject) strreplace = #484;
-string(string search, string replace, string subject) strireplace = #485;
-//description:
-//strreplace replaces all occurrences of 'search' with 'replace' in the string 'subject', and returns the result as a tempstring.
-//strireplace does the same but uses case-insensitive matching of the 'search' term
-
-//DP_SV_SHUTDOWN
-//idea: divVerent
-//darkplaces implementation: divVerent
-//A function that gets called just before progs exit. To save persistent data from.
-//It is not called on a crash or error.
-//void SV_Shutdown();
-
-//EXT_CSQC
-// #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
-void(float index, float type, ...) addstat = #232;
-
-//ZQ_PAUSE
-//idea: ZQuake
-//darkplaces implementation: GreEn`mArine
-//builtin definitions:
-void(float pause) setpause = #531;
-//function definitions:
-//void(float elapsedtime) SV_PausedTic;
-//description:
-//during pause the world is not updated (time does not advance), SV_PausedTic is the only function you can be sure will be called at regular intervals during the pause, elapsedtime is the current system time in seconds since the pause started (not affected by slowmo or anything else).
-//
-//calling setpause(0) will end a pause immediately.
-//
-//Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause.  In other words, the only things that are not called are think and other time-related functions.
-
-//DP_COVERAGE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//function definitions:
-void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
-
-
-// EXPERIMENTAL (not finalized) EXTENSIONS:
-
-//DP_CRYPTO
-//idea: divVerent
-//darkplaces implementation: divVerent
-//field definitions: (SVQC)
-.string crypto_keyfp; // fingerprint of CA key the player used to authenticate
-.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player
-.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified
-.float crypto_idfp_signed; // set if the player's ID has been signed
-.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext
-.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext
-// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for
-//builtin definitions: (SVQC)
-float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
-//description:
-//use -1 as buffer handle to justs end delim as postdata
 #endif
index d7423083f8b43a2eb06a391e421e8df6fba65a0f..f4c49f143b5c119cd3dbb1a7c434a53d701bf681 100644 (file)
 
 #pragma noref 1
 
-///////////////////////////
-// key constants
+//#define float const int
 
-//
-// these are the key numbers that should be passed to Key_Event
-//
-int K_TAB                      = 9;
-int K_ENTER                = 13;
-int K_ESCAPE           = 27;
-int K_SPACE                = 32;
+#include "upstream/keycodes.qc"
 
-// normal keys should be passed as lowercased ascii
-
-int K_BACKSPACE            = 127;
-int K_UPARROW          = 128;
-int K_DOWNARROW            = 129;
-int K_LEFTARROW            = 130;
-int K_RIGHTARROW       = 131;
-
-int K_ALT                  = 132;
-int K_CTRL             = 133;
-int K_SHIFT            = 134;
-
-int K_F1                   = 135;
-int K_F2                   = 136;
-int K_F3                   = 137;
-int K_F4                   = 138;
-int K_F5                   = 139;
-int K_F6                   = 140;
-int K_F7                   = 141;
-int K_F8                   = 142;
-int K_F9                   = 143;
-int K_F10                  = 144;
-int K_F11                  = 145;
-int K_F12                  = 146;
-
-int K_INS                  = 147;
-int K_DEL                  = 148;
-int K_PGDN             = 149;
-int K_PGUP             = 150;
-int K_HOME             = 151;
-int K_END                  = 152;
-
-int K_NUMLOCK          = 154;
-int K_CAPSLOCK     = 155;
-int K_SCROLLLOCK       = 156;
-
-int K_KP_0             = 157;
-int K_KP_INS       = 157; // same as K_KP_0
-int K_KP_1             = 158;
-int K_KP_END       = 158; // same as K_KP_1
-int K_KP_2             = 159;
-int K_KP_DOWNARROW  = 159; // same as K_KP_2
-int K_KP_3             = 160;
-int K_KP_PGDN       = 160; // same as K_KP_3
-int K_KP_4             = 161;
-int K_KP_LEFTARROW  = 161; // same as K_KP_4
-int K_KP_5             = 162;
-int K_KP_6             = 163;
-int K_KP_RIGHTARROW = 163; // same as K_KP_6
-int K_KP_7             = 164;
-int K_KP_HOME       = 164; // same as K_KP_7
-int K_KP_8             = 165;
-int K_KP_UPARROW    = 165; // same as K_KP_8
-int K_KP_9             = 166;
-int K_KP_PGUP       = 166; // same as K_KP_9
-int K_KP_PERIOD     = 167;
-int K_KP_DEL        = 167; // same as K_KP_PERIOD
-int K_KP_DIVIDE     = 168;
-int K_KP_SLASH      = 168; // same as K_KP_DIVIDE
-int K_KP_MULTIPLY   = 169;
-int K_KP_MINUS     = 170;
-int K_KP_PLUS          = 171;
-int K_KP_ENTER     = 172;
-int K_KP_EQUALS            = 173;
-
-// mouse buttons generate virtual keys
-int K_PAUSE            = 153;
-
-//
-// joystick buttons
-//
-int K_JOY1          = 768;
-int K_JOY2          = 769;
-int K_JOY3          = 770;
-int K_JOY4          = 771;
-
-//
-//
-// aux keys are for multi-buttoned joysticks to generate so they can use
-// the normal binding process
-//
-int K_AUX1             = 772;
-int K_AUX2             = 773;
-int K_AUX3             = 774;
-int K_AUX4             = 775;
-int K_AUX5             = 776;
-int K_AUX6             = 777;
-int K_AUX7             = 778;
-int K_AUX8             = 779;
-int K_AUX9             = 780;
-int K_AUX10            = 781;
-int K_AUX11            = 782;
-int K_AUX12            = 783;
-int K_AUX13            = 784;
-int K_AUX14            = 785;
-int K_AUX15            = 786;
-int K_AUX16            = 787;
-int K_AUX17            = 788;
-int K_AUX18            = 789;
-int K_AUX19            = 790;
-int K_AUX20            = 791;
-int K_AUX21            = 792;
-int K_AUX22            = 793;
-int K_AUX23            = 794;
-int K_AUX24            = 795;
-int K_AUX25            = 796;
-int K_AUX26            = 797;
-int K_AUX27            = 798;
-int K_AUX28            = 799;
-int K_AUX29            = 800;
-int K_AUX30            = 801;
-int K_AUX31            = 802;
-int K_AUX32            = 803;
-
-//
-// mouse buttons generate virtual keys
-//
-int K_MOUSE1           = 512;
-int K_MOUSE2           = 513;
-int K_MOUSE3           = 514;
-int K_MWHEELUP     = 515;
-int K_MWHEELDOWN       = 516;
-int K_MOUSE4           = 517;
-int K_MOUSE5           = 518;
-int K_MOUSE6           = 519;
-int K_MOUSE7           = 520;
-int K_MOUSE8           = 521;
-int K_MOUSE9           = 522;
-int K_MOUSE10          = 523;
-int K_MOUSE11          = 524;
-int K_MOUSE12          = 525;
-int K_MOUSE13          = 526;
-int K_MOUSE14          = 527;
-int K_MOUSE15          = 528;
-int K_MOUSE16          = 529;
+//#undef float
 
 #pragma noref 0
 
index 853fa25f21cbd2be4bdb80f9fe3af24618911b79..dce99cde598cbba758d4c3cb36fdc3db325a66ba 100644 (file)
 
 #pragma noref 1
 
-//////////////////////////////////////////////////////////
-// sys globals
-
-entity self;
-
-/////////////////////////////////////////////////////////
-void           end_sys_globals;
-/////////////////////////////////////////////////////////
-// sys fields
-
-/////////////////////////////////////////////////////////
-void           end_sys_fields;
-/////////////////////////////////////////////////////////
-// sys functions
-
-void() m_init;
-void(float keynr, float ascii) m_keydown;
-void(float width, float height) m_draw;
-void(float mode) m_toggle;
-void() m_shutdown;
-// optional: float(float) m_gethostcachecategory;
-
-/////////////////////////////////////////////////////////
-// sys constants
-///////////////////////////
-// key dest constants
-
-float KEY_UNKNOWN      =       -1;
-float KEY_GAME                 =       0;
-float KEY_MENU         =       2;
-float KEY_MENU_GRABBED =       3;
-
-///////////////////////////
-// file constants
-
-float FILE_READ = 0;
-float FILE_APPEND = 1;
-float FILE_WRITE = 2;
-
-///////////////////////////
-// msg constants
-
-float MSG_BROADCAST            = 0;            // unreliable to all
-float MSG_ONE                  = 1;            // reliable to one (msg_entity)
-float MSG_ALL                  = 2;            // reliable to all
-float MSG_INIT                 = 3;            // write to the init string
-
-/////////////////////////////
-// mouse target constants
-
-float MT_MENU = 1;
-float MT_CLIENT = 2;
-
-/////////////////////////
-// client state constants
-
-float CS_DEDICATED             = 0;
-float CS_DISCONNECTED  = 1;
-float CS_CONNECTED             = 2;
-
-///////////////////////////
-// blend flags
-
-float DRAWFLAG_NORMAL          = 0;
-float DRAWFLAG_ADDITIVE        = 1;
-float DRAWFLAG_MODULATE        = 2;
-float DRAWFLAG_2XMODULATE   = 3;
-
-///////////////////////////
-// null entity (actually it is the same like the world entity)
-
-entity null_entity;
-
-///////////////////////////
-// error constants
-
-// file handling
-float ERR_CANNOTOPEN                   = -1; // fopen
-float ERR_NOTENOUGHFILEHANDLES         = -2; // fopen
-float ERR_INVALIDMODE                  = -3; // fopen
-float ERR_BADFILENAME                  = -4; // fopen
-
-// drawing functions
-
-float ERR_NULLSTRING                   = -1;
-float ERR_BADDRAWFLAG                  = -2;
-float ERR_BADSCALE                             = -3;
-float ERR_BADSIZE                              = -3; // same as ERR_BADSCALE
-float ERR_NOTCACHED                            = -4;
-
-// server list stuff
-float SLIST_HOSTCACHEVIEWCOUNT  = 0;
-float SLIST_HOSTCACHETOTALCOUNT = 1;
-float SLIST_MASTERQUERYCOUNT   = 2;
-float SLIST_MASTERREPLYCOUNT   = 3;
-float SLIST_SERVERQUERYCOUNT   = 4;
-float SLIST_SERVERREPLYCOUNT   = 5;
-float SLIST_SORTFIELD          = 6;
-float SLIST_SORTDESCENDING     = 7;
-float SLIST_LEGACY_LINE1       = 1024;
-float SLIST_LEGACY_LINE2       = 1025;
-float SLIST_TEST_CONTAINS      = 0;
-float SLIST_TEST_NOTCONTAIN    = 1;
-float SLIST_TEST_LESSEQUAL     = 2;
-float SLIST_TEST_LESS          = 3;
-float SLIST_TEST_EQUAL         = 4;
-float SLIST_TEST_GREATER       = 5;
-float SLIST_TEST_GREATEREQUAL  = 6;
-float SLIST_TEST_NOTEQUAL      = 7;
-float SLIST_TEST_STARTSWITH    = 8;
-float SLIST_TEST_NOTSTARTSWITH = 9;
-float SLIST_MASK_AND = 0;
-float SLIST_MASK_OR  = 512;
-
-// font stuff
-float FONT_DEFAULT     = 0;
-float FONT_CONSOLE     = 1;
-float FONT_SBAR        = 2;
-float FONT_NOTIFY      = 3;
-float FONT_CHAT        = 4;
-float FONT_CENTERPRINT = 5;
-float FONT_INFOBAR     = 6;
-float FONT_MENU        = 7;
-float FONT_USER        = 8; // add to this the index, like FONT_USER+3 = user3. At least 8 of them are supported.
-float drawfont;
-
-/* not supported at the moment
-///////////////////////////
-// os constants
-
-float OS_WINDOWS       = 0;
-float OS_LINUX         = 1;
-float OS_MAC           = 2;
-*/
-
-
-
-
-
-
-
-
-
-
-//////////////////////////////////////////////////
-// common cmd
-//////////////////////////////////////////////////
-// AK FIXME: Create perhaps a special builtin file for the common cmds
-
-void   checkextension(string ext)      = #1;
-
-// error cmds
-void   error(string err,...)           = #2;
-void   objerror(string err,...)        = #3;
-
-// print
-
-void   print(string text,...)                   = #4;
-void   bprint(string text,...)                  = #5;
-void   sprint(float clientnum, string text,...) = #6;
-void   centerprint(string text,...)             = #7;
-
-// vector stuff
-
-vector normalize(vector v)             = #8;
-float  vlen(vector v)                  = #9;
-float          vectoyaw(vector v)              = #10;
-vector         vectoangles(vector v)           = #11;
-
-float  random(void)  = #12;
-
-void   cmd(string command, ...) = #13;
-
-// cvar cmds
-
-float  cvar(string name)                       = #14;
-const string str_cvar(string name)             = #71;
-void   cvar_set(string name, string value)     = #15;
-
-void   dprint(string text,...) = #16;
-
-// conversion functions
-
-string ftos(float f)   = #17;
-float  fabs(float f)   = #18;
-string vtos(vector v)  = #19;
-string etos(entity e)  = #20;
-
-float  stof(string val,...)  = #21;
-
-entity spawn(void)             = #22;
-void   remove(entity e)        = #23;
-
-entity find(entity start, .string field, string match)         = #24;
-entity findfloat(entity start, .float field, float match)      = #25;
-entity findentity(entity start, .entity field, entity match)   = #25;
-
-entity findchainstring(.string field, string match)    = #26;
-entity findchainfloat(.float field, float match)       = #27;
-entity findchainentity(.entity field, entity match)    = #27;
-
-string precache_file(string file)      = #28;
-string precache_sound(string sample)   = #29;
-
-void   crash(void)     = #72;
-void   coredump(void)  = #30;
-void   stackdump(void) = #73;
-void   traceon(void)   = #31;
-void   traceoff(void)  = #32;
-
-void   eprint(entity e)        = #33;
-float  rint(float f)           = #34;
-float  floor(float f)          = #35;
-float  ceil(float f)           = #36;
-entity nextent(entity e)       = #37;
-float  sin(float f)            = #38;
-float  cos(float f)            = #39;
-float  sqrt(float f)           = #40;
-vector randomvec(void)         = #41;
-
-float  registercvar(string name, string value, float flags)  = #42; // returns 1 if success
-
-float  min(float f,...)  = #43;
-float  max(float f,...)  = #44;
-
-float  bound(float min,float value, float max)  = #45;
-float  pow(float a, float b)  = #46;
-
-void   copyentity(entity src, entity dst)  = #47;
-
-float  fopen(string filename, float mode)  = #48;
-void   fclose(float fhandle)  = #49;
-string fgets(float fhandle)  = #50;
-void   fputs(float fhandle, string s)  = #51;
-
-float  strlen(string s)  = #52;
-string strcat(string s1,string s2,...)  = #53;
-string substring(string s, float start, float length)  = #54;
-
-vector stov(string s)  = #55;
-
-string strzone(string s)  = #56;
-void   strunzone(string s) = #57;
-
-float  tokenize(string s)  = #58;
-string argv(float n)  = #59;
-
-float  isserver(void)  = #60;
-float  clientcount(void)  = #61;
-float  clientstate(void)  = #62;
-void   clientcommand(float client, string s)  = #63;
-void   changelevel(string map)  = #64;
-void   localsound(string sample)  = #65;
-vector getmousepos(void)       = #66;
-float  gettime(void)           = #67;
-void   loadfromdata(string data) = #68;
-void   loadfromfile(string file) = #69;
-
-float  mod(float val, float m) = #70;
-
-float  search_begin(string pattern, float caseinsensitive, float quiet) = #74;
-void   search_end(float handle) = #75;
-float  search_getsize(float handle) = #76;
-string search_getfilename(float handle, float num) = #77;
-
-string chr(float ascii) = #78;
-
-/////////////////////////////////////////////////
-// Write* Functions
-/////////////////////////////////////////////////
-void   WriteByte(float data, float dest, float desto)  = #401;
-void   WriteChar(float data, float dest, float desto)  = #402;
-void   WriteShort(float data, float dest, float desto) = #403;
-void   WriteLong(float data, float dest, float desto)  = #404;
-void   WriteAngle(float data, float dest, float desto) = #405;
-void   WriteCoord(float data, float dest, float desto) = #406;
-void   WriteString(string data, float dest, float desto)= #407;
-void   WriteEntity(entity data, float dest, float desto) = #408;
-
-//////////////////////////////////////////////////
-// Draw funtions
-//////////////////////////////////////////////////
-
-float  iscachedpic(string name)        = #451;
-string precache_pic(string name, ...)  = #452;
-void   freepic(string name)            = #453;
-
-float  drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
-
-float  drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
-
-float  drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
-
-vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
-float  drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
-
-float  drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
-
-void   drawsetcliparea(float x, float y, float width, float height) = #458;
-
-void   drawresetcliparea(void) = #459;
-
-vector  drawgetimagesize(string pic) = #460;
-
-////////////////////////////////////////////////
-// Menu functions
-////////////////////////////////////////////////
-
-void   setkeydest(float dest)  = #601;
-float  getkeydest(void)        = #602;
-
-void   setmousetarget(float trg) = #603;
-float  getmousetarget(void)      = #604;
-
-float  isfunction(string function_name) = #607;
-void   callfunction(...) = #605;
-void   writetofile(float fhandle, entity ent) = #606;
-vector getresolution(float number) = #608;
-string keynumtostring(float keynum) = #609;
-
-float  gethostcachevalue(float type) = #611;
-string gethostcachestring(float type, float hostnr) = #612;
-
-//DP_CSQC_BINDMAPS
-//idea: daemon, motorsep
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(float key, float bindmap) getkeybind_bindmap = #342;
-float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
-vector(void) getbindmaps = #631;
-float(vector bm) setbindmaps = #632;
-string(string command, float bindmap) findkeysforcommand = #610;
-float(string key) stringtokeynum = #341;
-//<also allowed builtin number to match EXT_CSQC> string(float keynum) keynumtostring = #340;
-//description: key bind setting/getting including support for switchable
-//bindmaps.
-
-//DP_CRYPTO
-//idea: divVerent
-//darkplaces implementation: divVerent
-//field definitions: (MENUQC)
-string(string serveraddress) crypto_getkeyfp = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
-string(string serveraddress) crypto_getidfp = #634; // retrieves the cached host key fingerprint of a server given by IP address
-float(string serveraddress) crypto_getidstatus = #643; // retrieves the cached host key's key status. See below for CRYPTO_IDSTATUS_ defines.
-string(string serveraddress) crypto_getencryptlevel = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
-string(float i) crypto_getmykeyfp = #636; // retrieves the CA key fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
-string(float i) crypto_getmyidfp = #637; // retrieves the ID fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
-float CRYPTO_IDSTATUS_OUTOFRANGE = -1;
-float CRYPTO_IDSTATUS_EMPTY = 0;
-float CRYPTO_IDSTATUS_UNSIGNED = 1;
-float CRYPTO_IDSTATUS_SIGNED = 2;
-float(float i) crypto_getmyidstatus = #641; // retrieves the ID's status of a given CA slot, or 0 if slot is unused but more to come, or -1 if end of list
-float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
-//description:
-//use -1 as buffer handle to justs end delim as postdata
-
-//DP_GECKO_SUPPORT
-//idea: Res2k, BlackHC
-//darkplaces implementation: Res2k, BlackHC
-//constant definitions:
-float GECKO_BUTTON_DOWN         = 0;
-float GECKO_BUTTON_UP           = 1;
-// either use down and up or just press but not all of them!
-float GECKO_BUTTON_PRESS        = 2;
-// use this for mouse events if needed?
-float GECKO_BUTTON_DOUBLECLICK  = 3;
-//builtin definitions:
-float gecko_create( string name ) = #487;
-void gecko_destroy( string name ) = #488;
-void gecko_navigate( string name, string URI ) = #489;
-float gecko_keyevent( string name, float key, float eventtype ) = #490;
-void gecko_mousemove( string name, float x, float y ) = #491;
-void gecko_resize( string name, float w, float h ) = #492;
-vector gecko_get_texture_extent( string name ) = #493;
-//engine-called QC prototypes:
-//string(string name, string query) Qecko_Query;
-//description:
-//provides an interface to the offscreengecko library and allows for internet browsing in games
-
-//FTE_STRINGS
-//idea: many
-//darkplaces implementation: KrimZon
-//description:
-//various string manipulation functions
-int(string str, string sub, float startpos) strstrofs = #221;
-int(string str, float ofs) str2chr = #222;
-string(int c, ...) chr2str = #223;
-string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
-string(float chars, string s, ...) strpad = #225;
-string(string info, string key, string value, ...) infoadd = #226;
-string(string info, string key) infoget = #227;
-int(string s1, string s2) strcmp = #228;
-int(string s1, string s2, float len) strncmp = #228;
-int(string s1, string s2) strcasecmp = #229;
-int(string s1, string s2, float len) strncasecmp = #230;
-
-//DP_PRECACHE_PIC_FLAGS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
-float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
-float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
-//notes: these constants are given as optional second argument to precache_pic()
-
-//DP_QC_CRC16
-//idea: div0
-//darkplaces implementation: div0
-//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
-//When caseinsensitive is set, the CRC is calculated of the lower cased string.
-float(float caseinsensitive, string s, ...) crc16 = #494;
-
-//DP_QC_CVAR_TYPE
-float(string name) cvar_type = #495;
-float CVAR_TYPEFLAG_EXISTS = 1;
-float CVAR_TYPEFLAG_SAVED = 2;
-float CVAR_TYPEFLAG_PRIVATE = 4;
-float CVAR_TYPEFLAG_ENGINE = 8;
-float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
-float CVAR_TYPEFLAG_READONLY = 32;
-
-//DP_QC_STRINGBUFFERS
-//idea: ??
-//darkplaces implementation: LordHavoc
-//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
-int() buf_create = #440;
-void(float bufhandle) buf_del = #441;
-float(float bufhandle) buf_getsize = #442;
-void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
-void(float bufhandle, float sortpower, float backward) buf_sort = #444;
-string(float bufhandle, string glue) buf_implode = #445;
-string(float bufhandle, float string_index) bufstr_get = #446;
-void(float bufhandle, float string_index, string str) bufstr_set = #447;
-float(float bufhandle, string str, float order) bufstr_add = #448;
-void(float bufhandle, float string_index) bufstr_free = #449;
-void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
-
-//DP_QC_STRING_CASE_FUNCTIONS
-//idea: Dresk
-//darkplaces implementation: LordHavoc / Dresk
-//builtin definitions:
-string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
-string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
-//description:
-//provides simple string uppercase and lowercase functions
-
-//DP_QC_CVAR_DESCRIPTION
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string name) cvar_description = #518;
-//description:
-//returns the description of a cvar
-
-//DP_QC_DIGEST
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string digest, string data, ...) digest_hex = #639;
-//description:
-//returns a given hex digest of given data
-//the returned digest is always encoded in hexadecimal
-//only the "MD4" digest is always supported!
-//if the given digest is not supported, string_null is returned
-//the digest string is matched case sensitively, use "MD4", not "md4"!
-
-//DP_QC_URI_ESCAPE
-//idea: div0
-//darkplaces implementation: div0
-//URI::Escape's functionality
-string(string in) uri_escape = #510;
-string(string in) uri_unescape = #511;
-
-//DP_QC_URI_GET
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string
-//returns 1 on success of initiation, 0 if there are too many concurrent
-//connections already or if the URL is invalid
-//the following callback will receive the data and MUST exist!
-//  void(float id, float status, string data) URI_Get_Callback;
-//status is either
-//  negative for an internal error,
-//  0 for success, or
-//  the HTTP response code on server error (e.g. 404)
-//if 1 is returned by uri_get, the callback will be called in the future
-float(string url, float id) uri_get = #513;
-//DP_QC_URI_POST
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string after POSTing via HTTP
-//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
-//and uri_post sends the string buffer buf, joined using the delimiter delim
-float(string url, float id, string content_type, string data) uri_post = #513;
-float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
-
-//DP_QC_ENTITYDATA
-//idea: KrimZon
-//darkplaces implementation: KrimZon
-//builtin definitions:
-float() numentityfields = #496;
-string(float fieldnum) entityfieldname = #497;
-float(float fieldnum) entityfieldtype = #498;
-string(float fieldnum, entity ent) getentityfieldstring = #499;
-float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
-//constants:
-//Returned by entityfieldtype
-float FIELD_STRING   = 1;
-float FIELD_FLOAT    = 2;
-float FIELD_VECTOR   = 3;
-float FIELD_ENTITY   = 4;
-float FIELD_FUNCTION = 6;
-//description:
-//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
-//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
-//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
-//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
-//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
-//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
-//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
-
-//DP_COVERAGE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//function definitions:
-void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
-
-// assorted undocumented extensions
-string(string, float) netaddress_resolve = #625;
-string(string search, string replace, string subject) strreplace = #484;
-string(float uselocaltime, string format, ...) strftime = #478;
-float(string s) tokenize_console = #514;
-float(float i) argv_start_index = #515;
-float(float i) argv_end_index = #516;
-string(float, float) getgamedirinfo = #626;
-const float GETGAMEDIRINFO_NAME = 0;
-const float GETGAMEDIRINFO_DESCRIPTION = 1;
-float log(float f) = #532;
-string(string format, ...) sprintf = #627;
-string(string s) strdecolorize = #477;
-entity findflags(entity start, .float field, float match) = #87;
-entity findchainflags(.float field, float match) = #88;
-float(string s, string separator1, ...) tokenizebyseparator = #479;
-float  etof(entity ent) = #79;
-entity         ftoe(float num)  = #80;
-float   validstring(string str) = #81;
-float  altstr_count(string str) = #82;
-string  altstr_prepare(string str) = #83;
-string  altstr_get(string str, float num) = #84;
-string  altstr_set(string str, float num, string set) = #85;
-string         altstr_ins(string str, float num, string set) = #86;
-float  isdemo() = #349;
-float  drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #469;
-//vector       getresolution(float number, ...) = #608; // optional argument "isfullscreen"
-void   parseentitydata(entity ent, string data) = #613;
-void   resethostcachemasks(void) = #615;
-void   sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
-void   sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
-void   resorthostcache(void) = #618;
-float SLSF_DESCENDING = 1;
-float SLSF_FAVORITES = 2;
-float SLSF_CATEGORIES = 4;
-void   sethostcachesort(float fld, float slsf) = #619;
-void   refreshhostcache(...) = #620;  // optional boolean argument "clear_list"
-float  gethostcachenumber(float fld, float hostnr) = #621;
-float  gethostcacheindexforkey(string key) = #622;
-void   addwantedhostcachekey(string key) = #623;
-string getextresponse(void) = #624;
-const string cvar_string(string name) = #71;
-const string cvar_defstring(string name) = #89;
-float  stringwidth(string text, float handleColors, vector size) = #468;
+#define true _true
+#define false _false
+#define TRUE _TRUE
+#define FALSE _FALSE
+
+#include "upstream/menudefs.qc"
+
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
+
+int(string str, string sub, int startpos) _strstrofs = #221;
+#define strstrofs _strstrofs
+int(string str, int ofs) _str2chr = #222;
+#define str2chr _str2chr
+string(int c, ...) _chr2str = #223;
+#define chr2str _chr2str
+
+int(string s1, string s2) _strcmp = #228;
+#define strcmp _strcmp
+int(string s1, string s2, int len) _strncmp = #228;
+#define strncmp _strncmp
+int(string s1, string s2) _strcasecmp = #229;
+#define strcasecmp _strcasecmp
+int(string s1, string s2, int len) _strncasecmp = #230;
+#define strncasecmp _strncasecmp
+
+int() _buf_create = #440;
+#define buf_create _buf_create
 
 #pragma noref 0
 
index fe632ce8d97b8be2bc2aed7b87dc9581407f688a..bffacafddc59a928ac76441e89fe284579bb173a 100644 (file)
 #ifndef PROGSDEFS_H
 #define PROGSDEFS_H
 
-/*
-==============================================================================
+#pragma noref 1
 
-                       SOURCE FOR GLOBALVARS_T C STRUCTURE
-                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+#define true _true
+#define false _false
+#define TRUE _TRUE
+#define FALSE _FALSE
 
-==============================================================================
-*/
+#include "upstream/progsdefs.qc"
 
-//
-// system globals
-//
-entity         self;
-entity         other;
-entity         world;
-float          time;
-float          frametime;
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
 
-float          force_retouch;          // force all entities to touch triggers
-                                                               // next frame.  this is needed because
-                                                               // non-moving things don't normally scan
-                                                               // for triggers, and when a trigger is
-                                                               // created (like a teleport trigger), it
-                                                               // needs to catch everything.
-                                                               // decremented each frame, so set to 2
-                                                               // to guarantee everything is touched
-string         mapname;
+#pragma noref 0
 
-float          deathmatch;
-float          coop;
-float          teamplay;
-
-int                    serverflags;            // propagated from level to level, used to
-                                                               // keep track of completed episodes
-
-float          total_secrets;
-float          total_monsters;
-
-float          found_secrets;          // number of secrets found
-float          killed_monsters;        // number of monsters killed
-
-
-// spawnparms are used to encode information about clients across server
-// level changes
-float          parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
-
-//
-// global variables set by built in functions
-//
-vector         v_forward, v_up, v_right;       // set by makevectors()
-
-// set by traceline / tracebox
-float          trace_allsolid;
-float          trace_startsolid;
-float          trace_fraction;
-vector         trace_endpos;
-vector         trace_plane_normal;
-float          trace_plane_dist;
-entity         trace_ent;
-float          trace_inopen;
-float          trace_inwater;
-
-entity         msg_entity;                             // destination of single entity writes
-
-//
-// required prog functions
-//
-void()                 main;                                           // only for testing
-
-void()         StartFrame;
-
-void()                 PlayerPreThink;
-void()                 PlayerPostThink;
-
-void()         ClientKill;
-#ifdef DP_EXT_PRECONNECT
-void()         ClientPreConnect;
-#endif
-void()         ClientConnect;
-void()                 PutClientInServer;              // call after setting the parm1... parms
-void()         ClientDisconnect;
-
-void()         SetNewParms;                    // called when a client first connects to
-                                                                       // a server. sets parms so they can be
-                                                                       // saved off for restarts
-
-void()         SetChangeParms;                 // call to set parms for self so they can
-                                                                       // be saved for a level transition
-
-
-//================================================
-void           end_sys_globals;                // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
-                       SOURCE FOR ENTVARS_T C STRUCTURE
-                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
-
-==============================================================================
-*/
-
-//
-// system fields (*** = do not set in prog code, maintained by C code)
-//
-.int           modelindex;             // *** model index in the precached list
-.vector                absmin, absmax; // *** origin + mins / maxs
-
-.float         ltime;                  // local time for entity
-.float         movetype;
-.float         solid;
-
-.vector                origin;                 // ***
-.vector                oldorigin;              // ***
-.vector                velocity;
-.vector                angles;
-.vector                avelocity;
-
-.vector                punchangle;             // temp angle adjust from damage or recoil
-
-.string                classname;              // spawn function
-.string                model;
-.int           frame;
-.int           skin;
-.int           effects;
-
-.vector                mins, maxs;             // bounding box extents reletive to origin
-.vector                size;                   // maxs - mins
-
-.void()                touch;
-.void()                use;
-.void()                think;
-.void()                blocked;                // for doors or plats, called when can't push other
-
-.float         nextthink;
-.entity                groundentity;
-
-// stats
-.float         health;
-.float         frags;
-.int           weapon;                 // one of the IT_SHOTGUN, etc flags
-.string                weaponmodel;
-.float         weaponframe;
-.float         currentammo;
-.float         ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
-
-.int           items;                  // bit flags
-
-.float         takedamage;
-.entity                chain;
-.float         deadflag;
-
-.vector                view_ofs;                       // add to origin to get eye point
-
-
-.float         button0;                // fire
-.float         button1;                // use
-.float         button2;                // jump
-
-.float         impulse;                // weapon changes
-
-.float         fixangle;
-.vector                v_angle;                // view / targeting angle for players
-.float         idealpitch;             // calculated pitch angle for lookup up slopes
-
-
-.string                netname;
-
-.entity        enemy;
-
-.int           flags;
-
-.int           colormap;
-.float         team;
-
-.float         max_health;             // players maximum health is stored here
-
-.float         teleport_time;  // don't back up
-
-.float         armortype;              // save this fraction of incoming damage
-.float         armorvalue;
-
-.float         waterlevel;             // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
-.float         watertype;              // a contents value
-
-.float         ideal_yaw;
-.float         yaw_speed;
-
-.entity                aiment;
-
-.entity        goalentity;             // a movetarget or an enemy
-
-.int           spawnflags;
-
-.string                target;
-.string                targetname;
-
-// damage is accumulated through a frame. and sent as one single
-// message, so the super shotgun doesn't generate huge messages
-.float         dmg_take;
-.float         dmg_save;
-.entity                dmg_inflictor;
-
-.entity                owner;          // who launched a missile
-.vector                movedir;        // mostly for doors, but also used for waterjump
-
-.string                message;                // trigger messages
-
-.float         sounds;         // either a cd track number or sound number
-
-.string                noise, noise1, noise2, noise3;  // contains names of wavs to play
-
-//================================================
-void           end_sys_fields;                 // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
-                               CONSTANT DEFINITIONS
-
-==============================================================================
-*/
-
-
-//
-// constants
-//
-
-// edict.flags
-const int FL_FLY                               = 1;
-const int FL_SWIM                              = 2;
-const int FL_CLIENT                            = 8;    // set for all client edicts
-const int FL_INWATER                   = 16;   // for enter / leave water splash
-const int FL_MONSTER                   = 32;
-const int FL_GODMODE                   = 64;   // player cheat
-const int FL_NOTARGET                  = 128;  // player cheat
-const int FL_ITEM                              = 256;  // extra wide size for bonus items
-const int FL_ONGROUND                  = 512;  // standing on something
-const int FL_PARTIALGROUND             = 1024; // not all corners are valid
-const int FL_WATERJUMP                 = 2048; // player jumping out of water
-const int FL_JUMPRELEASED              = 4096; // for jump debouncing
-
-// edict.movetype values
-const int MOVETYPE_NONE                        = 0;    // never moves
-//const int    MOVETYPE_ANGLENOCLIP= 1;
-//const int    MOVETYPE_ANGLECLIP      = 2;
-const int MOVETYPE_WALK                        = 3;    // players only
-const int MOVETYPE_STEP                        = 4;    // discrete, not real time unless fall
-const int MOVETYPE_FLY                 = 5;
-const int MOVETYPE_TOSS                        = 6;    // gravity
-const int MOVETYPE_PUSH                        = 7;    // no clip to world, push and crush
-const int MOVETYPE_NOCLIP              = 8;
-const int MOVETYPE_FLYMISSILE  = 9;    // fly with extra size against monsters
-const int MOVETYPE_BOUNCE              = 10;
-const int MOVETYPE_BOUNCEMISSILE= 11;  // bounce with extra size
-
-// edict.solid values
-const int SOLID_NOT                            = 0;    // no interaction with other objects
-const int SOLID_TRIGGER                        = 1;    // touch on edge, but not blocking
-const int SOLID_BBOX                   = 2;    // touch on edge, block
-const int SOLID_SLIDEBOX               = 3;    // touch on edge, but not an onground
-const int SOLID_BSP                            = 4;    // bsp clip, touch on edge, block
-
-// range values
-const int RANGE_MELEE                  = 0;
-const int RANGE_NEAR                   = 1;
-const int RANGE_MID                            = 2;
-const int RANGE_FAR                            = 3;
-
-// deadflag values
-
-const int DEAD_NO                              = 0;
-const int DEAD_DYING                   = 1;
-const int DEAD_DEAD                            = 2;
-const int DEAD_RESPAWNABLE             = 3;
-const int DEAD_RESPAWNING              = 4; // dead, waiting for buttons to be released
-
-// takedamage values
-
-const int DAMAGE_NO                            = 0;
-const int DAMAGE_YES                   = 1;
-const int DAMAGE_AIM                   = 2;
-
-// items
-const int IT_AXE                               = 4096;
-const int IT_SHOTGUN                   = 1;
-const int IT_SUPER_SHOTGUN             = 2;
-const int IT_NAILGUN                   = 4;
-const int IT_SUPER_NAILGUN             = 8;
-const int IT_GRENADE_LAUNCHER  = 16;
-const int IT_ROCKET_LAUNCHER   = 32;
-const int IT_LIGHTNING                 = 64;
-const int IT_EXTRA_WEAPON              = 128;
-
-//const int IT_SHELLS                  = 256;
-//const int IT_NAILS                   = 512;
-//const int IT_ROCKETS                 = 1024;
-//const int IT_CELLS                   = 2048;
-
-const int IT_ARMOR1                            = 8192;
-const int IT_ARMOR2                            = 16384;
-const int IT_ARMOR3                            = 32768;
-const int IT_SUPERHEALTH               = 65536;
-
-//const int IT_KEY1                            = 131072;
-//const int IT_KEY2                            = 262144;
-
-const int IT_INVISIBILITY              = 524288;
-const int IT_INVULNERABILITY   = 1048576;
-const int IT_SUIT                              = 2097152;
-const int IT_QUAD                              = 4194304;
-
-// point content values
-
-const int CONTENT_EMPTY                        = -1;
-const int CONTENT_SOLID                        = -2;
-const int CONTENT_WATER                        = -3;
-const int CONTENT_SLIME                        = -4;
-const int CONTENT_LAVA                 = -5;
-const int CONTENT_SKY                  = -6;
-
-const int STATE_TOP                            = 0;
-const int STATE_BOTTOM                 = 1;
-const int STATE_UP                             = 2;
-const int STATE_DOWN                   = 3;
-
-const vector VEC_ORIGIN                = '0 0 0';
-const vector VEC_HULL_MIN              = '-16 -16 -24';
-const vector VEC_HULL_MAX              = '16 16 32';
-
-const vector VEC_HULL2_MIN             = '-32 -32 -24';
-const vector VEC_HULL2_MAX             = '32 32 64';
-
-// protocol bytes
-const int SVC_TEMPENTITY               = 23;
-const int SVC_KILLEDMONSTER            = 27;
-const int SVC_FOUNDSECRET              = 28;
-const int SVC_INTERMISSION             = 30;
-const int SVC_FINALE                   = 31;
-const int SVC_CDTRACK                  = 32;
-const int SVC_SELLSCREEN               = 33;
-
-
-const int TE_SPIKE                             = 0;
-const int TE_SUPERSPIKE                        = 1;
-const int TE_GUNSHOT                   = 2;
-const int TE_EXPLOSION                 = 3;
-const int TE_TAREXPLOSION              = 4;
-const int TE_LIGHTNING1                        = 5;
-const int TE_LIGHTNING2                        = 6;
-const int TE_WIZSPIKE                  = 7;
-const int TE_KNIGHTSPIKE               = 8;
-const int TE_LIGHTNING3                        = 9;
-const int TE_LAVASPLASH                        = 10;
-const int TE_TELEPORT                  = 11;
-
-// sound channels
-// channel 0 never willingly overrides
-// other channels (1-7) allways override a playing sound on that channel
-const int CHAN_AUTO                            = 0;
-const int CHAN_WEAPON                  = 1;
-const int CHAN_VOICE                   = 2;
-const int CHAN_ITEM                            = 3;
-const int CHAN_BODY                            = 4;
-
-const int ATTN_NONE                            = 0;
-const int ATTN_NORM                            = 1;
-const int ATTN_IDLE                            = 2;
-const int ATTN_STATIC                  = 3;
-
-// update types
-
-const int UPDATE_GENERAL               = 0;
-const int UPDATE_STATIC                        = 1;
-const int UPDATE_BINARY                        = 2;
-const int UPDATE_TEMP                  = 3;
-
-// entity effects
-
-const int EF_BRIGHTFIELD               = 1;
-const int EF_MUZZLEFLASH               = 2;
-const int EF_BRIGHTLIGHT               = 4;
-const int EF_DIMLIGHT                  = 8;
-
-
-// messages
-const int MSG_BROADCAST                        = 0;            // unreliable to all
-const int MSG_ONE                              = 1;            // reliable to one (msg_entity)
-const int MSG_ALL                              = 2;            // reliable to all
-const int MSG_INIT                             = 3;            // write to the init string
-
-//===========================================================================
-
-//
-// builtin functions
-//
-
-void(vector ang)       makevectors             = #1;           // sets v_forward, etc globals
-void(entity e, vector o) setorigin     = #2;
-void(entity e, string m) setmodel      = #3;           // set movetype and solid first
-void(entity e, vector min, vector max) setsize = #4;
-// #5 was removed
-void() break_to_debugger                                               = #6;
-float() random                                         = #7;           // returns 0 - 1
-void(entity e, float chan, string samp, float vol, float atten) sound = #8;
-vector(vector v) normalize                     = #9;
-void(string e, ...) error                              = #10;
-void(string e, ...) objerror                           = #11;
-float(vector v) vlen                           = #12;
-float(vector v) vectoyaw                       = #13;
-entity() spawn                                         = #14;
-void(entity e) remove                          = #15;
-
-// sets trace_* globals
-// nomonsters can be:
-// An entity will also be ignored for testing if forent == test,
-// forent->owner == test, or test->owner == forent
-// a forent of world is ignored
-void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
-
-entity() checkclient                           = #17;  // returns a client to look for
-entity(entity start, .string fld, string match) find = #18;
-string(string s) precache_sound                = #19;
-string(string s) precache_model                = #20;
-void(entity client, string s, ...)stuffcmd = #21;
-entity(vector org, float rad) findradius = #22;
-void(string s, ...) bprint                             = #23;
-void(entity client, string s, ...) sprint = #24;
-void(string s, ...) dprint                             = #25;
-string(float f) ftos                           = #26;
-string(vector v) vtos                          = #27;
-void() coredump                                                = #28;          // prints all edicts
-void() traceon                                         = #29;          // turns statment trace on
-void() traceoff                                                = #30;
-void(entity e) eprint                          = #31;          // prints an entire edict
-float(float yaw, float dist) walkmove  = #32;  // returns true or false
-// #33 was removed
-float() droptofloor= #34;      // true if landed on floor
-void(float style, string value) lightstyle = #35;
-float(float v) rint                                    = #36;          // round to nearest int
-float(float v) floor                           = #37;          // largest integer <= v
-float(float v) ceil                                    = #38;          // smallest integer >= v
-// #39 was removed
-float(entity e) checkbottom                    = #40;          // true if self is on ground
-float(vector v) pointcontents          = #41;          // returns a CONTENT_*
-// #42 was removed
-float(float f) fabs = #43;
-vector(entity e, float speed) aim = #44;               // returns the shooting vector
-float(string s) cvar = #45;                                            // return cvar.value
-void(string s, ...) localcmd = #46;                                    // put string into local que
-entity(entity e) nextent = #47;                                        // for looping through all ents
-void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
-void() ChangeYaw = #49;                                                // turn towards self.ideal_yaw
-                                                                                       // at self.yaw_speed
-// #50 was removed
-vector(vector v) vectoangles                   = #51;
-
-//
-// direct client message generation
-//
-void(float to, float f) WriteByte              = #52;
-void(float to, float f) WriteChar              = #53;
-void(float to, float f) WriteShort             = #54;
-void(float to, float f) WriteLong              = #55;
-void(float to, float f) WriteCoord             = #56;
-void(float to, float f) WriteAngle             = #57;
-void(float to, string s, ...) WriteString      = #58;
-void(float to, entity s) WriteEntity   = #59;
-
-//
-// broadcast client message generation
-//
-
-// void(float f) bWriteByte            = #59;
-// void(float f) bWriteChar            = #60;
-// void(float f) bWriteShort           = #61;
-// void(float f) bWriteLong            = #62;
-// void(float f) bWriteCoord           = #63;
-// void(float f) bWriteAngle           = #64;
-// void(string s) bWriteString = #65;
-// void(entity e) bWriteEntity = #66;
-
-void(float step) movetogoal                            = #67;
-
-string(string s) precache_file         = #68;  // no effect except for -copy
-void(entity e) makestatic              = #69;
-void(string s) changelevel = #70;
-
-//#71 was removed
-
-void(string name, string value) cvar_set = #72;        // sets cvar.value
-
-void(entity client, string s, ...) centerprint = #73;  // sprint, but in middle
-
-void(vector pos, string samp, float vol, float atten) ambientsound = #74;
-
-string(string s) precache_model2       = #75;          // registered version only
-string(string s) precache_sound2       = #76;          // registered version only
-string(string s) precache_file2                = #77;          // registered version only
-
-void(entity e) setspawnparms           = #78;          // set parm1... to the
-                                                                                               // values at level start
-                                                                                               // for coop respawn
-
-//============================================================================
 #endif
diff --git a/qcsrc/dpdefs/upstream/csprogsdefs.qc b/qcsrc/dpdefs/upstream/csprogsdefs.qc
new file mode 100644 (file)
index 0000000..202b840
--- /dev/null
@@ -0,0 +1,1466 @@
+/*
+==============================================================================
+
+                       SOURCE FOR GLOBALVARS_T C STRUCTURE
+                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity         self;
+entity         other;
+entity         world;
+float          time;
+float          frametime;
+
+float          player_localentnum;     //the entnum
+float          player_localnum;        //the playernum
+float          maxclients;     //a constant filled in by the engine. gah, portability eh?
+
+float          clientcommandframe;     //player movement
+float          servercommandframe;     //clientframe echoed off the server
+
+string         mapname;
+
+//
+// global variables set by built in functions
+//
+vector         v_forward, v_up, v_right;       // set by makevectors()
+
+// set by traceline / tracebox
+float          trace_allsolid;
+float          trace_startsolid;
+float          trace_fraction;
+vector         trace_endpos;
+vector         trace_plane_normal;
+float          trace_plane_dist;
+entity         trace_ent;
+float          trace_inopen;
+float          trace_inwater;
+
+//
+// required prog functions
+//
+void()         CSQC_Init;
+void()         CSQC_Shutdown;
+float(float f, float t, float n)       CSQC_InputEvent;
+void(float w, float h)         CSQC_UpdateView;
+float(string s)        CSQC_ConsoleCommand;
+
+//these fields are read and set by the default player physics
+vector         pmove_org;
+vector         pmove_vel;
+vector         pmove_mins;
+vector         pmove_maxs;
+//retrieved from the current movement commands (read by player physics)
+float          input_timelength;
+vector         input_angles;
+vector         input_movevalues;       //forwards, right, up.
+float          input_buttons;          //attack, use, jump (default physics only uses jump)
+
+float          movevar_gravity;
+float          movevar_stopspeed;
+float          movevar_maxspeed;
+float          movevar_spectatormaxspeed;      //used by NOCLIP movetypes.
+float          movevar_accelerate;
+float          movevar_airaccelerate;
+float          movevar_wateraccelerate;
+float          movevar_friction;
+float          movevar_waterfriction;
+float          movevar_entgravity;     //the local player's gravity field. Is a multiple (1 is the normal value)
+
+//================================================
+void           end_sys_globals;                // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+                       SOURCE FOR ENTVARS_T C STRUCTURE
+                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float         modelindex;             // *** model index in the precached list
+.vector                absmin, absmax; // *** origin + mins / maxs
+
+.float         entnum; // *** the ent number as on the server
+.float         drawmask;
+.void()                predraw;
+
+.float         movetype;
+.float         solid;
+
+.vector                origin;                 // ***
+.vector                oldorigin;              // ***
+.vector                velocity;
+.vector                angles;
+.vector                avelocity;
+
+.string                classname;              // spawn function
+.string                model;
+.float         frame;
+.float         skin;
+.float         effects;
+
+.vector                mins, maxs;             // bounding box extents reletive to origin
+.vector                size;                   // maxs - mins
+
+.void()                touch;
+.void()                use;
+.void()                think;
+.void()                blocked;                // for doors or plats, called when can't push other
+
+.float         nextthink;
+
+.entity                chain;
+
+.string                netname;
+
+.entity        enemy;
+
+.float         flags;
+
+.float         colormap;
+
+.entity                owner;          // who launched a missile
+
+//================================================
+void           end_sys_fields;                 // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+                       OPTIONAL FIELDS AND GLOBALS
+
+==============================================================================
+*/
+
+// Additional OPTIONAL Fields and Globals
+float          intermission; // indicates intermission state (0 = normal, 1 = scores, 2 = finale text)
+
+vector         view_angles; // same as input_angles
+vector         view_punchangle; // from server
+vector         view_punchvector; // from server
+
+/*
+==============================================================================
+
+                       CONSTANT DEFINITIONS
+
+==============================================================================
+*/
+
+const float MASK_ENGINE                        = 1;
+const float MASK_ENGINEVIEWMODELS      = 2;
+const float MASK_NORMAL                        = 4;
+
+const float RF_VIEWMODEL       = 1;
+const float RF_EXTERNALMODEL   = 2;
+const float RF_DEPTHHACK       = 4;
+const float RF_ADDITIVE                = 8;
+const float RF_USEAXIS         = 16;
+
+const float VF_MIN             = 1;    //(vector)
+const float VF_MIN_X           = 2;    //(float)
+const float VF_MIN_Y           = 3;    //(float)
+const float VF_SIZE            = 4;    //(vector) (viewport size)
+const float VF_SIZE_Y          = 5;    //(float)
+const float VF_SIZE_X          = 6;    //(float)
+const float VF_VIEWPORT                = 7;    //(vector, vector)
+const float VF_FOV             = 8;    //(vector)
+const float VF_FOVX            = 9;    //(float)
+const float VF_FOVY            = 10;   //(float)
+const float VF_ORIGIN          = 11;   //(vector)
+const float VF_ORIGIN_X                = 12;   //(float)
+const float VF_ORIGIN_Y                = 13;   //(float)
+const float VF_ORIGIN_Z                = 14;   //(float)
+const float VF_ANGLES          = 15;   //(vector)
+const float VF_ANGLES_X                = 16;   //(float)
+const float VF_ANGLES_Y                = 17;   //(float)
+const float VF_ANGLES_Z                = 18;   //(float)
+const float VF_DRAWWORLD       = 19;   //(float)
+const float VF_DRAWENGINESBAR  = 20;   //(float)
+const float VF_DRAWCROSSHAIR   = 21;   //(float)
+
+const float VF_CL_VIEWANGLES   = 33;   //(vector)
+const float VF_CL_VIEWANGLES_X = 34;   //(float)
+const float VF_CL_VIEWANGLES_Y = 35;   //(float)
+const float VF_CL_VIEWANGLES_Z = 36;   //(float)
+
+const float VF_PERSPECTIVE      = 200;
+
+const float STAT_HEALTH                = 0;
+const float STAT_WEAPONMODEL   = 2;
+const float STAT_AMMO          = 3;
+const float STAT_ARMOR         = 4;
+const float STAT_WEAPONFRAME   = 5;
+const float STAT_SHELLS                = 6;
+const float STAT_NAILS         = 7;
+const float STAT_ROCKETS       = 8;
+const float STAT_CELLS         = 9;
+const float STAT_ACTIVEWEAPON  = 10;
+const float STAT_TOTALSECRETS  = 11;
+const float STAT_TOTALMONSTERS = 12;
+const float STAT_SECRETS               = 13;
+const float STAT_MONSTERS              = 14;
+const float STAT_ITEMS         = 15;
+const float STAT_VIEWHEIGHT    = 16;
+
+// Quake Sound Constants
+const float CHAN_AUTO                  = 0;
+const float CHAN_WEAPON                        = 1;
+const float CHAN_VOICE                 = 2;
+const float CHAN_ITEM                  = 3;
+const float CHAN_BODY                  = 4;
+
+const float ATTN_NONE                  = 0;
+const float ATTN_NORM                  = 1;
+const float ATTN_IDLE                  = 2;
+const float ATTN_STATIC                        = 3;
+
+// Frik File Constants
+const float FILE_READ                  = 0;
+const float FILE_APPEND                        = 1;
+const float FILE_WRITE                 = 2;
+
+// Quake Point Contents
+const float CONTENT_EMPTY                                      = -1;
+const float CONTENT_SOLID                                      = -2;
+const float CONTENT_WATER                                      = -3;
+const float CONTENT_SLIME                                      = -4;
+const float CONTENT_LAVA                                       = -5;
+const float CONTENT_SKY                                                = -6;
+
+// Quake Solid Constants
+const float SOLID_NOT                                          = 0;
+const float SOLID_TRIGGER                                      = 1;
+const float SOLID_BBOX                                         = 2;
+const float SOLID_SLIDEBOX                                     = 3;
+const float SOLID_BSP                                          = 4;
+const float SOLID_CORPSE                                       = 5;
+
+// Quake Move Constants
+const float MOVE_NORMAL                                                = 0;
+const float MOVE_NOMONSTERS                                    = 1;
+const float MOVE_MISSILE                                       = 2;
+
+// Boolean Constants
+const float true       = 1;
+const float false      = 0;
+const float TRUE       = 1;
+const float FALSE      = 0;
+
+const float EXTRA_LOW = -99999999;
+const float EXTRA_HIGH = 99999999;
+
+const vector VEC_1     = '1 1 1';
+const vector VEC_0     = '0 0 0';
+const vector VEC_M1    = '-1 -1 -1';
+
+const float M_PI = 3.14159265358979323846;
+
+vector VEC_HULL_MIN = '-16 -16 -24';
+vector VEC_HULL_MAX = '16 16 32';
+
+// Quake Temporary Entity Constants
+const float TE_SPIKE                                           = 0;
+const float TE_SUPERSPIKE                                      = 1;
+const float TE_GUNSHOT                                         = 2;
+const float TE_EXPLOSION                                       = 3;
+const float TE_TAREXPLOSION                                    = 4;
+const float TE_LIGHTNING1                                      = 5;
+const float TE_LIGHTNING2                                      = 6;
+const float TE_WIZSPIKE                                                = 7;
+const float TE_KNIGHTSPIKE                                     = 8;
+const float TE_LIGHTNING3                                      = 9;
+const float TE_LAVASPLASH                                      = 10;
+const float TE_TELEPORT                                                = 11;
+const float TE_EXPLOSION2                                      = 12;
+       // Darkplaces Additions
+       const float TE_EXPLOSIONRGB                                     = 53;
+       const float TE_GUNSHOTQUAD                                      = 57;
+       const float TE_EXPLOSIONQUAD                            = 70;
+       const float TE_SPIKEQUAD                                        = 58;
+       const float TE_SUPERSPIKEQUAD                           = 59;
+
+// PFlags for Dynamic Lights
+const float PFLAGS_NOSHADOW                                    = 1;
+const float PFLAGS_CORONA                                      = 2;
+const float PFLAGS_FULLDYNAMIC                         = 128;
+
+const float EF_ADDITIVE                = 32;
+const float EF_BLUE            = 64;
+const float EF_FLAME           = 1024;
+const float EF_FULLBRIGHT      = 512;
+const float EF_NODEPTHTEST     = 8192;
+const float EF_NODRAW          = 16;
+const float EF_NOSHADOW                = 4096;
+const float EF_RED             = 128;
+const float EF_STARDUST                = 2048;
+const float EF_SELECTABLE      = 16384;
+
+const float PFL_ONGROUND       = 1;
+const float PFL_CROUCH         = 2;
+const float PFL_DEAD           = 4;
+const float PFL_GIBBED         = 8;
+
+// draw flags
+const float DRAWFLAG_NORMAL = 0;
+const float DRAWFLAG_ADDITIVE = 1;
+const float DRAWFLAG_MODULATE = 2;
+const float DRAWFLAG_2XMODULATE = 3;
+const float DRAWFLAG_SCREEN = 4;
+const float DRAWFLAG_MIPMAP = 0x100; // only for R_BeginPolygon
+
+/*
+==============================================================================
+
+                       BUILTIN DEFINITIONS
+                       EXTENSIONS ARE NOT ADDED HERE, BUT BELOW!
+
+==============================================================================
+*/
+
+void(vector ang) makevectors = #1;
+void(entity e, vector o) setorigin = #2;
+void(entity e, string m) setmodel = #3;
+void(entity e, vector min, vector max) setsize = #4;
+
+void() break_to_debugger = #6;
+float() random = #7;
+void(entity e, float chan, string samp) sound = #8;
+vector(vector v) normalize = #9;
+void(string e) error = #10;
+void(string e) objerror = #11;
+float(vector v) vlen = #12;
+float(vector v) vectoyaw = #13;
+entity() spawn = #14;
+void(entity e) remove = #15;
+float(vector v1, vector v2, float tryents, entity ignoreentity) traceline = #16;
+
+entity(entity start, .string fld, string match) find = #18;
+void(string s) precache_sound = #19;
+void(string s) precache_model = #20;
+
+entity(vector org, float rad) findradius = #22;
+
+void(string s, ...) dprint = #25;
+string(float f) ftos = #26;
+string(vector v) vtos = #27;
+void() coredump = #28;
+void() traceon = #29;
+void() traceoff = #30;
+void(entity e) eprint = #31;
+// settrace optional
+float(float yaw, float dist, float settrace) walkmove = #32;
+
+float() droptofloor = #34;
+void(float style, string value) lightstyle = #35;
+float(float v) rint = #36;
+float(float v) floor = #37;
+float(float v) ceil = #38;
+
+float(entity e) checkbottom = #40;
+float(vector v) pointcontents = #41;
+
+float(float f) fabs = #43;
+
+float(string s) cvar = #45;
+void(string s, ...) localcmd = #46;
+entity(entity e) nextent = #47;
+void(vector o, vector d, float color, float count) particle = #48;
+void() ChangeYaw = #49;
+
+vector(vector v) vectoangles = #51;
+vector(vector v, vector w) vectoangles2 = #51;
+
+float(float f) sin = #60;
+float(float f) cos = #61;
+float(float f) sqrt = #62;
+void(entity ent) changepitch = #63;
+void(entity e, entity ignore) tracetoss = #64;
+string(entity ent) etos = #65;
+
+string(string s) precache_file = #68;
+void(entity e) makestatic = #69;
+
+void(string var, string val) cvar_set = #72;
+
+void(vector pos, string samp, float vol, float atten) ambientsound = #74;
+string(string s) precache_model2 = #75;
+string(string s) precache_sound2 = #76;
+string(string s) precache_file2 = #77;
+
+float(string s) stof = #81;
+
+
+void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+vector() randomvec = #91;
+vector(vector org) getlight = #92;
+vector(vector org, float lpflags) getlight2 = #92;
+vector getlight_dir;
+vector getlight_ambient;
+vector getlight_diffuse;
+const float LP_LIGHTMAP        = 1;
+const float LP_RTWORLD = 2;
+const float LP_DYNLIGHT = 4;
+const float LP_COMPLETE = 7;
+
+float(string name, string value) registercvar = #93;
+float( float a, ... ) min = #94;
+float( float b, ... ) max = #95;
+float(float minimum, float val, float maximum) bound = #96;
+float(float f, float f) pow = #97;
+entity(entity start, .float fld, float match) findfloat = #98;
+float(string s) checkextension = #99;
+// FrikaC and Telejano range #100-#199
+
+float(string filename, float mode) fopen = #110;
+void(float fhandle) fclose = #111;
+string(float fhandle) fgets = #112;
+void(float fhandle, string s) fputs = #113;
+float(string s) strlen = #114;
+string(...) strcat = #115;
+string(string s, float start, float length) substring = #116;
+vector(string) stov = #117;
+string(string s) strzone = #118;
+void(string s) strunzone = #119;
+
+// FTEQW range #200-#299
+
+float(float number, float quantity) bitshift = #218;
+
+//float(string str, string sub[, float startpos]) strstrofs = #221;
+float(string str, string sub, float startpos) strstrofs = #221;
+float(string str, float ofs) str2chr = #222;
+string(float c, ...) chr2str = #223;
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
+string(float chars, string s, ...) strpad = #225;
+string(string info, string key, string value, ...) infoadd = #226;
+string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
+float(string s1, string s2, float len) strncmp = #228;
+float(string s1, string s2) strcasecmp = #229;
+float(string s1, string s2, float len) strncasecmp = #230;
+
+// CSQC range #300-#399
+void() clearscene = #300;
+void(float mask) addentities = #301;
+void(entity ent) addentity = #302;
+float(float property, ...) setproperty = #303;
+float(float property) getproperty = #309;
+vector(float property) getpropertyvec = #309;
+void() renderscene = #304;
+void(vector org, float radius, vector lightcolours) adddynamiclight = #305;
+void(vector org, float radius, vector lightcolours, float style, string cubemapname, float pflags) adddynamiclight2 = #305;
+//void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon = #306;
+void(string texturename, float flag, ...) R_BeginPolygon = #306;
+void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
+void() R_EndPolygon = #308;
+vector (vector v) cs_unproject = #310;
+vector (vector v) cs_project = #311;
+
+void(float width, vector pos1, vector pos2, float flag) drawline = #315;
+float(string name) iscachedpic = #316;
+string(string name, ...) precache_pic = #317;
+string(string name) precache_cubemap = #317;
+vector(string picname) draw_getimagesize = #318;
+void(string name) freepic = #319;
+float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter = #320;
+float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #321;
+float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic = #322;
+float(vector position, vector size, vector rgb, float alpha, float flag) drawfill = #323;
+void(float x, float y, float width, float height) drawsetcliparea = #324;
+void(void) drawresetcliparea = #325;
+float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
+vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
+
+float(float stnum) getstatf = #330;
+float(float stnum, ...) getstati = #331; // can optionally take first bit and count
+string(float firststnum) getstats = #332;
+void(entity e, float mdlindex) setmodelindex = #333;
+string(float mdlindex) modelnameforindex = #334;
+float(string effectname) particleeffectnum = #335;
+void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
+//void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
+void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
+void(string s, ...) centerprint = #338;
+void(string s, ...) print = #339;
+string(float keynum) keynumtostring = #340;
+float(string keyname) stringtokeynum = #341;
+string(float keynum) getkeybind = #342;
+void(float usecursor) setcursormode = #343;
+vector() getmousepos = #344;
+float(float framenum) getinputstate = #345;
+void(float sens) setsensitivityscale = #346;
+void(...) runstandardplayerphysics = #347; // this may or may not take a player ent
+string(float playernum, string keyname) getplayerkeyvalue = #348;
+float() isdemo = #349;
+float() isserver = #350;
+void(vector origin, vector forward, vector right, vector up) SetListener = #351;
+void(string cmdname) registercommand = #352;
+float(entity ent) wasfreed = #353;
+string(string key) serverkey = #354;
+
+// Use proper case; refer to the id1 Write* functions!
+float() ReadByte = #360;
+float() ReadChar = #361;
+float() ReadShort = #362;
+float() ReadLong = #363;
+float() ReadCoord = #364;
+float() ReadAngle = #365;
+string() ReadString = #366;
+float() ReadFloat = #367;
+
+// LordHavoc's range #400-#499
+void(entity from, entity to) copyentity = #400;
+
+entity(.string fld, string match) findchain = #402;
+entity(.float fld, float match) findchainfloat = #403;
+void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+void(vector org, vector velocity, float howmany) te_blood = #405;
+void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+void(vector org, vector color) te_explosionrgb = #407;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+void(vector org, vector vel, float howmany) te_spark = #411;
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+void(vector org) te_smallflash = #416;
+void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float colorstart, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+void(vector dir) vectorvectors = #432;
+void(vector org) te_plasmaburn = #433;
+float(entity e, float s) getsurfacenumpoints = #434;
+vector(entity e, float s, float n) getsurfacepoint = #435;
+vector(entity e, float s) getsurfacenormal = #436;
+string(entity e, float s) getsurfacetexture = #437;
+float(entity e, vector p) getsurfacenearpoint = #438;
+vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
+
+float(string s) tokenize = #441;
+string(float n) argv = #442;
+void(entity e, entity tagentity, string tagname) setattachment = #443;
+float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void(float handle) search_end = #445;
+float(float handle) search_getsize = #446;
+string(float handle, float num) search_getfilename = #447;
+string(string s) cvar_string = #448;
+entity(entity start, .float fld, float match) findflags = #449;
+entity(.float fld, float match) findchainflags = #450;
+float(entity ent, string tagname) gettagindex = #451;
+vector(entity ent, float tagindex) gettaginfo = #452;
+
+void(vector org, vector vel, float howmany) te_flamejet = #457;
+
+entity(float num) entitybyindex = #459;
+float() buf_create = #460;
+void(float bufhandle) buf_del = #461;
+float(float bufhandle) buf_getsize = #462;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
+void(float bufhandle, float sortpower, float backward) buf_sort = #464;
+string(float bufhandle, string glue) buf_implode = #465;
+string(float bufhandle, float string_index) bufstr_get = #466;
+void(float bufhandle, float string_index, string str) bufstr_set = #467;
+float(float bufhandle, string str, float order) bufstr_add = #468;
+void(float bufhandle, float string_index) bufstr_free = #469;
+
+float(float s) asin = #471;
+float(float c) acos = #472;
+float(float t) atan = #473;
+float(float c, float s) atan2 = #474;
+float(float a) tan = #475;
+float(string s) strippedstringlen = #476;
+float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
+string(string s) decolorizedstring = #477;
+string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
+string(float uselocaltime, string format, ...) strftime = #478;
+string(string s) strtolower = #480;
+string(string s) strtoupper = #481;
+string(string s) cvar_defstring = #482;
+void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
+string(string search, string replace, string subject) strreplace = #484;
+string(string search, string replace, string subject) strireplace = #485;
+vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
+#ifdef SUPPORT_GECKO
+float gecko_create( string name ) = #487;
+void gecko_destroy( string name ) = #488;
+void gecko_navigate( string name, string URI ) = #489;
+float gecko_keyevent( string name, float key, float eventtype ) = #490;
+void gecko_mousemove( string name, float x, float y ) = #491;
+void gecko_resize( string name, float w, float h ) = #492;
+vector gecko_get_texture_extent( string name ) = #493;
+#else
+
+#endif
+
+/*
+==============================================================================
+
+                       EXTENSION DEFINITIONS
+
+==============================================================================
+*/
+
+// DP_CSQC_SPAWNPARTICLE
+// idea: VorteX
+// darkplaces implementation: VorteX
+// constant definitions:
+// particle base behavior:
+float PT_ALPHASTATIC = 1;
+float PT_STATIC = 2;
+float PT_SPARK = 3;
+float PT_BEAM = 4;
+float PT_RAIN = 5;
+float PT_RAINDECAL = 6;
+float PT_SNOW = 7;
+float PT_BUBBLE = 8;
+float PT_BLOOD = 9;
+float PT_SMOKE = 10;
+float PT_DECAL = 11;
+float PT_ENTITYPARTICLE = 12;
+// particle blendtypes:
+float PBLEND_ALPHA = 0;
+float PBLEND_ADD = 1;
+float PBLEND_INVMOD = 2;
+// particle orientation:
+float PARTICLE_BILLBOARD = 0;
+float PARTICLE_SPARK = 1;
+float PARTICLE_ORIENTED_DOUBLESIDED = 2;
+float PARTICLE_BEAM = 3;
+// global definitions:
+float particle_type; // one of PT_
+float particle_blendmode; // one of PBLEND_ values
+float particle_orientation; // one of PARTICLE_ values
+vector particle_color1;
+vector particle_color2;
+float particle_tex; // number of chunk in particlefont
+float particle_size;
+float particle_sizeincrease;
+float particle_alpha;
+float particle_alphafade;
+float particle_time;
+float particle_gravity;
+float particle_bounce;
+float particle_airfriction;
+float particle_liquidfriction;
+float particle_originjitter;
+float particle_velocityjitter;
+float particle_qualityreduction; // enable culling of this particle when FPS is low
+float particle_stretch;
+vector particle_staincolor1;
+vector particle_staincolor2;
+float particle_staintex;
+float particle_stainalpha;
+float particle_stainsize;
+float particle_delayspawn;
+float particle_delaycollision;
+float particle_angle;
+float particle_spin;
+// builtin definitions:
+float(float max_themes) initparticlespawner = #522; // check fields/globals for integration and enable particle spawner, return 1 is succeded, otherwise returns 0
+void() resetparticle = #523; // reset p_ globals to default theme #0
+void(float theme) particletheme = #524; // restore p_ globals from saved theme
+float() particlethemesave = #525; // save p_ globals to new particletheme and return it's index
+void(float theme) particlethemeupdate = #525; // save p_ globals to new particletheme and return it's index
+void(float theme) particlethemefree = #526; // delete a particle theme
+float(vector org, vector vel) spawnparticle = #527; // returns 0 when failed, 1 when spawned
+float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
+float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
+float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
+// description: this builtin provides an easy and flexible way to spawn particles,
+// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
+// With this extension you can create a specific particles like rain particles, or entity particles
+// notes:
+// 1) 0 is default particle template, it could be changed
+// 2) color vectors could have value 0-255 of each component
+// restrictions: max themes could be between 4 and 2048
+// warning: you should call initparticlespawner() at very beginning BEFORE all other particle spawner functions
+// function to query particle info
+// don't remove this function as it protects all particle_ globals from FTEQCC/FRIKQCC non-referenced removal optimisation
+void() printparticle =
+{
+       // vortex: this also protects from 'non-referenced' optimisation on some compilers
+       print("PARTICLE:\n");
+       print(strcat("  type: ", ftos(particle_type), "\n"));
+       print(strcat("  blendmode: ", ftos(particle_blendmode), "\n"));
+       print(strcat("  orientation: ", ftos(particle_orientation), "\n"));
+       print(strcat("  color1: ", vtos(particle_color1), "\n"));
+       print(strcat("  color2: ", vtos(particle_color2), "\n"));
+       print(strcat("  tex: ", ftos(particle_tex), "\n"));
+       print(strcat("  size: ", ftos(particle_size), "\n"));
+       print(strcat("  sizeincrease: ", ftos(particle_sizeincrease), "\n"));
+       print(strcat("  alpha: ", ftos(particle_alpha), "\n"));
+       print(strcat("  alphafade: ", ftos(particle_alphafade), "\n"));
+       print(strcat("  time: ", ftos(particle_time), "\n"));
+       print(strcat("  gravity: ", ftos(particle_gravity), "\n"));
+       print(strcat("  bounce: ", ftos(particle_bounce), "\n"));
+       print(strcat("  airfriction: ", ftos(particle_airfriction), "\n"));
+       print(strcat("  liquidfriction: ", ftos(particle_liquidfriction), "\n"));
+       print(strcat("  originjitter: ", ftos(particle_originjitter), "\n"));
+       print(strcat("  velocityjitter: ", ftos(particle_velocityjitter), "\n"));
+       print(strcat("  qualityreduction: ", ftos(particle_qualityreduction), "\n"));
+       print(strcat("  stretch: ", ftos(particle_stretch), "\n"));
+       print(strcat("  staincolor1: ", vtos(particle_staincolor1), "\n"));
+       print(strcat("  staincolor2: ", vtos(particle_staincolor2), "\n"));
+       print(strcat("  staintex: ", ftos(particle_staintex), "\n"));
+       print(strcat("  stainalpha: ", ftos(particle_stainalpha), "\n"));
+       print(strcat("  stainsize: ", ftos(particle_stainsize), "\n"));
+       print(strcat("  delayspawn: ", ftos(particle_delayspawn), "\n"));
+       print(strcat("  delaycollision: ", ftos(particle_delaycollision), "\n"));
+       print(strcat("  angle: ", ftos(particle_angle), "\n"));
+       print(strcat("  spin: ", ftos(particle_spin), "\n"));
+}
+
+// DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET
+// idea: VorteX
+// darkplaces implementation: VorteX
+float RF_USETRANSPARENTOFFSET = 64; // enables transparent origin offsetting
+// global definitions
+float transparent_offset; // should be set before entity is added
+// description: offset a model's meshes origin used for transparent sorting. Could be used to tweak sorting bugs on very large transparent entities or hacking transparent sorting order for certain objects
+// example: transparent_offset = 1000000; // entity always appear on background of other transparents
+// note: offset is done in view forward axis
+
+// DP_CSQC_ENTITYWORLDOBJECT
+// idea: VorteX
+// darkplaces implementation: VorteX
+const float RF_WORLDOBJECT = 128;
+// description: when renderflag is set, engine will not use culling methods for this entity, e.g. it will always be drawn
+// useful for large outdoor objects (like asteroids on sky horizon or sky models)
+
+// DP_CSQC_ENTITYMODELLIGHT
+// idea: VorteX
+// darkplaces implementation: VorteX
+const float RF_MODELLIGHT = 4096;
+.vector modellight_ambient;
+.vector modellight_diffuse;
+.vector modellight_dir;
+// description: allows CSQC to override directional model lightning on entity
+
+// DP_CSQC_SETPAUSE
+// idea: VorteX
+// darkplaces implementation: VorteX
+// builtin definitions:
+void(float ispaused) setpause = #531;
+// description: provides ability to set pause in local games (similar to one set once console is activated)
+// not stopping sound/cd track, useful for inventory screens, ingame menus with input etc.
+
+// DP_CSQC_QUERYRENDERENTITY
+// idea: VorteX
+// darkplaces implementation: VorteX
+// constant definitions:
+// render entity fields:
+float E_ACTIVE             = 0; // float 0/1
+float E_ORIGIN      = 1; // vector
+float E_FORWARD     = 2; // vector
+float E_RIGHT       = 3; // vector
+float E_UP          = 4; // vector
+float E_SCALE       = 5; // float
+float E_ORIGINANDVECTORS = 6; // returns origin, + sets v_* vectors to orientation
+float E_ALPHA       = 7; // float
+float E_COLORMOD    = 8; // vector
+float E_PANTSCOLOR  = 9; // vector
+float E_SHIRTCOLOR  = 10; // vector
+float E_SKIN        = 11; // float
+float E_MINS        = 12; // vector
+float E_MAXS        = 13; // vector
+float E_ABSMIN      = 14; // vector
+float E_ABSMAX      = 15; // vector
+float E_LIGHT       = 16; // vector - modellight
+// builtin definitions:
+float(float entitynum, float fldnum) getentity = #504;
+vector(float entitynum, float fldnum) getentityvec = #504;
+// description: allows to query parms from render entities, especially useful with attaching CSQC ents to
+// server entities networked and interpolated by engine (monsters, players), number of entity is it's SVQC number
+// you can send it via tempentity/CSQC entity message. Note that this builtin doesnt know about entity removing/reallocating
+// so it's meaning to work for short period of time, dont use it on missiles/grenades whatever will be removed next five seconds
+
+//DP_GFX_FONTS
+//idea: Blub\0, divVerent
+//darkplaces implementation: Blub\0
+//console commands:
+//  loadfont fontname fontmaps size1 size2 ...
+//   A font can simply be gfx/tgafile (freetype fonts doent need extension),
+//   or alternatively you can specify multiple fonts and faces
+//   Like this: gfx/vera-sans:2,gfx/fallback:1
+//   to load face 2 of the font gfx/vera-sans and use face 1
+//   of gfx/fallback as fallback font
+//   You can also specify a list of font sizes to load, like this:
+//   loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32
+//   In many cases, 8 12 16 24 32 should be a good choice.
+//   for slots see:
+//constant definitions:
+float drawfont;            // set it before drawstring()/drawchar() calls
+float FONT_DEFAULT = 0;    // 'default'
+float FONT_CONSOLE = 1;    // 'console', REALLY should be fixed width (ls!)
+float FONT_SBAR = 2;       // 'sbar', used on hud, must be fixed width
+float FONT_NOTIFY = 3;     // 'notify', used on sprint/bprint
+float FONT_CHAT = 4;       // 'chat'
+float FONT_CENTERPRINT = 5;// 'centerprint'
+float FONT_INFOBAR = 6;    // 'infobar'
+float FONT_MENU = 7;       // 'menu', should be fixed width
+float FONT_USER0 = 8;      // 'user0', userdefined fonts
+float FONT_USER1 = 9;      // 'user1', userdefined fonts
+float FONT_USER2 = 10;     // 'user2', userdefined fonts
+float FONT_USER3 = 11;     // 'user3', userdefined fonts
+float FONT_USER4 = 12;     // 'user4', userdefined fonts
+float FONT_USER5 = 13;     // 'user5', userdefined fonts
+float FONT_USER6 = 14;     // 'user6', userdefined fonts
+float FONT_USER7 = 15;     // 'user7' slot, userdefined fonts
+//builtin definitions:
+float findfont(string s) = #356; // find font by fontname and return it's index
+float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
+// loads font immediately so stringwidth() function can be used just after builtin call
+// returns a font slotnum (which is used to set drawfont to)
+// first 3 parms are identical to "loadfont" console command ones
+// slot could be one of FONT_ constants or result of findfont() or -1 to not use it
+// if slot is given, font will be loaded to this slotnum and fontname become new title for it
+// this way you can rename user* fonts to something more usable
+// fix_* parms let you fix badly made fonts by applying some transformations to them
+// fix_scale : per-character center-oriented scale (doesn't change line height at all)
+// fix_voffset : vertical offset for each character, it's a multiplier to character height
+float stringwidth(string text, float allowColorCodes, vector size) = #327; // get a width of string with given font and char size
+float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // in menu.dat it has different builtin #
+//description: engine support for custom fonts in console, hud, qc etc.
+// limits:
+//  max 128 chars for font name
+//  max 3 font fallbacks
+//  max 8 sizes per font
+
+//DP_GFX_FONTS_FREETYPE
+//idea: Blub\0, divVerent
+//darkplaces implementation: Blub\0
+//cvar definitions:
+//   r_font_disable_freetype 0/1 : disable freetype fonts loading (uttetly disables freetype library initialization)
+//   r_font_antialias 0/1 : antialiasing when loading font
+//   r_font_hint 0/1/2/3  : hinting when loading font, 0 is no hinting, 1 light autohinting , 2 full autohinting, 3 full hinting
+//   r_font_postprocess_blur X      : font outline blur amount
+//   r_font_postprocess_outline X   : font outline width
+//   r_font_postprocess_shadow_x X  : font outline shadow x shift amount, applied during outlining
+//   r_font_postprocess_shadow_y X  : font outline shadow y shift amount, applied during outlining
+//   r_font_postprocess_shadow_z X  : font outline shadow z shift amount, applied during blurring
+//description: engine support for truetype/freetype fonts
+//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
+//(console command version will support them as well)
+
+//DP_CSQC_BINDMAPS
+//idea: daemon, motorsep
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(float key, float bindmap) getkeybind_bindmap = #342;
+float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
+vector(void) getbindmaps = #631;
+float(vector bm) setbindmaps = #632;
+string(string command, float bindmap) findkeysforcommand = #610;
+//<already in EXT_CSQC> float(string key) stringtokeynum = #341;
+//<already in EXT_CSQC> string(float keynum) keynumtostring = #340;
+//description: key bind setting/getting including support for switchable
+//bindmaps.
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions: (CSQC)
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
+//description:
+//use -1 as buffer handle to justs end delim as postdata
+
+//DP_CSQC_MAINVIEW
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+const float VF_MAINVIEW         = 400;
+//use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render
+//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
+//this flag is set for the first scene, and not cleared by R_ClearScene
+//this flag is automatically cleared by R_RenderView
+//so when not using this extension, the first view rendered is the main view
+
+//DP_CSQC_MINFPS_QUALITY
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+const float VF_MINFPS_QUALITY   = 401;
+//use getproperty(VF_MINFPS_QUALITY); to do CSQC based LOD based on cl_minfps
+//1 should lead to an unmodified view
+
+//DP_CSQC_V_CALCREFDEF_WIP1
+//DP_CSQC_V_CALCREFDEF_WIP2
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(entity e, float refdefflags) V_CalcRefdef = #640;
+//constant definitions:
+float PMF_DUCKED = 4;
+float PMF_ONGROUND = 8;
+float REFDEFFLAG_TELEPORTED = 1;
+float REFDEFFLAG_JUMPING = 2;
+float REFDEFFLAG_DEAD = 4;
+float REFDEFFLAG_INTERMISSION = 8;
+//- use this on the player entity after performing prediction
+//- pass REFDEFFLAG_TELEPORTED if the player teleported since last frame
+//- pass REFDEFFLAG_JUMPING if jump button is pressed
+//- pass REFDEFFLAG_DEAD if dead (DP_CSQC_V_CALCREFDEF_WIP2)
+//- pass REFDEFFLAG_INTERMISSION if in intermission (DP_CSQC_V_CALCREFDEF_WIP2)
+//- the player entity needs to have origin, velocity, pmove_flags set according
+//  to prediction (the above two PMF_ flags are used in the player's pmove_flags)
+//- NOTE: to check for this, ALSO OR a check with DP_CSQC_V_CALCREFDEF to also support
+//  the finished extension once done
+
+// assorted builtins
+float  drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
+vector drawgetimagesize(string pic) = #318;
+#define SPA_POSITION 0
+#define SPA_S_AXIS 1
+#define SPA_T_AXIS 2
+#define SPA_R_AXIS 3
+#define SPA_TEXCOORDS0 4
+#define SPA_LIGHTMAP0_TEXCOORDS 5
+#define SPA_LIGHTMAP_COLOR 6
+// float (entity e, float s)                                           getsurfacenumpoints = #434;
+// vector (entity e, float s, float n)                                 getsurfacepoint = #435;
+// vector (entity e, float s)                                          getsurfacenormal = #436;
+// string (entity e, float s)                                          getsurfacetexture = #437;
+// float (entity e, vector p)                                          getsurfacenearpoint = #438;
+// vector (entity e, float s, vector p)                                        getsurfaceclippedpoint = #439;
+// vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
+float(entity e, float s) getsurfacenumtriangles = #628;
+vector(entity e, float s, float n) getsurfacetriangle = #629;
+
+//DP_QC_ASINACOSATANATAN2TAN
+//idea: Urre
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
+float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
+float PI      = 3.1415926535897932384626433832795028841971693993751058209749445923;
+//builtin definitions:
+/* -Wdouble-declaration
+float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
+float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
+float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
+*/
+//description:
+//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
+//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
+
+//DP_QC_SPRINTF
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string format, ...) sprintf = #627;
+//description:
+//you know sprintf :P
+//supported stuff:
+//  %
+//  optional: <argpos>$ for the argument to format (the arg counter then is not increased)
+//  flags: #0- +
+//  optional: <width>, *, or *<argpos>$ for the field width (width is read before value and precision)
+//  optional: .<precision>, .*, or .*<argpos>$ for the precision (precision is read before value)
+//  length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int)
+//  conversions:
+//    d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int
+//    i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int
+//    ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int
+//    eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double
+//    s takes a string
+//    vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
+//    For conversions s and c, the flag # makes precision and width interpreted
+//      as byte count, by default it is interpreted as character count in UTF-8
+//      enabled engines. No other conversions can create wide characters, and #
+//      has another meaning in these.
+
+//DP_QC_GETTIME
+//idea: tZork
+//darkplaces implementation: tZork, divVerent
+//constant definitions:
+float GETTIME_FRAMESTART = 0; // time of start of frame
+float GETTIME_REALTIME = 1; // current time (may be OS specific)
+float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
+float GETTIME_UPTIME = 3; // time since start of the engine
+//builtin definitions:
+float(float tmr) gettime = #519;
+//description:
+//some timers to query...
+
+//DP_QC_GETTIME_CDTRACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float GETTIME_CDTRACK = 4;
+//description:
+//returns the playing time of the current cdtrack when passed to gettime()
+//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
+
+//DP_QC_TOKENIZEBYSEPARATOR
+//idea: Electro, SavageX, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+//description:
+//this function returns tokens separated by any of the supplied separator strings, example:
+//numnumbers = tokenizebyseparator("10.2.3.4", ".");
+//returns 4 and the tokens are "10" "2" "3" "4"
+//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
+
+//DP_QC_TOKENIZE_CONSOLE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
+//description:
+//this function returns tokens separated just like the console does
+//also, functions are provided to get the index of the first and last character of each token in the original string
+//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
+
+//DP_SND_SOUND7_WIP1
+//DP_SND_SOUND7_WIP2
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
+float SOUNDFLAG_RELIABLE = 1;
+//description:
+//plays a sound, with some more flags
+//extensions to sound():
+//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
+//  i.e. support multiple sounds at once, but cannot be stopped/restarted
+//- a value 0 in the speed parameter means no change; otherwise, it is a
+//  percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
+//  half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
+//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
+//  to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
+//  similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
+//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
+//  snd_channel1volume, etc. (so, a channel shares the cvar with its respective
+//  auto-channel); however, the mod MUST define snd_channel8volume and upwards
+//  in default.cfg if they are to be used, as the engine does not create them
+//  to not litter the cvar list
+//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
+//  flags as extra 7th and 8th argument
+//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
+//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
+//  the finished extension once done
+
+//DP_PRECACHE_PIC_FLAGS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
+float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
+float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
+//notes: these constants are given as optional second argument to precache_pic()
+
+//DP_QC_TRACE_MOVETYPE_WORLDONLY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_WORLDONLY = 3;
+//description:
+//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
+
+//DP_SND_GETSOUNDTIME
+//idea: VorteX
+//darkplaces implementation: VorteX
+//constant definitions:
+float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
+float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
+//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
+//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
+//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
+//examples of use:
+//  - QC-driven looped sounds
+//  - QC events when sound playing is finished
+//  - toggleable ambientsounds
+//  - subtitles
+
+//DP_QC_NUM_FOR_EDICT
+//idea: Blub\0
+//darkplaces implementation: Blub\0
+//Function to get the number of an entity - a clean way.
+float(entity num) num_for_edict = #512;
+
+//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//globals:
+.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
+float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
+float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
+float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
+string trace_dphittexturename; // texture name of impacted surface
+//constants:
+float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
+float DPCONTENTS_WATER = 2;
+float DPCONTENTS_SLIME = 4;
+float DPCONTENTS_LAVA = 8;
+float DPCONTENTS_SKY = 16;
+float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
+float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
+float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
+float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
+float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
+float DPCONTENTS_DONOTENTER = 1024; // AI hint brush
+float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
+float DPCONTENTS_BOTCLIP = 2048; // AI hint brush
+float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
+float Q3SURFACEFLAG_NODAMAGE = 1;
+float Q3SURFACEFLAG_SLICK = 2; // low friction surface
+float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
+float Q3SURFACEFLAG_LADDER = 8; // climbable surface
+float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
+float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
+float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
+float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
+float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
+float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
+//description:
+//adds additional information after a traceline/tracebox/tracetoss call.
+//also (very important) sets trace_* globals before calling .touch functions,
+//this allows them to inspect the nature of the collision (for example
+//determining if a projectile hit sky), clears trace_* variables for the other
+//object in a touch event (that is to say, a projectile moving will see the
+//trace results in its .touch function, but the player it hit will see very
+//little information in the trace_ variables as it was not moving at the time)
+
+//DP_QC_CVAR_TYPE
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
+
+//DP_QC_CRC16
+//idea: divVerent
+//darkplaces implementation: divVerent
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
+//DP_QC_URI_ESCAPE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//URI::Escape's functionality
+string(string in) uri_escape = #510;
+string(string in) uri_unescape = #511;
+
+//DP_QC_DIGEST
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string digest, string data, ...) digest_hex = #639;
+//description:
+//returns a given hex digest of given data
+//the returned digest is always encoded in hexadecimal
+//only the "MD4" digest is always supported!
+//if the given digest is not supported, string_null is returned
+//the digest string is matched case sensitively, use "MD4", not "md4"!
+
+//DP_QC_DIGEST_SHA256
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//description:
+//"SHA256" is also an allowed digest type
+
+//DP_QC_LOG
+//darkplaces implementation: divVerent
+//builtin definitions:
+float log(float f) = #532;
+//description:
+//logarithm
+
+//FTE_CSQC_SKELETONOBJECTS
+//idea: Spike, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+// all skeleton numbers are 1-based (0 being no skeleton)
+// all bone numbers are 1-based (0 being invalid)
+float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
+float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
+float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
+string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
+float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
+float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
+vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
+vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
+void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
+void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
+void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
+float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
+float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
+//fields:
+.float skeletonindex; // active skeleton overriding standard animation on model
+.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
+.float frame2; // secondary framegroup animation (strength = lerpfrac)
+.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
+.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
+.float lerpfrac; // strength of framegroup blend
+.float lerpfrac3; // strength of framegroup blend
+.float lerpfrac4; // strength of framegroup blend
+.float frame1time; // start time of framegroup animation
+.float frame2time; // start time of framegroup animation
+.float frame3time; // start time of framegroup animation
+.float frame4time; // start time of framegroup animation
+//description:
+//this extension provides a way to do complex skeletal animation on an entity.
+//
+//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
+//
+//notes:
+//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
+//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
+//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
+//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
+//
+//features include:
+//multiple animations blended together.
+//animating a model with animations from another model with a compatible skeleton.
+//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
+//custom bone controllers - for example making eyes track a target location.
+//
+//
+//
+//example code follows...
+//
+//this helper function lets you identify (by parentage) what group a bone
+//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
+//all children of the bone named "torso", unless they are children of
+//"leftarm" (which is a child of "torso") which would return 2 instead...
+float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
+{
+       local string bonename;
+       while (bonenum >= 0)
+       {
+               bonename = skel_get_bonename(skel, bonenum);
+               if (bonename == g1) return 1;
+               if (bonename == g2) return 2;
+               if (bonename == g3) return 3;
+               if (bonename == g4) return 4;
+               if (bonename == g5) return 5;
+               if (bonename == g6) return 6;
+               bonenum = skel_get_boneparent(skel, bonenum);
+       }
+       return 0;
+};
+// create a skeletonindex for our player using current modelindex
+void() example_skel_player_setup =
+{
+       self.skeletonindex = skel_create(self.modelindex);
+};
+// setup bones of skeleton based on an animation
+// note: animmodelindex can be a different model than self.modelindex
+void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
+{
+       // start with our standard animation
+       self.frame = framegroup;
+       self.frame2 = 0;
+       self.frame3 = 0;
+       self.frame4 = 0;
+       self.frame1time = framegroupstarttime;
+       self.frame2time = 0;
+       self.frame3time = 0;
+       self.frame4time = 0;
+       self.lerpfrac = 0;
+       self.lerpfrac3 = 0;
+       self.lerpfrac4 = 0;
+       skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
+};
+// apply a different framegroup animation to bones with a specified parent
+void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
+{
+       local float bonenum;
+       local float numbones;
+       self.frame = framegroup;
+       self.frame2 = 0;
+       self.frame3 = 0;
+       self.frame4 = 0;
+       self.frame1time = framegroupstarttime;
+       self.frame2time = 0;
+       self.frame3time = 0;
+       self.frame4time = 0;
+       self.lerpfrac = 0;
+       self.lerpfrac3 = 0;
+       self.lerpfrac4 = 0;
+       bonenum = 0;
+       numbones = skel_get_numbones(self.skeletonindex);
+       while (bonenum < numbones)
+       {
+               if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
+                       skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
+               bonenum = bonenum + 1;
+       }
+};
+// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
+void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
+{
+       local float bonenum;
+       local vector ang;
+       local vector oldforward, oldright, oldup;
+       local vector relforward, relright, relup, relorg;
+       local vector boneforward, boneright, boneup, boneorg;
+       local vector parentforward, parentright, parentup, parentorg;
+       local vector u, v;
+       local vector modeleyetarget;
+       bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
+       if (bonenum < 0)
+               return;
+       oldforward = v_forward;
+       oldright = v_right;
+       oldup = v_up;
+       v = eyetarget - self.origin;
+       modeleyetarget_x =   v * v_forward;
+       modeleyetarget_y = 0-v * v_right;
+       modeleyetarget_z =   v * v_up;
+       // this is an eyeball, make it point at the target location
+       // first get all the data we can...
+       relorg = skel_get_bonerel(self.skeletonindex, bonenum);
+       relforward = v_forward;
+       relright = v_right;
+       relup = v_up;
+       boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
+       boneforward = v_forward;
+       boneright = v_right;
+       boneup = v_up;
+       parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
+       parentforward = v_forward;
+       parentright = v_right;
+       parentup = v_up;
+       // get the vector from the eyeball to the target
+       u = modeleyetarget - boneorg;
+       // now transform it inversely by the parent matrix to produce new rel vectors
+       v_x = u * parentforward;
+       v_y = u * parentright;
+       v_z = u * parentup;
+       ang = vectoangles2(v, relup);
+       ang_x = 0 - ang_x;
+       makevectors(ang);
+       // set the relative bone matrix
+       skel_set_bone(self.skeletonindex, bonenum, relorg);
+       // restore caller's v_ vectors
+       v_forward = oldforward;
+       v_right = oldright;
+       v_up = oldup;
+};
+// delete skeleton when we're done with it
+// note: skeleton remains valid until next frame when it is really deleted
+void() example_skel_player_delete =
+{
+       skel_delete(self.skeletonindex);
+       self.skeletonindex = 0;
+};
+//
+// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
+//
+
+//DP_QC_ENTITYDATA
+//idea: KrimZon
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float() numentityfields = #496;
+string(float fieldnum) entityfieldname = #497;
+float(float fieldnum) entityfieldtype = #498;
+string(float fieldnum, entity ent) getentityfieldstring = #499;
+float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
+//constants:
+//Returned by entityfieldtype
+float FIELD_STRING   = 1;
+float FIELD_FLOAT    = 2;
+float FIELD_VECTOR   = 3;
+float FIELD_ENTITY   = 4;
+float FIELD_FUNCTION = 6;
+//description:
+//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
+//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
+//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
+//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
+//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
+//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
+
+//DP_QC_ENTITYSTRING
+void(string s) loadfromdata = #529;
+void(string s) loadfromfile = #530;
+void(string s) callfunction = #605;
+void(float fh, entity e) writetofile = #606;
+float(string s) isfunction = #607;
+void(entity e, string s) parseentitydata = #608;
+
+//DP_COVERAGE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//function definitions:
+void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
+
+// assorted builtins
+const float            STAT_MOVEVARS_TICRATE           = 240;
+const float            STAT_MOVEVARS_TIMESCALE         = 241;
+const float            STAT_FRAGLIMIT                                  = 235;
+const float            STAT_TIMELIMIT                                  = 236;
+const float     STAT_MOVEVARS_GRAVITY           = 242;
+string(void)                                           ReadPicture = #501;
+float PARTICLES_USEALPHA = 1;
+float particles_alphamin, particles_alphamax;
+float PARTICLES_USECOLOR = 2;
+vector particles_colormin, particles_colormax;
+float PARTICLES_USEFADE = 4;  // fades the COUNT (fade alpha using alphamin/alphamax)
+float particles_fade;
+float PARTICLES_DRAWASTRAIL = 128;
+void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags) boxparticles = #502;
+float trace_networkentity;
+const float RF_FULLBRIGHT      = 256;
+const float RF_NOSHADOW        = 512;
+float RF_DYNAMICMODELLIGHT = 8192;
+
+float gettaginfo_parent;
+string gettaginfo_name;
+vector gettaginfo_offset;
+vector gettaginfo_forward;
+vector gettaginfo_right;
+vector gettaginfo_up;
+float checkpvs(vector viewpos, entity viewee) = #240;
diff --git a/qcsrc/dpdefs/upstream/dpextensions.qc b/qcsrc/dpdefs/upstream/dpextensions.qc
new file mode 100644 (file)
index 0000000..07142e9
--- /dev/null
@@ -0,0 +1,2573 @@
+
+//DarkPlaces supported extension list, draft version 1.04
+
+//things that don't have extensions yet:
+.float disableclientprediction;
+
+//definitions that id Software left out:
+//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
+float MOVE_NORMAL = 0; // same as FALSE
+float MOVE_NOMONSTERS = 1; // same as TRUE
+float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+
+//checkextension function
+//idea: expected by almost everyone
+//darkplaces implementation: LordHavoc
+float(string s) checkextension = #99;
+//description:
+//check if (cvar("pr_checkextension")) before calling this, this is the only
+//guaranteed extension to be present in the extension system, it allows you
+//to check if an extension is available, by name, to check for an extension
+//use code like this:
+//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
+//if (cvar("pr_checkextension"))
+//if (checkextension("DP_SV_SETCOLOR"))
+//     ext_setcolor = TRUE;
+//from then on you can check ext_setcolor to know if that extension is available
+
+//BX_WAL_SUPPORT
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates the engine supports .wal textures for filenames in the textures/ directory
+//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
+
+//DP_BUTTONCHAT
+//idea: Vermeulen
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float buttonchat;
+//description:
+//true if the player is currently chatting (in messagemode, menus or console)
+
+//DP_BUTTONUSE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float buttonuse;
+//client console commands:
+//+use
+//-use
+//description:
+//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
+
+//DP_CL_LOADSKY
+//idea: Nehahra, LordHavoc
+//darkplaces implementation: LordHavoc
+//client console commands:
+//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
+//description:
+//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
+
+//DP_CON_SET
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_SETA
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_ALIASPARAMETERS
+//idea: many
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
+
+//DP_CON_EXPANDCVAR
+//idea: many, PHP
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
+
+//DP_CON_STARTMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
+
+//DP_EF_ADDITIVE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_ADDITIVE     = 32;
+//description:
+//additive blending when this object is rendered
+
+//DP_EF_BLUE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_BLUE         = 64;
+//description:
+//entity emits blue light (used for quad)
+
+//DP_EF_DOUBLESIDED
+//idea: LordHavoc
+//darkplaces implementation: [515] and LordHavoc
+//effects bit:
+float EF_DOUBLESIDED = 32768;
+//description:
+//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
+
+//DP_EF_DYNAMICMODELLIGHT
+//idea: C.Brutail, divVerent, maikmerten
+//darkplaces implementation: divVerent
+//effects bit:
+float   EF_DYNAMICMODELLIGHT     = 131072;
+//description:
+//force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors)
+
+//DP_EF_FLAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_FLAME        = 1024;
+//description:
+//entity is on fire
+
+//DP_EF_FULLBRIGHT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_FULLBRIGHT   = 512;
+//description:
+//entity is always brightly lit
+
+//DP_EF_NODEPTHTEST
+//idea: Supa
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NODEPTHTEST       = 8192;
+//description:
+//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
+
+//DP_EF_NODRAW
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NODRAW       = 16;
+//description:
+//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
+
+//DP_EF_NOGUNBOB
+//idea: Chris Page, Dresk
+//darkplaces implementation: LordHAvoc
+//effects bit:
+float   EF_NOGUNBOB     = 256;
+//description:
+//this has different meanings depending on the entity it is used on:
+//player entity - prevents gun bobbing on player.viewmodel
+//viewmodelforclient entity - prevents gun bobbing on an entity attached to the player's view
+//other entities - no effect
+//uses:
+//disabling gun bobbing on a diving mask or other model used as a .viewmodel.
+//disabling gun bobbing on view-relative models meant to be part of the heads up display.  (note: if fov is changed these entities may be off-screen, or too near the center of the screen, so use fov 90 in this case)
+
+//DP_EF_NOSHADOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NOSHADOW     = 4096;
+//description:
+//realtime lights will not cast shadows from this entity (but can still illuminate it)
+
+//DP_EF_RED
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_RED          = 128;
+//description:
+//entity emits red light (used for invulnerability)
+
+//DP_EF_RESTARTANIM_BIT
+//idea: id software
+//darkplaces implementation: divVerent
+//effects bit:
+float   EF_RESTARTANIM_BIT = 1048576;
+//description:
+//when toggled, the current animation is restarted. Useful for weapon animation.
+//to toggle this bit in QC, you can do:
+//  self.effects += (EF_RESTARTANIM_BIT - 2 * (self.effects & EF_RESTARTANIM_BIT));
+
+//DP_EF_STARDUST
+//idea: MythWorks Inc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_STARDUST     = 2048;
+//description:
+//entity emits bouncing sparkles in every direction
+
+//DP_EF_TELEPORT_BIT
+//idea: id software
+//darkplaces implementation: divVerent
+//effects bit:
+float   EF_TELEPORT_BIT = 2097152;
+//description:
+//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting.
+//to toggle this bit in QC, you can do:
+//  self.effects += (EF_TELEPORT_BIT - 2 * (self.effects & EF_TELEPORT_BIT));
+
+//DP_ENT_ALPHA
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//fields:
+.float alpha;
+//description:
+//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
+
+//DP_ENT_COLORMOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definition:
+.vector colormod;
+//description:
+//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal).
+
+//DP_ENT_CUSTOMCOLORMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number.
+
+/*
+//NOTE: no longer supported by darkplaces because all entities are delta compressed now
+//DP_ENT_DELTACOMPRESS // no longer supported
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_DELTA = 8388608;
+//description:
+//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc).
+*/
+
+//DP_ENT_EXTERIORMODELTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//fields:
+.entity exteriormodeltoclient;
+//description:
+//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown.  Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
+
+//DP_ENT_GLOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float glow_color;
+.float glow_size;
+.float glow_trail;
+//description:
+//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
+
+//DP_ENT_GLOWMOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definition:
+.vector glowmod;
+//description:
+//controls color of the entity's glow texture (fullbrights), '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, see colormod (same color restrictions apply).
+
+//DP_ENT_LOWPRECISION
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_LOWPRECISION = 4194304;
+//description:
+//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
+
+//DP_ENT_SCALE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float scale;
+//description:
+//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller.
+
+//DP_ENT_TRAILEFFECTNUM
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float traileffectnum;
+//description:
+//use a custom effectinfo.txt effect on this entity, assign it like this:
+//self.traileffectnum = particleeffectnum("mycustomeffect");
+//this will do both the dlight and particle trail as described in the effect, basically equivalent to trailparticles() in CSQC but performed on a server entity.
+
+//DP_ENT_VIEWMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity viewmodelforclient;
+//description:
+//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)...  the entity is not visible to any other client.
+
+//DP_GFX_EXTERNALTEXTURES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//loads external textures found in various directories (tenebrae compatible)...
+/*
+in all examples .tga is merely the base texture, it can be any of these:
+.tga (base texture)
+_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha)
+_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend)
+_shirt.tga (same idea as pants, but for shirt color)
+_diffuse.tga (this may be used instead of base texture for per pixel lighting)
+_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale))
+_norm.tga (normalmap texture for per pixel lighting)
+_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility)
+_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility)
+
+due to glquake's incomplete Targa(r) loader, this section describes
+required Targa(r) features support:
+types:
+type 1 (uncompressed 8bit paletted with 24bit/32bit palette)
+type 2 (uncompressed 24bit/32bit true color, glquake supported this)
+type 3 (uncompressed 8bit greyscale)
+type 9 (RLE compressed 8bit paletted with 24bit/32bit palette)
+type 10 (RLE compressed 24bit/32bit true color, glquake supported this)
+type 11 (RLE compressed 8bit greyscale)
+attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
+
+image formats guaranteed to be supported: tga, pcx, lmp
+image formats that are optional: png, jpg
+
+mdl/spr/spr32 examples:
+skins are named _A (A being a number) and skingroups are named like _A_B
+these act as suffixes on the model name...
+example names for skin _2_1 of model "progs/armor.mdl":
+game/override/progs/armor.mdl_2_1.tga
+game/textures/progs/armor.mdl_2_1.tga
+game/progs/armor.mdl_2_1.tga
+example names for skin _0 of the model "progs/armor.mdl":
+game/override/progs/armor.mdl_0.tga
+game/textures/progs/armor.mdl_0.tga
+game/progs/armor.mdl_0.tga
+note that there can be more skins files (of the _0 naming) than the mdl
+contains, this is only useful to save space in the .mdl file if classic quake
+compatibility is not a concern.
+
+bsp/md2/md3 examples:
+example names for the texture "quake" of model "maps/start.bsp":
+game/override/quake.tga
+game/textures/quake.tga
+game/quake.tga
+
+sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
+game/override/gfx/conchars.tga
+game/textures/gfx/conchars.tga
+game/gfx/conchars.tga
+*/
+
+//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES
+//idea: Fuh?
+//darkplaces implementation: LordHavoc
+//description:
+//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/.
+//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed)
+//example:
+//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/
+//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/
+//as a more extreme example:
+//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/
+
+//DP_GFX_FOG
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
+//description:
+//global fog for the map, can not be changed by QC
+
+//DP_GFX_QUAKE3MODELTAGS
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity tag_entity; // entity this is attached to (call setattachment to set this)
+.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
+//builtin definitions:
+void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
+//description:
+//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
+//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
+//note 3: attaching to world turns off attachment
+//note 4: the entity that this is attached to must be visible for this to work
+//note 5: if an entity is attached to the player entity it will not be drawn in first person.
+
+//DP_GFX_SKINFILES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as:
+//progs/test.md3_0.skin
+//progs/test.md3_1.skin
+//...
+//
+//these files contain replace commands (replace meshname shadername), example:
+//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement
+//replace "teamstripes" "progs/test/redstripes.tga"
+//replace "visor" "common/nodraw" // this makes the visor mesh invisible
+////it is not possible to rename tags using this format
+//
+//Or the Quake3 syntax (100% compatible with Quake3's .skin files):
+//helmet,progs/test/helmet1.tga // this is a mesh shader replacement
+//teamstripes,progs/test/redstripes.tga
+//visor,common/nodraw // this makes the visor mesh invisible
+//tag_camera, // this defines that the first tag in the model is called tag_camera
+//tag_test, // this defines that the second tag in the model is called tag_test
+//
+//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible.
+//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
+//other commands might be added someday but it is not expected.
+
+//DP_GFX_SKYBOX
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
+//description:
+//global skybox for the map, can not be changed by QC
+
+//DP_UTF8
+//idea: Blub\0, divVerent
+//darkplaces implementation: Blub\0
+//cvar definitions:
+//   utf8_enable: enable utf8 encoding
+//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., 
+//and count as 1 char for string functions like strlen, substring, etc.
+// note: utf8_enable is run-time cvar, could be changed during execution
+// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
+
+//DP_HALFLIFE_MAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30).
+
+//DP_HALFLIFE_MAP_CVAR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//cvars:
+//halflifebsp 0/1
+//description:
+//engine sets this cvar when loading a map to indicate if it is halflife format or not.
+
+//DP_HALFLIFE_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife sprites.
+
+//DP_INPUTBUTTONS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float button3;
+.float button4;
+.float button5;
+.float button6;
+.float button7;
+.float button8;
+.float button9;
+.float button10;
+.float button11;
+.float button12;
+.float button13;
+.float button14;
+.float button15;
+.float button16;
+//description:
+//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
+//the exact mapping of protocol button bits on the server is:
+//self.button0 = (bits & 1) != 0;
+///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */
+//self.button2 = (bits & 2) != 0;
+//self.button3 = (bits & 4) != 0;
+//self.button4 = (bits & 8) != 0;
+//self.button5 = (bits & 16) != 0;
+//self.button6 = (bits & 32) != 0;
+//self.button7 = (bits & 64) != 0;
+//self.button8 = (bits & 128) != 0;
+
+// DP_LIGHTSTYLE_STATICVALUE
+// idea: VorteX
+// darkplaces implementation: VorteX
+// description: allows alternative 'static' lightstyle syntax : "=value"
+// examples: "=0.5", "=2.0", "=2.75"
+// could be used to control switchable lights or making styled lights with brightness > 2
+// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact 
+// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
+
+//DP_LITSPRITES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
+
+//DP_LITSUPPORT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
+//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course...  see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
+
+//DP_MONSTERWALK
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player.
+
+//DP_MOVETYPEBOUNCEMISSILE
+//idea: id Software
+//darkplaces implementation: id Software
+//movetype definitions:
+//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
+//description:
+//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
+
+//DP_MOVETYPEFLYWORLDONLY
+//idea: Samual
+//darkplaces implementation: Samual
+//movetype definitions:
+float MOVETYPE_FLY_WORLDONLY = 33;
+//description:
+//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
+
+//DP_NULL_MODEL
+//idea: Chris
+//darkplaces implementation: divVerent
+//definitions:
+//string dp_null_model = "null";
+//description:
+//setmodel(e, "null"); makes an entity invisible, have a zero bbox, but
+//networked. useful for shared CSQC entities.
+
+//DP_MOVETYPEFOLLOW
+//idea: id Software, LordHavoc (redesigned)
+//darkplaces implementation: LordHavoc
+//movetype definitions:
+float MOVETYPE_FOLLOW = 12;
+//description:
+//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:
+//aiment - the entity this is attached to.
+//punchangle - the original angles when the follow began.
+//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
+//v_angle - the relative angles.
+//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:
+//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
+//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid
+//hole.aiment = bmodel; // make the hole follow bmodel
+//hole.punchangle = bmodel.angles; // the original angles of bmodel
+//hole.view_ofs = hole.origin - bmodel.origin; // relative origin
+//hole.v_angle = hole.angles - bmodel.angles; // relative angles
+
+//DP_QC_ASINACOSATANATAN2TAN
+//idea: Urre
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
+float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
+float PI      = 3.1415926535897932384626433832795028841971693993751058209749445923;
+//builtin definitions:
+float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
+float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
+float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
+//description:
+//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
+//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
+
+//DP_QC_AUTOCVARS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//description:
+//allows QC variables to be bound to cvars
+//(works for float, string, vector types)
+//example:
+// float autocvar_developer;
+// float autocvar_registered;
+// string autocvar__cl_name;
+//NOTE: copying a string-typed autocvar to another variable/field, and then
+//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar
+//globals is UNDEFINED. Accessing autocvar globals after changing that cvar in
+//the same frame by any means other than cvar_set() from the same QC VM is
+//IMPLEMENTATION DEFINED (an implementation may either yield the previous, or
+//the current, value). Changing them via cvar_set() in the same QC VM
+//immediately must reflect on the autocvar globals. Whether autocvar globals,
+//after restoring a savegame, have the cvar's current value, or the original
+//value at time of saving, is UNDEFINED. Restoring a savegame however must not
+//restore the cvar values themselves.
+//In case the cvar does NOT exist, then it is automatically created with the
+//value of the autocvar initializer, if given. This is possible with e.g.
+//frikqcc and fteqcc the following way:
+// var float autocvar_whatever = 42;
+//If no initializer is given, the cvar will be initialized to a string
+//equivalent to the NULL value of the given data type, that is, the empty
+//string, 0, or '0 0 0'. However, when automatic cvar creation took place, a
+//warning is printed to the game console.
+//NOTE: to prevent an ambiguity with float names for vector types, autocvar
+//names MUST NOT end with _x, _y or _z!
+
+//DP_QC_CHANGEPITCH
+//idea: id Software
+//darkplaces implementation: id Software
+//field definitions:
+.float idealpitch;
+.float pitch_speed;
+//builtin definitions:
+void(entity ent) changepitch = #63;
+//description:
+//equivalent to changeyaw, ent is normally self. (this was a Q2 builtin)
+
+//DP_QC_COPYENTITY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity from, entity to) copyentity = #400;
+//description:
+//copies all data in the entity to another entity.
+
+//DP_QC_CRC16
+//idea: divVerent
+//darkplaces implementation: divVerent
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
+//DP_QC_CVAR_DEFSTRING
+//idea: id Software (Doom3), LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+string(string s) cvar_defstring = #482;
+//description:
+//returns the default value of a cvar, as a tempstring.
+
+//DP_QC_CVAR_DESCRIPTION
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string name) cvar_description = #518;
+//description:
+//returns the description of a cvar
+
+//DP_QC_CVAR_STRING
+//idea: VorteX
+//DarkPlaces implementation: VorteX, LordHavoc
+//builtin definitions:
+string(string s) cvar_string = #448;
+//description:
+//returns the value of a cvar, as a tempstring.
+
+//DP_QC_CVAR_TYPE
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
+
+//DP_QC_DIGEST
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string digest, string data, ...) digest_hex = #639;
+//description:
+//returns a given hex digest of given data
+//the returned digest is always encoded in hexadecimal
+//only the "MD4" digest is always supported!
+//if the given digest is not supported, string_null is returned
+//the digest string is matched case sensitively, use "MD4", not "md4"!
+
+//DP_QC_DIGEST_SHA256
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//description:
+//"SHA256" is also an allowed digest type
+
+//DP_QC_EDICT_NUM
+//idea: 515
+//DarkPlaces implementation: LordHavoc
+//builtin definitions:
+entity(float entnum) edict_num = #459;
+float(entity ent) wasfreed = #353; // same as in EXT_CSQC extension
+//description:
+//edict_num returns the entity corresponding to a given number, this works even for freed entities, but you should call wasfreed(ent) to see if is currently active.
+//wasfreed returns whether an entity slot is currently free (entities that have never spawned are free, entities that have had remove called on them are also free).
+
+//DP_QC_ENTITYDATA
+//idea: KrimZon
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float() numentityfields = #496;
+string(float fieldnum) entityfieldname = #497;
+float(float fieldnum) entityfieldtype = #498;
+string(float fieldnum, entity ent) getentityfieldstring = #499;
+float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
+//constants:
+//Returned by entityfieldtype
+float FIELD_STRING   = 1;
+float FIELD_FLOAT    = 2;
+float FIELD_VECTOR   = 3;
+float FIELD_ENTITY   = 4;
+float FIELD_FUNCTION = 6;
+//description:
+//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
+//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
+//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
+//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
+//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
+//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
+
+//DP_QC_ENTITYSTRING
+void(string s) loadfromdata = #529;
+void(string s) loadfromfile = #530;
+void(string s) callfunction = #605;
+void(float fh, entity e) writetofile = #606;
+float(string s) isfunction = #607;
+void(entity e, string s) parseentitydata = #608;
+
+//DP_QC_ETOS
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+string(entity ent) etos = #65;
+//description:
+//prints "entity 1" or similar into a string. (this was a Q2 builtin)
+
+//DP_QC_EXTRESPONSEPACKET
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(void) getextresponse = #624;
+//description:
+//returns a string of the form "\"ipaddress:port\" data...", or the NULL string
+//if no packet was found. Packets can be queued into the client/server by
+//sending a packet starting with "\xFF\xFF\xFF\xFFextResponse " to the
+//listening port.
+
+//DP_QC_FINDCHAIN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.string fld, string match) findchain = #402;
+//description:
+//similar to find() but returns a chain of entities like findradius.
+
+//DP_QC_FINDCHAIN_TOFIELD
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+entity(.string fld, float match, .entity tofield) findradius_tofield = #22;
+entity(.string fld, string match, .entity tofield) findchain_tofield = #402;
+entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450;
+entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403;
+//description:
+//similar to findchain() etc, but stores the chain into .tofield instead of .chain
+//actually, the .entity tofield is an optional field of the the existing findchain* functions
+
+//DP_QC_FINDCHAINFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.float fld, float match) findchainflags = #450;
+//description:
+//similar to findflags() but returns a chain of entities like findradius.
+
+//DP_QC_FINDCHAINFLOAT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.entity fld, entity match) findchainentity = #403;
+entity(.float fld, float match) findchainfloat = #403;
+//description:
+//similar to findentity()/findfloat() but returns a chain of entities like findradius.
+
+//DP_QC_FINDFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .float fld, float match) findflags = #449;
+//description:
+//finds an entity with the specified flag set in the field, similar to find()
+
+//DP_QC_FINDFLOAT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .entity fld, entity match) findentity = #98;
+entity(entity start, .float fld, float match) findfloat = #98;
+//description:
+//finds an entity or float field value, similar to find(), but for entity and float fields.
+
+//DP_QC_FS_SEARCH
+//idea: Black
+//darkplaces implementation: Black
+//builtin definitions:
+float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void(float handle) search_end = #445;
+float(float handle) search_getsize = #446;
+string(float handle, float num) search_getfilename = #447;
+//description:
+//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
+//search_end frees a search slot (also done at progs reload).
+//search_getsize returns how many filenames were found.
+//search_getfilename returns a filename from the search.
+
+//DP_QC_GETLIGHT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector(vector org) getlight = #92;
+//description:
+//returns the lighting at the requested location (in color), 0-255 range (can exceed 255).
+
+//DP_QC_GETSURFACE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(entity e, float s) getsurfacenumpoints = #434;
+vector(entity e, float s, float n) getsurfacepoint = #435;
+vector(entity e, float s) getsurfacenormal = #436;
+string(entity e, float s) getsurfacetexture = #437;
+float(entity e, vector p) getsurfacenearpoint = #438;
+vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
+//description:
+//functions to query surface information.
+
+//DP_QC_GETSURFACEPOINTATTRIBUTE
+//idea: BlackHC
+//darkplaces implementation: BlackHC
+// constants
+float SPA_POSITION = 0;
+float SPA_S_AXIS = 1;
+float SPA_T_AXIS = 2;
+float SPA_R_AXIS = 3; // same as SPA_NORMAL
+float SPA_TEXCOORDS0 = 4;
+float SPA_LIGHTMAP0_TEXCOORDS = 5;
+float SPA_LIGHTMAP0_COLOR = 6;
+//builtin definitions:
+vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
+
+//description:
+//function to query extended information about a point on a certain surface
+
+//DP_QC_GETSURFACETRIANGLE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+float(entity e, float s) getsurfacenumtriangles = #628;
+vector(entity e, float s, float n) getsurfacetriangle = #629;
+//description:
+//function to query triangles of a surface
+
+//DP_QC_GETTAGINFO
+//idea: VorteX, LordHavoc
+//DarkPlaces implementation: VorteX
+//builtin definitions:
+float(entity ent, string tagname) gettagindex = #451;
+vector(entity ent, float tagindex) gettaginfo = #452;
+//description:
+//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
+//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
+
+//DP_QC_GETTAGINFO_BONEPROPERTIES
+//idea: daemon
+//DarkPlaces implementation: divVerent
+//global definitions:
+float gettaginfo_parent;
+string gettaginfo_name;
+vector gettaginfo_offset;
+vector gettaginfo_forward;
+vector gettaginfo_right;
+vector gettaginfo_up;
+//description:
+//when this extension is present, gettaginfo fills in some globals with info about the bone that had been queried
+//gettaginfo_parent is set to the number of the parent bone, or 0 if it is a root bone
+//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo
+//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component.
+
+//DP_QC_GETTIME
+//idea: tZork
+//darkplaces implementation: tZork, divVerent
+//constant definitions:
+float GETTIME_FRAMESTART = 0; // time of start of frame relative to an arbitrary point in time
+float GETTIME_REALTIME = 1; // current absolute time (OS specific)
+float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
+float GETTIME_UPTIME = 3; // time of start of frame since start of the engine
+//builtin definitions:
+float(float tmr) gettime = #519;
+//description:
+//some timers to query...
+
+//DP_QC_GETTIME_CDTRACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float GETTIME_CDTRACK = 4;
+//description:
+//returns the playing time of the current cdtrack when passed to gettime()
+//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
+
+//DP_QC_I18N
+//idea: divVerent
+//darkplaces implementation: divVerent
+//description:
+//
+//The engine supports translating by gettext compatible .po files.
+//progs.dat uses progs.dat.<LANGUAGE>.po
+//menu.dat uses menu.dat.<LANGUAGE>.po
+//csprogs.dat uses csprogs.dat.<LANGUAGE>.po
+//
+//To create a string that can be translated, define it as
+//  string dotranslate_FILENOTFOUND = "File not found";
+//Note: if the compiler does constant folding, this will only work if there is
+//no other "File not found" string in the progs!
+//
+//Alternatively, if using the Xonotic patched fteqcc compiler, you can simplify
+//this by using _("File not found") directly in the source code.
+//
+//The language is set by the "prvm_language" cvar: if prvm_language is set to
+//"de", it will read progs.dat.de.po for translating strings in progs.dat.
+//
+//If prvm_language is set to the special name "dump", progs.dat.pot will be
+//written, which is a translation template to be edited by filling out the
+//msgstr entries.
+
+//DP_QC_LOG
+//darkplaces implementation: divVerent
+//builtin definitions:
+float log(float f) = #532;
+//description:
+//logarithm
+
+//DP_QC_MINMAXBOUND
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(float a, float b, ...) min = #94;
+float(float a, float b, float c) min3 = #94;
+float(float a, float b, float c, float d) min4 = #94;
+float(float a, float b, float c, float d, float e) min5 = #94;
+float(float a, float b, float c, float d, float e, float f) min6 = #94;
+float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
+float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
+float(float a, float b, ...) max = #95;
+float(float a, float b, float c) max3 = #95;
+float(float a, float b, float c, float d) max4 = #95;
+float(float a, float b, float c, float d, float e) max5 = #95;
+float(float a, float b, float c, float d, float e, float f) max6 = #95;
+float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
+float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
+float(float minimum, float val, float maximum) bound = #96;
+//description:
+//min returns the lowest of all the supplied numbers.
+//max returns the highest of all the supplied numbers.
+//bound clamps the value to the range and returns it.
+
+//DP_QC_MULTIPLETEMPSTRINGS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//this extension makes all builtins returning tempstrings (ftos for example)
+//cycle through a pool of multiple tempstrings (at least 16), allowing
+//multiple ftos results to be gathered before putting them to use, normal
+//quake only had 1 tempstring, causing many headaches.
+//
+//Note that for longer term storage (or compatibility on engines having
+//FRIK_FILE but not this extension) the FRIK_FILE extension's
+//strzone/strunzone builtins provide similar functionality (slower though).
+//
+//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS
+
+//DP_QC_NUM_FOR_EDICT
+//idea: Blub\0
+//darkplaces implementation: Blub\0
+//Function to get the number of an entity - a clean way.
+float(entity num) num_for_edict = #512;
+
+//DP_QC_RANDOMVEC
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector() randomvec = #91;
+//description:
+//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
+
+//DP_QC_SINCOSSQRTPOW
+//idea: id Software, LordHavoc
+//darkplaces implementation: id Software, LordHavoc
+//builtin definitions:
+float(float val) sin = #60;
+float(float val) cos = #61;
+float(float val) sqrt = #62;
+float(float a, float b) pow = #97;
+//description:
+//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
+
+//DP_QC_SPRINTF
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string format, ...) sprintf = #627;
+//description:
+//you know sprintf :P
+//supported stuff:
+//  %
+//  optional: <argpos>$ for the argument to format (the arg counter then is not increased)
+//  flags: #0- +
+//  optional: <width>, *, or *<argpos>$ for the field width (width is read before value and precision)
+//  optional: .<precision>, .*, or .*<argpos>$ for the precision (precision is read before value)
+//  length modifiers: h for forcing a float, l for forcing an entity (by default, %d etc. cast a float to int), ll for forcing an int
+//  conversions:
+//    d takes a float if no length is specified or h is, and an entity if l is specified as length, and an int if ll is specified as length, and cast it to an int
+//    i takes an entity if no length is specified or l is, and a float if h is specified as length, and an int if ll is specified as length, and cast it to an int
+//    ouxXc take a float if no length is specified or h is, and an entity if l is specified as length, and an int if ll is specified as length, and cast it to an unsigned int
+//    eEfFgG take a float if no length is specified or h is, and an entity if l is specified as length, and an int if ll is specified as length, and cast it to a double
+//    s takes a string
+//    vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
+//    For conversions s and c, the flag # makes precision and width interpreted
+//      as byte count, by default it is interpreted as character count in UTF-8
+//      enabled engines. No other conversions can create wide characters, and #
+//      has another meaning in these. When in character count mode, color codes
+//      are ignored. To get UTF-8 semantics WITHOUT color code parsing, use
+//      the + flag.
+
+//DP_QC_STRFTIME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+string(float uselocaltime, string format, ...) strftime = #478;
+//description:
+//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice:
+//example: "%Y-%m-%d %H:%M:%S"   (result looks like: 2007-02-08 01:03:15)
+//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time)
+//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function.
+//
+//practical uses:
+//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(TRUE, "%H");hour = stof(s);
+//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time.
+//activating eastereggs in singleplayer games on certain dates.
+//
+//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries.
+//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)".
+//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!).
+//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing.
+
+//DP_QC_STRINGCOLORFUNCTIONS
+//idea: Dresk
+//darkplaces implementation: Dresk
+//builtin definitions:
+float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes
+string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided
+//description:
+//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes
+
+//DP_QC_STRING_CASE_FUNCTIONS
+//idea: Dresk
+//darkplaces implementation: LordHavoc / Dresk
+//builtin definitions:
+string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
+string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
+//description:
+//provides simple string uppercase and lowercase functions
+
+//DP_QC_TOKENIZEBYSEPARATOR
+//idea: Electro, SavageX, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+//description:
+//this function returns tokens separated by any of the supplied separator strings, example:
+//numnumbers = tokenizebyseparator("10.2.3.4", ".");
+//returns 4 and the tokens are "10" "2" "3" "4"
+//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
+
+//DP_QC_TOKENIZE_CONSOLE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
+//description:
+//this function returns tokens separated just like the console does
+//also, functions are provided to get the index of the first and last character of each token in the original string
+//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
+
+//DP_QC_TRACEBOX
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+//description:
+//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
+
+//DP_QC_TRACETOSS
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+void(entity ent, entity ignore) tracetoss = #64;
+//description:
+//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
+
+//DP_QC_TRACE_MOVETYPE_HITMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_HITMODEL = 4;
+//description:
+//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
+
+//DP_QC_TRACE_MOVETYPE_WORLDONLY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_WORLDONLY = 3;
+//description:
+//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
+
+//DP_QC_UNLIMITEDTEMPSTRINGS
+//idea: divVerent
+//darkplaces implementation: LordHavoc
+//description:
+//this extension alters Quake behavior such that instead of reusing a single
+//tempstring (or multiple) there are an unlimited number of tempstrings, which
+//are removed only when a QC function invoked by the engine returns,
+//eliminating almost all imaginable concerns with string handling in QuakeC.
+//
+//in short:
+//you can now use and abuse tempstrings as much as you like, you still have to
+//use strzone (FRIK_FILE) for permanent storage however.
+//
+//
+//
+//implementation notes for other engine coders:
+//these tempstrings are expected to be stored in a contiguous buffer in memory
+//which may be fixed size or controlled by a cvar, or automatically grown on
+//demand (in the case of DarkPlaces).
+//
+//this concept is similar to quake's Zone system, however these are all freed
+//when the QC interpreter returns.
+//
+//this is basically a poor man's garbage collection system for strings.
+
+//DP_QC_VECTOANGLES_WITH_ROLL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector(vector forward, vector up) vectoangles2 = #51; // same number as vectoangles
+//description:
+//variant of vectoangles that takes an up vector to calculate roll angle (also uses this to calculate yaw correctly if the forward is straight up or straight down)
+//note: just like normal vectoangles you need to negate the pitch of the returned angles if you want to feed them to makevectors or assign to self.v_angle
+
+//DP_QC_VECTORVECTORS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector dir) vectorvectors = #432;
+//description:
+//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles.
+
+//DP_QC_WHICHPACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string filename) whichpack = #503;
+//description:
+//for files in a pak/pk3/whatever, returns the pack's file name in FRIK_FILE name space.
+//for physical files, returns "".
+//in case of error, returns string_null.
+
+//DP_QC_URI_ESCAPE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//URI::Escape's functionality
+string(string in) uri_escape = #510;
+string(string in) uri_unescape = #511;
+
+//DP_QC_URI_GET
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string
+//returns 1 on success of initiation, 0 if there are too many concurrent
+//connections already or if the URL is invalid
+//the following callback will receive the data and MUST exist!
+//  void(float id, float status, string data) URI_Get_Callback;
+//status is either
+//  negative for an internal error,
+//  0 for success, or
+//  the HTTP response code on server error (e.g. 404)
+//if 1 is returned by uri_get, the callback will be called in the future
+float(string url, float id) uri_get = #513;
+
+//DP_QC_URI_POST
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string after POSTing via HTTP
+//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
+//and uri_post sends the string buffer buf, joined using the delimiter delim
+float(string url, float id, string content_type, string data) uri_post = #513;
+float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
+
+//DP_SKELETONOBJECTS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//this extension indicates that FTE_CSQC_SKELETONOBJECTS functionality is available in server QC (as well as CSQC).
+
+//DP_SV_SPAWNFUNC_PREFIX
+//idea: divVerent
+//darkplaces implementation: divVerent
+//Make functions whose name start with spawnfunc_ take precedence as spawn function for loading entities.
+//Useful if you have a field ammo_shells (required in any Quake mod) but want to support spawn functions called ammo_shells (like in Q3A).
+//Optionally, you can declare a global "float require_spawnfunc_prefix;" which will require ANY spawn function to start with that prefix.
+
+
+//DP_QUAKE2_MODEL
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake2 .md2 files.
+
+//DP_QUAKE2_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: Elric
+//description:
+//shows that the engine supports Quake2 .sp2 files.
+
+//DP_QUAKE3_MAP
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .bsp files.
+
+//DP_QUAKE3_MODEL
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .md3 files.
+
+//DP_REGISTERCVAR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string name, string value) registercvar = #93;
+//description:
+//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
+//NOTE: DP_CON_SET is much better.
+
+//DP_SND_DIRECTIONLESSATTNNONE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
+
+//DP_SND_FAKETRACKS
+//idea: requested
+
+//darkplaces implementation: Elric
+//description:
+//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
+//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
+
+//DP_SND_SOUND7_WIP1
+//DP_SND_SOUND7_WIP2
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
+float SOUNDFLAG_RELIABLE = 1;
+//description:
+//plays a sound, with some more flags
+//extensions to sound():
+//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
+//  i.e. support multiple sounds at once, but cannot be stopped/restarted
+//- a value 0 in the speed parameter means no change; otherwise, it is a
+//  percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
+//  half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
+//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
+//  to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
+//  similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
+//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
+//  snd_channel1volume, etc. (so, a channel shares the cvar with its respective
+//  auto-channel); however, the mod MUST define snd_channel8volume and upwards
+//  in default.cfg if they are to be used, as the engine does not create them
+//  to not litter the cvar list
+//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
+//  flags as extra 7th and 8th argument
+//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
+//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
+//  the finished extension once done
+
+//DP_SND_OGGVORBIS
+//idea: Transfusion
+//darkplaces implementation: Elric
+//description:
+//the engine supports loading Ogg Vorbis sound files.  Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
+
+//DP_SND_STEREOWAV
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports stereo WAV files.  (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
+
+//DP_SND_GETSOUNDTIME
+//idea: VorteX
+//darkplaces implementation: VorteX
+//constant definitions:
+float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
+float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
+//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
+//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
+//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
+//examples of use:
+//  - QC-driven looped sounds
+//  - QC events when sound playing is finished
+//  - toggleable ambientsounds
+//  - subtitles
+
+//DP_VIDEO_DPV
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//console commands:
+//  playvideo <videoname> - start playing video
+//  stopvideo - stops current video
+//description: indicated that engine support playing videos in DPV format
+
+//DP_VIDEO_SUBTITLES
+//idea: VorteX
+//darkplaces implementation: VorteX
+//cvars:
+//  cl_video_subtitles - toggles subtitles showing
+//  cl_video_subtitles_lines - how many lines to reserve for subtitles
+//  cl_video_subtitles_textsize - font size
+//console commands:
+//  playvideo <videoname> <custom_subtitles_file> - start playing video
+//  stopvideo - stops current video
+//description: indicates that engine support subtitles on videos
+//subtitles stored in external text files, each video file has it's default subtitles file ( <videoname>.dpsubs )
+//example: for video/act1.dpv default subtitles file will be video/act1.dpsubs
+//also video could be played with custom subtitles file by utilizing second parm of playvideo command
+//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
+//   <start> <end> "string"
+//   start: subtitle start time in seconds
+//     end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, 
+//          if below 0 - show until next subtitles minus this number of seconds
+//    text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
+//example of subtitle file:
+//   3 0       "Vengeance! Vengeance for my eternity of suffering!"
+//   9 0       "Whelp! As if you knew what eternity was!"
+//   13        0       "Grovel before your true master."
+//   17        0       "Never!" 
+//   18        7       "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
+
+//DP_SOLIDCORPSE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//solid definitions:
+float SOLID_CORPSE = 5;
+//description:
+//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline.
+
+//DP_SPRITE32
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports .spr32 sprites.
+
+//DP_SV_BOTCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constants:
+float CLIENTTYPE_DISCONNECTED = 0;
+float CLIENTTYPE_REAL = 1;
+float CLIENTTYPE_BOT = 2;
+float CLIENTTYPE_NOTACLIENT = 3;
+//builtin definitions:
+entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available
+float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants
+//description:
+//spawns a client with no network connection, to allow bots to use client slots with no hacks.
+//How to use:
+/*
+       // to spawn a bot
+       local entity oldself;
+       oldself = self;
+       self = spawnclient();
+       if (!self)
+       {
+               bprint("Can not add bot, server full.\n");
+               self = oldself;
+               return;
+       }
+       self.netname = "Yoyobot";
+       self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants
+       ClientConnect();
+       PutClientInServer();
+       self = oldself;
+
+       // to remove all bots
+       local entity head;
+       head = find(world, classname, "player");
+       while (head)
+       {
+               if (clienttype(head) == CLIENTTYPE_BOT)
+                       dropclient(head);
+               head = find(head, classname, "player");
+       }
+
+       // to identify if a client is a bot (for example in PlayerPreThink)
+       if (clienttype(self) == CLIENTTYPE_BOT)
+               botthink();
+*/
+//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT
+//How it works:
+//creates a new client, calls SetNewParms and stores the parms, and returns the client.
+//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually
+//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is).
+//parms work the same on bot clients as they do on real clients, and do carry from level to level
+
+//DP_SV_BOUNCEFACTOR
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions:
+.float bouncefactor; // velocity multiplier after a bounce
+.float bouncestop; // bounce stops if velocity to bounce plane is < bouncestop * gravity AFTER the bounce
+//description:
+//allows qc to customize MOVETYPE_BOUNCE a bit
+
+//DP_SV_CLIENTCAMERA
+//idea: LordHavoc, others
+//darkplaces implementation: Black
+//field definitions:
+.entity clientcamera; // override camera entity
+//description:
+//allows another entity to be the camera for a client, for example a remote camera, this is similar to sending svc_setview manually except that it also changes the network culling appropriately.
+
+//DP_SV_CLIENTCOLORS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float clientcolors; // colors of the client (format: pants + shirt * 16)
+//description:
+//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
+
+//DP_SV_CLIENTNAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
+
+//DP_SV_CUSTOMIZEENTITYFORCLIENT
+//idea: LordHavoc
+//darkplaces implementation: [515] and LordHavoc
+//field definitions:
+.float() customizeentityforclient; // self = this entity, other = client entity
+//description:
+//allows qc to modify an entity before it is sent to each client, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
+//tips on writing customize functions:
+//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
+//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
+//example ideas for use of this extension:
+//making icons over teammates' heads which are only visible to teammates.  for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
+//making cloaked players more visible to their teammates than their enemies.  for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;};
+//making explosion models that face the viewer (does not work well with chase_active).  for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
+//implementation notes:
+//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
+
+//DP_SV_DISCARDABLEDEMO
+//idea: parasti
+//darkplaces implementation: parasti
+//field definitions:
+.float discardabledemo;
+//description:
+//when this field is set to a non-zero value on a player entity, a possibly recorded server-side demo for the player is discarded
+//Note that this extension only works if:
+//  auto demos are enabled (the cvar sv_autodemo_perclient is set)
+//  discarding demos is enabled (the cvar sv_autodemo_perclient_discardable is set)
+
+//DP_SV_DRAWONLYTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity drawonlytoclient;
+//description:
+//the entity is only visible to the specified client.
+
+//DP_SV_DROPCLIENT
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity clent) dropclient = #453;
+//description:
+//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
+
+//DP_SV_EFFECT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+//SVC definitions:
+//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
+//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate
+//description:
+//clientside playback of simple custom sprite effects (explosion sprites, etc).
+
+//DP_SV_ENTITYCONTENTSTRANSITION
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.void(float nOriginalContents, float nNewContents) contentstransition;
+//description:
+//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed.
+//The first parameter provides the entities original contents, prior to the transition.  The second parameter provides the new contents.
+//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds.
+
+//DP_SV_MOVETYPESTEP_LANDEVENT
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.void(vector vImpactVelocity) movetypesteplandevent;
+//description:
+//This field function, when provided, is triggered on a MOVETYPE_STEP entity when it experiences  "land event".
+// The standard engine behavior for this event is to play the sv_sound_land CVar sound.
+//The parameter provides the velocity of the entity at the time of the impact.  The z value may therefore be used to calculate how "hard" the entity struck the surface.
+//NOTE: If this field function is provided on a MOVETYPE_STEP entity, the standard sv_sound_land sound IS SUPPRESSED to allow for authors to create their own feedback.
+
+//DP_SV_POINTSOUND
+//idea: Dresk
+//darkplaces implementation: Dresk
+//builtin definitions:
+void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
+//description:
+//Similar to the standard QC sound function, this function takes an origin instead of an entity and omits the channel parameter.
+// This allows sounds to be played at arbitrary origins without spawning entities.
+
+//DP_SV_ONENTITYNOSPAWNFUNCTION
+//idea: Dresk
+//darkplaces implementation: Dresk
+//engine-called QC prototypes:
+//void() SV_OnEntityNoSpawnFunction;
+//description:
+// This function is called whenever an entity on the server has no spawn function, and therefore has no defined QC behavior.
+// You may as such dictate the behavior as to what happens to the entity.
+// To mimic the engine's default behavior, simply call remove(self).
+
+//DP_SV_ONENTITYPREPOSTSPAWNFUNCTION
+//idea: divVerent
+//darkplaces implementation: divVerent
+//engine-called QC prototypes:
+//void() SV_OnEntityPreSpawnFunction;
+//void() SV_OnEntityPostSpawnFunction;
+//description:
+// These functions are called BEFORE or AFTER an entity is spawned the regular way.
+// You may as such dictate the behavior as to what happens to the entity.
+// SV_OnEntityPreSpawnFunction is called before even looking for the spawn function, so you can even change its classname in there. If it remove()s the entity, the spawn function will not be looked for.
+// SV_OnEntityPostSpawnFunction is called ONLY after its spawn function or SV_OnEntityNoSpawnFunction was called, and skipped if the entity got removed by either.
+
+//DP_SV_MODELFLAGS_AS_EFFECTS
+//idea: LordHavoc, Dresk
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float modelflags;
+//constant definitions:
+float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own
+float MF_ROCKET  =   1; // leave a trail
+float MF_GRENADE =   2; // leave a trail
+float MF_GIB     =   4; // leave a trail
+float MF_ROTATE  =   8; // rotate (bonus items)
+float MF_TRACER  =  16; // green split trail
+float MF_ZOMGIB  =  32; // small blood trail
+float MF_TRACER2 =  64; // orange split trail
+float MF_TRACER3 = 128; // purple trail
+//description:
+//this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc.
+//setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS.
+//
+//silly example modification #1 to W_FireRocket in weapons.qc:
+//missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail
+//silly example modification #2 to W_FireRocket in weapons.qc:
+//missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail
+//
+//note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm.
+//
+//note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values.
+
+//DP_SV_NETADDRESS
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.string netaddress;
+//description:
+// provides the netaddress of the associated entity (ie. 127.0.0.1) and "null/botclient" if the netconnection of the entity is invalid
+
+//DP_SV_NODRAWTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity nodrawtoclient;
+//description:
+//the entity is not visible to the specified client.
+
+//DP_SV_PING
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float ping;
+//description:
+//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
+
+//DP_SV_PING_PACKETLOSS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float ping_packetloss;
+.float ping_movementloss;
+//description:
+//continuously updated field indicating client's packet loss, and movement loss (i.e. packet loss affecting player movement).
+
+//DP_SV_POINTPARTICLES
+//idea: Spike
+//darkplaces implementation: LordHavoc
+//function definitions:
+float(string effectname) particleeffectnum = #335; // same as in CSQC
+void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC
+void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
+//SVC definitions:
+//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end
+//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count
+//float svc_pointparticles1 = 62; // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
+//description:
+//provides the ability to spawn non-standard particle effects, typically these are defined in a particle effect information file such as effectinfo.txt in darkplaces.
+//this is a port of particle effect features from clientside QC (EXT_CSQC) to server QC, as these effects are potentially useful to all games even if they do not make use of EXT_CSQC.
+//warning: server must have same order of effects in effectinfo.txt as client does or the numbers would not match up, except for standard quake effects which are always the same numbers.
+
+//DP_SV_PUNCHVECTOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector punchvector;
+//description:
+//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
+
+//DP_SV_PLAYERPHYSICS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector movement;
+//cvar definitions:
+//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
+//engine-called QC prototypes:
+//void() SV_PlayerPhysics;
+//description:
+//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
+
+//DP_PHYSICS_ODE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//globals:
+//new movetypes:
+const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builtins applied
+//new solid types (deprecated):
+const float SOLID_PHYSICS_BOX = 32;
+const float SOLID_PHYSICS_SPHERE = 33;
+const float SOLID_PHYSICS_CAPSULE = 34;
+const float SOLID_PHYSICS_TRIMESH = 35;
+const float SOLID_PHYSICS_CYLINDER = 36;
+//geometry types:
+const float GEOMTYPE_NONE = -1;       // entity will be entirely skipped by ODE
+const float GEOMTYPE_SOLID = 0;       // geometry type will be set based on .solid field
+const float GEOMTYPE_BOX = 1;         // entity bound box
+const float GEOMTYPE_SPHERE = 2;      // sphere with radius picked from x axis of entity bound box
+const float GEOMTYPE_CAPSULE = 3;     // with leading axis automatically determined from longest one, radius is picked as minimal of the rest 2 axes
+const float GEOMTYPE_TRIMESH = 4;     // triangle mesh
+const float GEOMTYPE_CYLINDER = 5;    // like capsule but not capped
+                                      // note that ODE's builtin cylinder support is experimental, somewhat bugged and unfinished (no cylinder-cylinder collision)
+                                                                         // to use properly working cylinder should build ODE with LIBCCD extension
+const float GEOMTYPE_CAPSULE_X = 6;   // capsule with fixed leading axis
+const float GEOMTYPE_CAPSULE_Y = 7;
+const float GEOMTYPE_CAPSULE_Z = 8;
+const float GEOMTYPE_CYLINDER_X        = 9;  // cylinder with fixed leading axis
+const float GEOMTYPE_CYLINDER_Y        = 10;
+const float GEOMTYPE_CYLINDER_Z        = 11;
+//joint types:
+const float JOINTTYPE_NONE = 0;
+const float JOINTTYPE_POINT = 1;
+const float JOINTTYPE_HINGE = 2;
+const float JOINTTYPE_SLIDER = 3;
+const float JOINTTYPE_UNIVERSAL = 4;
+const float JOINTTYPE_HINGE2 = 5;
+const float JOINTTYPE_FIXED = -1;
+//force types:
+const float FORCETYPE_NONE = 0;
+const float FORCETYPE_FORCE = 1; // applied at center of mass
+const float FORCETYPE_FORCEATPOS = 2;
+const float FORCETYPE_TORQUE = 3;
+// common joint properties:
+// .entity aiment; // connected objects
+// .entity enemy; // connected objects, forces
+// .vector movedir;
+//   for a spring:
+//     movedir_x = spring constant (force multiplier, must be > 0)
+//     movedir_y = spring dampening constant to prevent oscillation (must be > 0)
+//     movedir_z = spring stop position (+/-)
+//   for a motor:
+//     movedir_x = desired motor velocity
+//     movedir_y = -1 * max motor force to use
+//     movedir_z = stop position (+/-), set to 0 for no stop
+//   note that ODE does not support both in one anyway
+//   for a force:
+//     force vector to apply
+//field definitions:
+.float  geomtype;     // see GEOMTYPE_*, a more correct way to set collision shape, allows to set SOLID_CORPSE and trimesh collisions
+.float  maxcontacts;  // maximum number of contacts to make for this object, lesser = faster (but setting it too low will could make object pass though walls), default is 16, maximum is 32
+.float  mass;         // ODE mass, standart value is 1
+.vector massofs;      // offsets a mass center out of object center, if not set a center of model bounds is used
+.float  friction;     // a friction of object, get multiplied by second objects's friction on contact
+.float  bouncefactor;
+.float  bouncestop; 
+.float  jointtype;    // type of joint
+.float  forcetype;    // type of force
+.float  erp;          // error restitution parameter, makes ODE solver attempt to fix errors in contacts, 
+                      // bringing together 2 joints or fixing object being stuch in other object, 
+                                 // a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
+                                 // use with care as high values makes system unstable and likely to explode
+//builtin definitions:
+void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
+void(entity e, vector force, vector force_pos) physics_addforce = #541; // deprecated, apply a force from certain origin, length of force vector is power of force
+void(entity e, vector torque) physics_addtorque = #542; // deprecated, add relative torque
+//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option
+//be sure to checkextension for it to know if library is loaded and ready, also to enable physics set "physics_ode" cvar to 1
+//note: this extension is highly experimental and may be unstable
+
+//DP_SV_PRINT
+//idea: id Software (QuakeWorld Server)
+//darkplaces implementation: Black, LordHavoc
+void(string s, ...) print = #339; // same number as in EXT_CSQC
+//description:
+//this is identical to dprint except that it always prints regardless of the developer cvar.
+
+//DP_SV_PRECACHEANYTIME
+//idea: id Software (Quake2)
+//darkplaces implementation: LordHavoc
+//description:
+//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
+
+//DP_SV_QCSTATUS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//1. A global variable
+string worldstatus;
+//Its content is set as "qcstatus" field in the rules.
+//It may be at most 255 characters, and must not contain newlines or backslashes.
+//2. A per-client field
+.string clientstatus;
+//It is sent instead of the "frags" in status responses.
+//It should always be set in a way so that stof(player.clientstatus) is a meaningful score value. Other info may be appended. If used this way, the cvar sv_status_use_qcstatus may be set to 1, and then this value will replace the frags in "status".
+//Currently, qstat does not support this and will not show player info if used and set to anything other than ftos(some integer).
+
+//DP_SV_ROTATINGBMODEL
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
+//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
+
+//DP_SV_SETCOLOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity ent, float colors) setcolor = #401;
+//engine called QC functions (optional):
+//void(float color) SV_ChangeTeam;
+//description:
+//setcolor sets the color on a client and updates internal color information accordingly (equivalent to stuffing a "color" command but immediate)
+//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.
+//the color format is pants + shirt * 16 (0-255 potentially)
+
+//DP_SV_SLOWMO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//cvars:
+//"slowmo" (0+, default 1)
+//description:
+//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
+//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
+
+//DP_SV_WRITEPICTURE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(float to, string s, float sz) WritePicture = #501;
+//description:
+//writes a picture to the data stream so CSQC can read it using ReadPicture, which has the definition
+//  string(void) ReadPicture = #501;
+//The picture data is sent as at most sz bytes, by compressing to low quality
+//JPEG. The data being sent will be equivalent to:
+//  WriteString(to, s);
+//  WriteShort(to, imagesize);
+//  for(i = 0; i < imagesize; ++i)
+//    WriteByte(to, [the i-th byte of the compressed JPEG image]);
+
+//DP_SV_WRITEUNTERMINATEDSTRING
+//idea: FrikaC
+//darkplaces implementation: Sajt
+//builtin definitions:
+void(float to, string s) WriteUnterminatedString = #456;
+//description:
+//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
+//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivalent of it in his FrikBot mod years ago involving WriteByte calls on each character.
+
+//DP_TE_BLOOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector velocity, float howmany) te_blood = #405;
+//temp entity definitions:
+float TE_BLOOD = 50;
+//protocol:
+//vector origin
+//byte xvelocity (-128 to +127)
+//byte yvelocity (-128 to +127)
+//byte zvelocity (-128 to +127)
+//byte count (0 to 255, how much blood)
+//description:
+//creates a blood effect.
+
+//DP_TE_BLOODSHOWER
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+//temp entity definitions:
+//float TE_BLOODSHOWER = 52;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//coord explosionspeed (velocity of blood particles flying out of the center)
+//short count (number of blood particles)
+//description:
+//creates an exploding shower of blood, for making gibbings more convincing.
+
+//DP_TE_CUSTOMFLASH
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
+//temp entity definitions:
+//float TE_CUSTOMFLASH = 73;
+//protocol:
+//vector origin
+//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius)
+//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime)
+//byte red (0.0 to 1.0 converted to 0-255)
+//byte green (0.0 to 1.0 converted to 0-255)
+//byte blue (0.0 to 1.0 converted to 0-255)
+//description:
+//creates a customized light flash.
+
+//DP_TE_EXPLOSIONRGB
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector color) te_explosionrgb = #407;
+//temp entity definitions:
+//float TE_EXPLOSIONRGB = 53;
+//protocol:
+//vector origin
+//byte red (0.0 to 1.0 converted to 0 to 255)
+//byte green (0.0 to 1.0 converted to 0 to 255)
+//byte blue (0.0 to 1.0 converted to 0 to 255)
+//description:
+//creates a colored explosion effect.
+
+//DP_TE_FLAMEJET
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_flamejet = #457;
+//temp entity definitions:
+//float TE_FLAMEJET = 74;
+//protocol:
+//vector origin
+//vector velocity
+//byte count (0 to 255, how many flame particles)
+//description:
+//creates a single puff of flame particles.  (not very useful really)
+
+//DP_TE_PARTICLECUBE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+//temp entity definitions:
+//float TE_PARTICLECUBE = 54;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity
+//short count
+//byte color (palette color)
+//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?)
+//coord randomvel (how much to jitter the velocity)
+//description:
+//creates a cloud of particles, useful for forcefields but quite customizable.
+
+//DP_TE_PARTICLERAIN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+//temp entity definitions:
+//float TE_PARTICLERAIN = 55;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity (velocity of particles)
+//short count (number of particles)
+//byte color (8bit palette color)
+//description:
+//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube.
+
+//DP_TE_PARTICLESNOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+//temp entity definitions:
+//float TE_PARTICLERAIN = 56;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity (velocity of particles)
+//short count (number of particles)
+//byte color (8bit palette color)
+//description:
+//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
+
+//DP_TE_PLASMABURN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_plasmaburn = #433;
+//temp entity definitions:
+//float TE_PLASMABURN = 75;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2) and marks the walls.
+
+//DP_TE_QUADEFFECTS1
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+//temp entity definitions:
+//float   TE_GUNSHOTQUAD  = 57; // [vector] origin
+//float   TE_SPIKEQUAD    = 58; // [vector] origin
+//float   TE_SUPERSPIKEQUAD = 59; // [vector] origin
+//float   TE_EXPLOSIONQUAD = 70; // [vector] origin
+//protocol:
+//vector origin
+//description:
+//all of these just take a location, and are equivalent in function (but not appearance :) to the original TE_GUNSHOT, etc.
+
+//DP_TE_SMALLFLASH
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_smallflash = #416;
+//temp entity definitions:
+//float TE_SMALLFLASH = 72;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2).
+
+//DP_TE_SPARK
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_spark = #411;
+//temp entity definitions:
+//float TE_SPARK = 51;
+//protocol:
+//vector origin
+//byte xvelocity (-128 to 127)
+//byte yvelocity (-128 to 127)
+//byte zvelocity (-128 to 127)
+//byte count (number of sparks)
+//description:
+//creates a shower of sparks and a smoke puff.
+
+//DP_TE_STANDARDEFFECTBUILTINS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float color, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+//description:
+//to make life easier on mod coders.
+
+//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//globals:
+.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
+float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
+float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
+float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
+string trace_dphittexturename; // texture name of impacted surface
+//constants:
+float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
+float DPCONTENTS_WATER = 2;
+float DPCONTENTS_SLIME = 4;
+float DPCONTENTS_LAVA = 8;
+float DPCONTENTS_SKY = 16;
+float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
+float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
+float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
+float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
+float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
+float DPCONTENTS_DONOTENTER = 1024; // AI hint brush
+float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
+float DPCONTENTS_BOTCLIP = 2048; // AI hint brush
+float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
+float Q3SURFACEFLAG_NODAMAGE = 1;
+float Q3SURFACEFLAG_SLICK = 2; // low friction surface
+float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
+float Q3SURFACEFLAG_LADDER = 8; // climbable surface
+float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
+float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
+float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
+float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
+float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
+float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
+//description:
+//adds additional information after a traceline/tracebox/tracetoss call.
+//also (very important) sets trace_* globals before calling .touch functions,
+//this allows them to inspect the nature of the collision (for example
+//determining if a projectile hit sky), clears trace_* variables for the other
+//object in a touch event (that is to say, a projectile moving will see the
+//trace results in its .touch function, but the player it hit will see very
+//little information in the trace_ variables as it was not moving at the time)
+
+//DP_VIEWZOOM
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float viewzoom;
+//description:
+//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
+
+//EXT_BITSHIFT
+//idea: Spike
+//darkplaces implementation: [515]
+//builtin definitions:
+float(float number, float quantity) bitshift = #218;
+//description:
+//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like).
+//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you.
+
+//FRIK_FILE
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s) stof = #81; // get numerical value from a string
+float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
+void(float fhandle) fclose = #111; // closes a file
+string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
+void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file
+float(string s) strlen = #114; // returns how many characters are in a string
+string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
+string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version
+vector(string s) stov = #117; // returns vector value from a string
+string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
+void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
+//constants:
+float FILE_READ = 0;
+float FILE_APPEND = 1;
+float FILE_WRITE = 2;
+//cvars:
+//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
+//description:
+//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
+//
+//NOTE: strzone functionality is partially superseded by
+//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed
+//NOTE: substring is upgraded by FTE_STRINGS extension with negative start/length handling identical to php 5.2.0
+
+//FTE_CSQC_SKELETONOBJECTS
+//idea: Spike, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+// all skeleton numbers are 1-based (0 being no skeleton)
+// all bone numbers are 1-based (0 being invalid)
+float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
+float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
+float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
+string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
+float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
+float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
+vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
+vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
+void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
+void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
+void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
+float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
+float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
+//fields:
+.float skeletonindex; // active skeleton overriding standard animation on model
+.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
+.float frame2; // secondary framegroup animation (strength = lerpfrac)
+.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
+.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
+.float lerpfrac; // strength of framegroup blend
+.float lerpfrac3; // strength of framegroup blend
+.float lerpfrac4; // strength of framegroup blend
+.float frame1time; // start time of framegroup animation
+.float frame2time; // start time of framegroup animation
+.float frame3time; // start time of framegroup animation
+.float frame4time; // start time of framegroup animation
+//description:
+//this extension provides a way to do complex skeletal animation on an entity.
+//
+//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
+//
+//notes:
+//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
+//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
+//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
+//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
+//
+//features include:
+//multiple animations blended together.
+//animating a model with animations from another model with a compatible skeleton.
+//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
+//custom bone controllers - for example making eyes track a target location.
+//
+//
+//
+//example code follows...
+//
+//this helper function lets you identify (by parentage) what group a bone
+//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
+//all children of the bone named "torso", unless they are children of
+//"leftarm" (which is a child of "torso") which would return 2 instead...
+float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
+{
+       local string bonename;
+       while (bonenum >= 0)
+       {
+               bonename = skel_get_bonename(skel, bonenum);
+               if (bonename == g1) return 1;
+               if (bonename == g2) return 2;
+               if (bonename == g3) return 3;
+               if (bonename == g4) return 4;
+               if (bonename == g5) return 5;
+               if (bonename == g6) return 6;
+               bonenum = skel_get_boneparent(skel, bonenum);
+       }
+       return 0;
+};
+// create a skeletonindex for our player using current modelindex
+void() example_skel_player_setup =
+{
+       self.skeletonindex = skel_create(self.modelindex);
+};
+// setup bones of skeleton based on an animation
+// note: animmodelindex can be a different model than self.modelindex
+void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
+{
+       // start with our standard animation
+       self.frame = framegroup;
+       self.frame2 = 0;
+       self.frame3 = 0;
+       self.frame4 = 0;
+       self.frame1time = framegroupstarttime;
+       self.frame2time = 0;
+       self.frame3time = 0;
+       self.frame4time = 0;
+       self.lerpfrac = 0;
+       self.lerpfrac3 = 0;
+       self.lerpfrac4 = 0;
+       skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
+};
+// apply a different framegroup animation to bones with a specified parent
+void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
+{
+       local float bonenum;
+       local float numbones;
+       self.frame = framegroup;
+       self.frame2 = 0;
+       self.frame3 = 0;
+       self.frame4 = 0;
+       self.frame1time = framegroupstarttime;
+       self.frame2time = 0;
+       self.frame3time = 0;
+       self.frame4time = 0;
+       self.lerpfrac = 0;
+       self.lerpfrac3 = 0;
+       self.lerpfrac4 = 0;
+       bonenum = 0;
+       numbones = skel_get_numbones(self.skeletonindex);
+       while (bonenum < numbones)
+       {
+               if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
+                       skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
+               bonenum = bonenum + 1;
+       }
+};
+// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
+void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
+{
+       local float bonenum;
+       local vector ang;
+       local vector oldforward, oldright, oldup;
+       local vector relforward, relright, relup, relorg;
+       local vector boneforward, boneright, boneup, boneorg;
+       local vector parentforward, parentright, parentup, parentorg;
+       local vector u, v;
+       local vector modeleyetarget;
+       bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
+       if (bonenum < 0)
+               return;
+       oldforward = v_forward;
+       oldright = v_right;
+       oldup = v_up;
+       v = eyetarget - self.origin;
+       modeleyetarget_x =   v * v_forward;
+       modeleyetarget_y = 0-v * v_right;
+       modeleyetarget_z =   v * v_up;
+       // this is an eyeball, make it point at the target location
+       // first get all the data we can...
+       relorg = skel_get_bonerel(self.skeletonindex, bonenum);
+       relforward = v_forward;
+       relright = v_right;
+       relup = v_up;
+       boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
+       boneforward = v_forward;
+       boneright = v_right;
+       boneup = v_up;
+       parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
+       parentforward = v_forward;
+       parentright = v_right;
+       parentup = v_up;
+       // get the vector from the eyeball to the target
+       u = modeleyetarget - boneorg;
+       // now transform it inversely by the parent matrix to produce new rel vectors
+       v_x = u * parentforward;
+       v_y = u * parentright;
+       v_z = u * parentup;
+       ang = vectoangles2(v, relup);
+       ang_x = 0 - ang_x;
+       makevectors(ang);
+       // set the relative bone matrix
+       skel_set_bone(self.skeletonindex, bonenum, relorg);
+       // restore caller's v_ vectors
+       v_forward = oldforward;
+       v_right = oldright;
+       v_up = oldup;
+};
+// delete skeleton when we're done with it
+// note: skeleton remains valid until next frame when it is really deleted
+void() example_skel_player_delete =
+{
+       skel_delete(self.skeletonindex);
+       self.skeletonindex = 0;
+};
+//
+// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
+//
+
+//KRIMZON_SV_PARSECLIENTCOMMAND
+//idea: KrimZon
+//darkplaces implementation: KrimZon, LordHavoc
+//engine-called QC prototypes:
+//void(string s) SV_ParseClientCommand;
+//builtin definitions:
+void(entity e, string s) clientcommand = #440;
+float(string s) tokenize = #441;
+string(float n) argv = #442;
+//description:
+//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
+
+//NEH_CMD_PLAY2
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "play2" console command (plays a sound without spatialization).
+
+//NEH_RESTOREGAME
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//engine-called QC prototypes:
+//void() RestoreGame;
+//description:
+//when a savegame is loaded, this function is called
+
+//NEXUIZ_PLAYERMODEL
+//idea: Nexuiz
+//darkplaces implementation: Black
+//console commands:
+//playermodel <name> - FIXME: EXAMPLE NEEDED
+//playerskin <name> - FIXME: EXAMPLE NEEDED
+//field definitions:
+.string playermodel; // name of player model sent by client
+.string playerskin; // name of player skin sent by client
+//description:
+//these client properties are used by Nexuiz.
+
+//NXQ_GFX_LETTERBOX
+//idea: nxQuake
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
+
+//PRYDON_CLIENTCURSOR
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
+//field definitions:
+.float cursor_active; // true if cl_prydoncursor mode is on
+.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
+.vector cursor_trace_start; // position of camera
+.vector cursor_trace_endpos; // position of cursor in world (as traced from camera)
+.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt)
+//cvar definitions:
+//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented)
+//description:
+//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit.
+//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen.
+//the clientside trace skips transparent entities (except those marked EF_SELECTABLE).
+//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2).
+//intended to be used by Prydon Gate.
+
+//TENEBRAE_GFX_DLIGHTS
+//idea: Tenebrae
+//darkplaces implementation: LordHavoc
+//fields:
+.float light_lev; // radius (does not affect brightness), typical value 350
+.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast)
+.float style; // light style (like normal light entities, flickering torches or switchable, etc)
+.float pflags; // flags (see PFLAGS_ constants)
+.vector angles; // orientation of the light
+.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
+//constants:
+float PFLAGS_NOSHADOW = 1; // light does not cast shadows
+float PFLAGS_CORONA = 2; // light has a corona flare
+float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!)
+//description:
+//more powerful dynamic light settings
+//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
+//changes compared to tenebrae (because they're too 'leet' for standards):
+//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
+//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
+
+//TW_SV_STEPCONTROL
+//idea: Transfusion
+//darkplaces implementation: LordHavoc
+//cvars:
+//sv_jumpstep (0/1, default 1)
+//sv_stepheight (default 18)
+//description:
+//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
+
+//FTE_QC_CHECKPVS
+//idea: Urre
+//darkplaces implementation: divVerent
+//builtin definitions:
+float checkpvs(vector viewpos, entity viewee) = #240;
+//description:
+//returns true if viewee can be seen from viewpos according to PVS data
+
+//FTE_STRINGS
+//idea: many
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive
+float(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character
+string(float c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127.
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum.
+string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
+string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
+string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
+float(string s1, string s2) strcmp = #228; // compare two strings
+float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
+float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
+float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
+//string(string s, float start, float length) substring = #116; // see note below
+//description:
+//various string manipulation functions
+//note: substring also exists in FRIK_FILE but this extension adds negative start and length as valid cases (see note above), substring is consistent with the php 5.2.0 substr function (not 5.2.3 behavior)
+//substring returns a section of a string as a tempstring, if given negative
+// start the start is measured back from the end of the string, if given a
+// negative length the length is the offset back from the end of the string to
+// stop at, rather than being relative to start, if start is negative and
+// larger than length it is treated as 0.
+// examples of substring:
+// substring("blah", -3, 3) returns "lah"
+// substring("blah", 3, 3) returns "h"
+// substring("blah", -10, 3) returns "bla"
+// substring("blah", -10, -3) returns "b"
+
+//DP_CON_BESTWEAPON
+//idea: many
+//darkplaces implementation: divVerent
+//description:
+//allows QC to register weapon properties for use by the bestweapon command, for mods that change required ammo count or type for the weapons
+//it is done using console commands sent via stuffcmd:
+//  register_bestweapon quake
+//  register_bestweapon clear
+//  register_bestweapon <shortname> <impulse> <itemcode> <activeweaponcode> <ammostat> <ammomin>
+//for example, this is what Quake uses:
+//  register_bestweapon 1 1 4096 4096 6 0 // STAT_SHELLS is 6
+//  register_bestweapon 2 2    1    1 6 1
+//  register_bestweapon 3 3    2    2 6 1
+//  register_bestweapon 4 4    4    4 7 1 // STAT_NAILS is 7
+//  register_bestweapon 5 5    8    8 7 1
+//  register_bestweapon 6 6   16   16 8 1 // STAT_ROCKETS is 8
+//  register_bestweapon 7 7   32   32 8 1
+//  register_bestweapon 8 8   64   64 9 1 // STAT_CELLS is 9
+//after each map client initialization, this is reset back to Quake settings. So you should send these data in ClientConnect.
+//also, this extension introduces a new "cycleweapon" command to the user.
+
+//DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
+float() buf_create = #460;
+void(float bufhandle) buf_del = #461;
+float(float bufhandle) buf_getsize = #462;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
+void(float bufhandle, float sortpower, float backward) buf_sort = #464;
+string(float bufhandle, string glue) buf_implode = #465;
+string(float bufhandle, float string_index) bufstr_get = #466;
+void(float bufhandle, float string_index, string str) bufstr_set = #467;
+float(float bufhandle, string str, float order) bufstr_add = #468;
+void(float bufhandle, float string_index) bufstr_free = #469;
+
+//DP_QC_STRINGBUFFERS_CVARLIST
+//idea: divVerent
+//darkplaces implementation: divVerent
+//functions to list cvars and store their names into a stringbuffer
+//cvars that start with pattern but not with antipattern will be stored into the buffer
+void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
+
+//DP_QC_STRINGBUFFERS_EXT_WIP
+//idea: VorteX
+//darkplaces implementation: VorteX
+//constant definitions:
+const float MATCH_AUTO = 0;
+const float MATCH_WHOLE = 1;
+const float MATCH_LEFT = 2;
+const float MATCH_RIGHT = 3;
+const float MATCH_MIDDLE = 4;
+const float MATCH_PATTERN = 5;
+//builtin definitions:
+float(string filename, float bufhandle) buf_loadfile = #535; // append each line of file as new buffer string, return 1 if succesful
+float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile = #536; // writes buffer strings as lines, returns 1 if succesful
+float(float bufhandle, string match, float matchrule, float startpos, float step) bufstr_find = #537; // returns string index
+float(string s, string pattern, float matchrule) matchpattern = #538; // returns 0/1
+float(string s, string pattern, float matchrule, float pos) matchpatternofs = #538;
+//description:
+//provides a set of functions to manipulate with string buffers
+//pattern wildcards: * - any character (or no characters), ? - any 1 character
+//Warning: This extension is work-in-progress, it may be changed/revamped/removed at any time, dont use it if you dont want any trouble
+//wip note: UTF8 is not supported yet
+
+//DP_QC_STRREPLACE
+//idea: Sajt
+//darkplaces implementation: Sajt
+//builtin definitions:
+string(string search, string replace, string subject) strreplace = #484;
+string(string search, string replace, string subject) strireplace = #485;
+//description:
+//strreplace replaces all occurrences of 'search' with 'replace' in the string 'subject', and returns the result as a tempstring.
+//strireplace does the same but uses case-insensitive matching of the 'search' term
+
+//DP_SV_SHUTDOWN
+//idea: divVerent
+//darkplaces implementation: divVerent
+//A function that gets called just before progs exit. To save persistent data from.
+//It is not called on a crash or error.
+//void SV_Shutdown();
+
+//EXT_CSQC
+// #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
+void(float index, float type, ...) addstat = #232;
+
+//ZQ_PAUSE
+//idea: ZQuake
+//darkplaces implementation: GreEn`mArine
+//builtin definitions:
+void(float pause) setpause = #531;
+//function definitions:
+//void(float elapsedtime) SV_PausedTic;
+//description:
+//during pause the world is not updated (time does not advance), SV_PausedTic is the only function you can be sure will be called at regular intervals during the pause, elapsedtime is the current system time in seconds since the pause started (not affected by slowmo or anything else).
+//
+//calling setpause(0) will end a pause immediately.
+//
+//Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause.  In other words, the only things that are not called are think and other time-related functions.
+
+//DP_COVERAGE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//function definitions:
+void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
+
+
+// EXPERIMENTAL (not finalized) EXTENSIONS:
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions: (SVQC)
+.string crypto_keyfp; // fingerprint of CA key the player used to authenticate
+.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player
+.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified
+.float crypto_idfp_signed; // set if the player's ID has been signed
+.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext
+.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext
+// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for
+//builtin definitions: (SVQC)
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
+//description:
+//use -1 as buffer handle to justs end delim as postdata
diff --git a/qcsrc/dpdefs/upstream/keycodes.qc b/qcsrc/dpdefs/upstream/keycodes.qc
new file mode 100644 (file)
index 0000000..e3d98ab
--- /dev/null
@@ -0,0 +1,146 @@
+///////////////////////////
+// key constants
+
+//
+// these are the key numbers that should be passed to Key_Event
+//
+float K_TAB                    =       9;
+float K_ENTER          =       13;
+float K_ESCAPE         =       27;
+float K_SPACE          =       32;
+
+// normal keys should be passed as lowercased ascii
+
+float K_BACKSPACE      =       127;
+float K_UPARROW                =       128;
+float K_DOWNARROW      =       129;
+float K_LEFTARROW      =       130;
+float K_RIGHTARROW     =       131;
+
+float K_ALT            =       132;
+float K_CTRL   =       133;
+float K_SHIFT  =       134;
+
+float K_F1             =       135;
+float K_F2             =       136;
+float K_F3             =       137;
+float K_F4             =       138;
+float K_F5             =       139;
+float K_F6             =       140;
+float K_F7             =       141;
+float K_F8             =       142;
+float K_F9             =       143;
+float K_F10            =       144;
+float K_F11            =       145;
+float K_F12            =       146;
+
+float K_INS            =       147;
+float K_DEL            =       148;
+float K_PGDN   =       149;
+float K_PGUP   =       150;
+float K_HOME   =       151;
+float K_END            =       152;
+
+float K_NUMLOCK                = 154;
+float K_CAPSLOCK       = 155;
+float K_SCROLLOCK      = 156;
+
+float K_KP_0   =       157;
+float K_KP_INS =       157; // same as K_KP_0
+float K_KP_1   =       158;
+float K_KP_END =       158; // same as K_KP_1
+float K_KP_2   =       159;
+float K_KP_DOWNARROW = 159; // same as K_KP_2
+float K_KP_3   =       160;
+float K_KP_PGDN = 160; // same as K_KP_3
+float K_KP_4   =       161;
+float K_KP_LEFTARROW = 161; // same as K_KP_4
+float K_KP_5   =       162;
+float K_KP_6   =       163;
+float K_KP_RIGHTARROW = 163; // same as K_KP_6
+float K_KP_7   =       164;
+float K_KP_HOME = 164; // same as K_KP_7
+float K_KP_8   =       165;
+float K_KP_UPARROW = 165; // same as K_KP_8
+float K_KP_9   = 166;
+float K_KP_PGUP = 166; // same as K_KP_9
+float K_KP_PERIOD = 167;
+float K_KP_DEL = 167; // same as K_KP_PERIOD
+float K_KP_DIVIDE = 168;
+float K_KP_SLASH = 168; // same as K_KP_DIVIDE
+float K_KP_MULTIPLY = 169;
+float K_KP_MINUS       = 170;
+float K_KP_PLUS                = 171;
+float K_KP_ENTER       = 172;
+float K_KP_EQUALS      = 173;
+
+// mouse buttons generate virtual keys
+float K_PAUSE  =       153;
+
+//
+// joystick buttons
+//
+float K_JOY1 = 768;
+float K_JOY2 = 769;
+float K_JOY3 = 770;
+float K_JOY4 = 771;
+
+//
+//
+// aux keys are for multi-buttoned joysticks to generate so they can use
+// the normal binding process
+//
+float K_AUX1   =       772;
+float K_AUX2   =       773;
+float K_AUX3   =       774;
+float K_AUX4   =       775;
+float K_AUX5   =       776;
+float K_AUX6   =       777;
+float K_AUX7   =       778;
+float K_AUX8   =       779;
+float K_AUX9   =       780;
+float K_AUX10  =       781;
+float K_AUX11  =       782;
+float K_AUX12  =       783;
+float K_AUX13  =       784;
+float K_AUX14  =       785;
+float K_AUX15  =       786;
+float K_AUX16  =       787;
+float K_AUX17  =       788;
+float K_AUX18  =       789;
+float K_AUX19  =       790;
+float K_AUX20  =       791;
+float K_AUX21  =       792;
+float K_AUX22  =       793;
+float K_AUX23  =       794;
+float K_AUX24  =       795;
+float K_AUX25  =       796;
+float K_AUX26  =       797;
+float K_AUX27  =       798;
+float K_AUX28  =       799;
+float K_AUX29  =       800;
+float K_AUX30  =       801;
+float K_AUX31  =       802;
+float K_AUX32  =       803;
+
+//
+// mouse buttons generate virtual keys
+//
+float K_MOUSE1         =       512;
+float K_MOUSE2         =       513;
+float K_MOUSE3         =       514;
+float K_MWHEELUP       =       515;
+float K_MWHEELDOWN     =       516;
+float K_MOUSE4         =       517;
+float K_MOUSE5         =       518;
+float K_MOUSE6         =       519;
+float K_MOUSE7         =       520;
+float K_MOUSE8         =       521;
+float K_MOUSE9         =       522;
+float K_MOUSE10                =       523;
+float K_MOUSE11                =       524;
+float K_MOUSE12                =       525;
+float K_MOUSE13                =       526;
+float K_MOUSE14                =       527;
+float K_MOUSE15                =       528;
+float K_MOUSE16                =       529;
diff --git a/qcsrc/dpdefs/upstream/menudefs.qc b/qcsrc/dpdefs/upstream/menudefs.qc
new file mode 100644 (file)
index 0000000..8caab4a
--- /dev/null
@@ -0,0 +1,584 @@
+//////////////////////////////////////////////////////////
+// sys globals
+
+entity self;
+
+/////////////////////////////////////////////////////////
+void           end_sys_globals;
+/////////////////////////////////////////////////////////
+// sys fields
+
+/////////////////////////////////////////////////////////
+void           end_sys_fields;
+/////////////////////////////////////////////////////////
+// sys functions
+
+void() m_init;
+void(float keynr, float ascii) m_keydown;
+void(float width, float height) m_draw;
+void(float mode) m_toggle;
+void() m_shutdown;
+// optional: float(float) m_gethostcachecategory;
+
+/////////////////////////////////////////////////////////
+// sys constants
+///////////////////////////
+// key dest constants
+
+float KEY_UNKNOWN      =       -1;
+float KEY_GAME                 =       0;
+float KEY_MENU         =       2;
+float KEY_MENU_GRABBED =       3;
+
+///////////////////////////
+// file constants
+
+float FILE_READ = 0;
+float FILE_APPEND = 1;
+float FILE_WRITE = 2;
+
+///////////////////////////
+// logical constants (just for completeness)
+
+float TRUE     = 1;
+float FALSE = 0;
+
+///////////////////////////
+// boolean constants
+
+float true = 1;
+float false = 0;
+
+///////////////////////////
+// msg constants
+
+float MSG_BROADCAST            = 0;            // unreliable to all
+float MSG_ONE                  = 1;            // reliable to one (msg_entity)
+float MSG_ALL                  = 2;            // reliable to all
+float MSG_INIT                 = 3;            // write to the init string
+
+/////////////////////////////
+// mouse target constants
+
+float MT_MENU = 1;
+float MT_CLIENT = 2;
+
+/////////////////////////
+// client state constants
+
+float CS_DEDICATED             = 0;
+float CS_DISCONNECTED  = 1;
+float CS_CONNECTED             = 2;
+
+///////////////////////////
+// blend flags
+
+float DRAWFLAG_NORMAL          = 0;
+float DRAWFLAG_ADDITIVE        = 1;
+float DRAWFLAG_MODULATE        = 2;
+float DRAWFLAG_2XMODULATE   = 3;
+
+///////////////////////////
+// null entity (actually it is the same like the world entity)
+
+entity null_entity;
+
+///////////////////////////
+// error constants
+
+// file handling
+float ERR_CANNOTOPEN                   = -1; // fopen
+float ERR_NOTENOUGHFILEHANDLES         = -2; // fopen
+float ERR_INVALIDMODE                  = -3; // fopen
+float ERR_BADFILENAME                  = -4; // fopen
+
+// drawing functions
+
+float ERR_NULLSTRING                   = -1;
+float ERR_BADDRAWFLAG                  = -2;
+float ERR_BADSCALE                             = -3;
+float ERR_BADSIZE                              = -3; // same as ERR_BADSCALE
+float ERR_NOTCACHED                            = -4;
+
+// server list stuff
+float SLIST_HOSTCACHEVIEWCOUNT  = 0;
+float SLIST_HOSTCACHETOTALCOUNT = 1;
+float SLIST_MASTERQUERYCOUNT   = 2;
+float SLIST_MASTERREPLYCOUNT   = 3;
+float SLIST_SERVERQUERYCOUNT   = 4;
+float SLIST_SERVERREPLYCOUNT   = 5;
+float SLIST_SORTFIELD          = 6;
+float SLIST_SORTDESCENDING     = 7;
+float SLIST_LEGACY_LINE1       = 1024;
+float SLIST_LEGACY_LINE2       = 1025;
+float SLIST_TEST_CONTAINS      = 0;
+float SLIST_TEST_NOTCONTAIN    = 1;
+float SLIST_TEST_LESSEQUAL     = 2;
+float SLIST_TEST_LESS          = 3;
+float SLIST_TEST_EQUAL         = 4;
+float SLIST_TEST_GREATER       = 5;
+float SLIST_TEST_GREATEREQUAL  = 6;
+float SLIST_TEST_NOTEQUAL      = 7;
+float SLIST_TEST_STARTSWITH    = 8;
+float SLIST_TEST_NOTSTARTSWITH = 9;
+float SLIST_MASK_AND = 0;
+float SLIST_MASK_OR  = 512;
+
+// font stuff
+float FONT_DEFAULT     = 0;
+float FONT_CONSOLE     = 1;
+float FONT_SBAR        = 2;
+float FONT_NOTIFY      = 3;
+float FONT_CHAT        = 4;
+float FONT_CENTERPRINT = 5;
+float FONT_INFOBAR     = 6;
+float FONT_MENU        = 7;
+float FONT_USER        = 8; // add to this the index, like FONT_USER+3 = user3. At least 8 of them are supported.
+float drawfont;
+
+/* not supported at the moment
+///////////////////////////
+// os constants
+
+float OS_WINDOWS       = 0;
+float OS_LINUX         = 1;
+float OS_MAC           = 2;
+*/
+
+
+
+
+
+
+
+
+
+
+//////////////////////////////////////////////////
+// common cmd
+//////////////////////////////////////////////////
+// AK FIXME: Create perhaps a special builtin file for the common cmds
+
+void   checkextension(string ext)      = #1;
+
+// error cmds
+void   error(string err,...)           = #2;
+void   objerror(string err,...)        = #3;
+
+// print
+
+void   print(string text,...)                   = #4;
+void   bprint(string text,...)                  = #5;
+void   sprint(float clientnum, string text,...) = #6;
+void   centerprint(string text,...)             = #7;
+
+// vector stuff
+
+vector normalize(vector v)             = #8;
+float  vlen(vector v)                  = #9;
+float          vectoyaw(vector v)              = #10;
+vector         vectoangles(vector v)           = #11;
+
+float  random(void)  = #12;
+
+void   cmd(string command, ...) = #13;
+
+// cvar cmds
+
+float  cvar(string name)                       = #14;
+const string str_cvar(string name)             = #71;
+void   cvar_set(string name, string value)     = #15;
+
+void   dprint(string text,...) = #16;
+
+// conversion functions
+
+string ftos(float f)   = #17;
+float  fabs(float f)   = #18;
+string vtos(vector v)  = #19;
+string etos(entity e)  = #20;
+
+float  stof(string val,...)  = #21;
+
+entity spawn(void)             = #22;
+void   remove(entity e)        = #23;
+
+entity find(entity start, .string field, string match)         = #24;
+entity findfloat(entity start, .float field, float match)      = #25;
+entity findentity(entity start, .entity field, entity match)   = #25;
+
+entity findchainstring(.string field, string match)    = #26;
+entity findchainfloat(.float field, float match)       = #27;
+entity findchainentity(.entity field, entity match)    = #27;
+
+string precache_file(string file)      = #28;
+string precache_sound(string sample)   = #29;
+
+void   crash(void)     = #72;
+void   coredump(void)  = #30;
+void   stackdump(void) = #73;
+void   traceon(void)   = #31;
+void   traceoff(void)  = #32;
+
+void   eprint(entity e)        = #33;
+float  rint(float f)           = #34;
+float  floor(float f)          = #35;
+float  ceil(float f)           = #36;
+entity nextent(entity e)       = #37;
+float  sin(float f)            = #38;
+float  cos(float f)            = #39;
+float  sqrt(float f)           = #40;
+vector randomvec(void)         = #41;
+
+float  registercvar(string name, string value, float flags)  = #42; // returns 1 if success
+
+float  min(float f,...)  = #43;
+float  max(float f,...)  = #44;
+
+float  bound(float min,float value, float max)  = #45;
+float  pow(float a, float b)  = #46;
+
+void   copyentity(entity src, entity dst)  = #47;
+
+float  fopen(string filename, float mode)  = #48;
+void   fclose(float fhandle)  = #49;
+string fgets(float fhandle)  = #50;
+void   fputs(float fhandle, string s)  = #51;
+
+float  strlen(string s)  = #52;
+string strcat(string s1,string s2,...)  = #53;
+string substring(string s, float start, float length)  = #54;
+
+vector stov(string s)  = #55;
+
+string strzone(string s)  = #56;
+void   strunzone(string s) = #57;
+
+float  tokenize(string s)  = #58;
+string argv(float n)  = #59;
+
+float  isserver(void)  = #60;
+float  clientcount(void)  = #61;
+float  clientstate(void)  = #62;
+void   clientcommand(float client, string s)  = #63;
+void   changelevel(string map)  = #64;
+void   localsound(string sample)  = #65;
+vector getmousepos(void)       = #66;
+float  gettime(void)           = #67;
+void   loadfromdata(string data) = #68;
+void   loadfromfile(string file) = #69;
+
+float  mod(float val, float m) = #70;
+
+float  search_begin(string pattern, float caseinsensitive, float quiet) = #74;
+void   search_end(float handle) = #75;
+float  search_getsize(float handle) = #76;
+string search_getfilename(float handle, float num) = #77;
+
+string chr(float ascii) = #78;
+
+/////////////////////////////////////////////////
+// Write* Functions
+/////////////////////////////////////////////////
+void   WriteByte(float data, float dest, float desto)  = #401;
+void   WriteChar(float data, float dest, float desto)  = #402;
+void   WriteShort(float data, float dest, float desto) = #403;
+void   WriteLong(float data, float dest, float desto)  = #404;
+void   WriteAngle(float data, float dest, float desto) = #405;
+void   WriteCoord(float data, float dest, float desto) = #406;
+void   WriteString(string data, float dest, float desto)= #407;
+void   WriteEntity(entity data, float dest, float desto) = #408;
+
+//////////////////////////////////////////////////
+// Draw funtions
+//////////////////////////////////////////////////
+
+float  iscachedpic(string name)        = #451;
+string precache_pic(string name, ...)  = #452;
+void   freepic(string name)            = #453;
+
+float  drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
+
+float  drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
+
+float  drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
+
+vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
+float  drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
+
+float  drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
+
+void   drawsetcliparea(float x, float y, float width, float height) = #458;
+
+void   drawresetcliparea(void) = #459;
+
+vector  drawgetimagesize(string pic) = #460;
+
+////////////////////////////////////////////////
+// Menu functions
+////////////////////////////////////////////////
+
+void   setkeydest(float dest)  = #601;
+float  getkeydest(void)        = #602;
+
+void   setmousetarget(float trg) = #603;
+float  getmousetarget(void)      = #604;
+
+float  isfunction(string function_name) = #607;
+void   callfunction(...) = #605;
+void   writetofile(float fhandle, entity ent) = #606;
+vector getresolution(float number) = #608;
+string keynumtostring(float keynum) = #609;
+
+float  gethostcachevalue(float type) = #611;
+string gethostcachestring(float type, float hostnr) = #612;
+
+//DP_CSQC_BINDMAPS
+//idea: daemon, motorsep
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(float key, float bindmap) getkeybind_bindmap = #342;
+float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
+vector(void) getbindmaps = #631;
+float(vector bm) setbindmaps = #632;
+string(string command, float bindmap) findkeysforcommand = #610;
+float(string key) stringtokeynum = #341;
+//<also allowed builtin number to match EXT_CSQC> string(float keynum) keynumtostring = #340;
+//description: key bind setting/getting including support for switchable
+//bindmaps.
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions: (MENUQC)
+string(string serveraddress) crypto_getkeyfp = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
+string(string serveraddress) crypto_getidfp = #634; // retrieves the cached host key fingerprint of a server given by IP address
+float(string serveraddress) crypto_getidstatus = #643; // retrieves the cached host key's key status. See below for CRYPTO_IDSTATUS_ defines.
+string(string serveraddress) crypto_getencryptlevel = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
+string(float i) crypto_getmykeyfp = #636; // retrieves the CA key fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
+string(float i) crypto_getmyidfp = #637; // retrieves the ID fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
+float CRYPTO_IDSTATUS_OUTOFRANGE = -1;
+float CRYPTO_IDSTATUS_EMPTY = 0;
+float CRYPTO_IDSTATUS_UNSIGNED = 1;
+float CRYPTO_IDSTATUS_SIGNED = 2;
+float(float i) crypto_getmyidstatus = #641; // retrieves the ID's status of a given CA slot, or 0 if slot is unused but more to come, or -1 if end of list
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
+//description:
+//use -1 as buffer handle to justs end delim as postdata
+
+//DP_GECKO_SUPPORT
+//idea: Res2k, BlackHC
+//darkplaces implementation: Res2k, BlackHC
+//constant definitions:
+float GECKO_BUTTON_DOWN         = 0;
+float GECKO_BUTTON_UP           = 1;
+// either use down and up or just press but not all of them!
+float GECKO_BUTTON_PRESS        = 2;
+// use this for mouse events if needed?
+float GECKO_BUTTON_DOUBLECLICK  = 3;
+//builtin definitions:
+float gecko_create( string name ) = #487;
+void gecko_destroy( string name ) = #488;
+void gecko_navigate( string name, string URI ) = #489;
+float gecko_keyevent( string name, float key, float eventtype ) = #490;
+void gecko_mousemove( string name, float x, float y ) = #491;
+void gecko_resize( string name, float w, float h ) = #492;
+vector gecko_get_texture_extent( string name ) = #493;
+//engine-called QC prototypes:
+//string(string name, string query) Qecko_Query;
+//description:
+//provides an interface to the offscreengecko library and allows for internet browsing in games
+
+//FTE_STRINGS
+//idea: many
+//darkplaces implementation: KrimZon
+//description:
+//various string manipulation functions
+float(string str, string sub, float startpos) strstrofs = #221;
+float(string str, float ofs) str2chr = #222;
+string(float c, ...) chr2str = #223;
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
+string(float chars, string s, ...) strpad = #225;
+string(string info, string key, string value, ...) infoadd = #226;
+string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
+float(string s1, string s2, float len) strncmp = #228;
+float(string s1, string s2) strcasecmp = #229;
+float(string s1, string s2, float len) strncasecmp = #230;
+
+//DP_PRECACHE_PIC_FLAGS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
+float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
+float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
+//notes: these constants are given as optional second argument to precache_pic()
+
+//DP_QC_CRC16
+//idea: div0
+//darkplaces implementation: div0
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
+//DP_QC_CVAR_TYPE
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
+
+//DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
+float() buf_create = #440;
+void(float bufhandle) buf_del = #441;
+float(float bufhandle) buf_getsize = #442;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
+void(float bufhandle, float sortpower, float backward) buf_sort = #444;
+string(float bufhandle, string glue) buf_implode = #445;
+string(float bufhandle, float string_index) bufstr_get = #446;
+void(float bufhandle, float string_index, string str) bufstr_set = #447;
+float(float bufhandle, string str, float order) bufstr_add = #448;
+void(float bufhandle, float string_index) bufstr_free = #449;
+void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
+
+//DP_QC_STRING_CASE_FUNCTIONS
+//idea: Dresk
+//darkplaces implementation: LordHavoc / Dresk
+//builtin definitions:
+string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
+string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
+//description:
+//provides simple string uppercase and lowercase functions
+
+//DP_QC_CVAR_DESCRIPTION
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string name) cvar_description = #518;
+//description:
+//returns the description of a cvar
+
+//DP_QC_DIGEST
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string digest, string data, ...) digest_hex = #639;
+//description:
+//returns a given hex digest of given data
+//the returned digest is always encoded in hexadecimal
+//only the "MD4" digest is always supported!
+//if the given digest is not supported, string_null is returned
+//the digest string is matched case sensitively, use "MD4", not "md4"!
+
+//DP_QC_URI_ESCAPE
+//idea: div0
+//darkplaces implementation: div0
+//URI::Escape's functionality
+string(string in) uri_escape = #510;
+string(string in) uri_unescape = #511;
+
+//DP_QC_URI_GET
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string
+//returns 1 on success of initiation, 0 if there are too many concurrent
+//connections already or if the URL is invalid
+//the following callback will receive the data and MUST exist!
+//  void(float id, float status, string data) URI_Get_Callback;
+//status is either
+//  negative for an internal error,
+//  0 for success, or
+//  the HTTP response code on server error (e.g. 404)
+//if 1 is returned by uri_get, the callback will be called in the future
+float(string url, float id) uri_get = #513;
+//DP_QC_URI_POST
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string after POSTing via HTTP
+//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
+//and uri_post sends the string buffer buf, joined using the delimiter delim
+float(string url, float id, string content_type, string data) uri_post = #513;
+float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
+
+//DP_QC_ENTITYDATA
+//idea: KrimZon
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float() numentityfields = #496;
+string(float fieldnum) entityfieldname = #497;
+float(float fieldnum) entityfieldtype = #498;
+string(float fieldnum, entity ent) getentityfieldstring = #499;
+float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
+//constants:
+//Returned by entityfieldtype
+float FIELD_STRING   = 1;
+float FIELD_FLOAT    = 2;
+float FIELD_VECTOR   = 3;
+float FIELD_ENTITY   = 4;
+float FIELD_FUNCTION = 6;
+//description:
+//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
+//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
+//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
+//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
+//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
+//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
+
+//DP_COVERAGE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//function definitions:
+void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
+
+// assorted undocumented extensions
+string(string, float) netaddress_resolve = #625;
+string(string search, string replace, string subject) strreplace = #484;
+string(float uselocaltime, string format, ...) strftime = #478;
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
+string(float, float) getgamedirinfo = #626;
+#define GETGAMEDIRINFO_NAME 0
+#define GETGAMEDIRINFO_DESCRIPTION 1
+float log(float f) = #532;
+string(string format, ...) sprintf = #627;
+string(string s) strdecolorize = #477;
+entity findflags(entity start, .float field, float match) = #87;
+entity findchainflags(.float field, float match) = #88;
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+float  etof(entity ent) = #79;
+entity         ftoe(float num)  = #80;
+float   validstring(string str) = #81;
+float  altstr_count(string str) = #82;
+string  altstr_prepare(string str) = #83;
+string  altstr_get(string str, float num) = #84;
+string  altstr_set(string str, float num, string set) = #85;
+string         altstr_ins(string str, float num, string set) = #86;
+float  isdemo() = #349;
+float  drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #469;
+//vector       getresolution(float number, ...) = #608; // optional argument "isfullscreen"
+void   parseentitydata(entity ent, string data) = #613;
+void   resethostcachemasks(void) = #615;
+void   sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
+void   sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
+void   resorthostcache(void) = #618;
+float SLSF_DESCENDING = 1;
+float SLSF_FAVORITES = 2;
+float SLSF_CATEGORIES = 4;
+void   sethostcachesort(float fld, float slsf) = #619;
+void   refreshhostcache(...) = #620;  // optional boolean argument "clear_list"
+float  gethostcachenumber(float fld, float hostnr) = #621;
+float  gethostcacheindexforkey(string key) = #622;
+void   addwantedhostcachekey(string key) = #623;
+string getextresponse(void) = #624;
+const string cvar_string(string name) = #71;
+const string cvar_defstring(string name) = #89;
+float  stringwidth(string text, float handleColors, vector size) = #468;
diff --git a/qcsrc/dpdefs/upstream/progsdefs.qc b/qcsrc/dpdefs/upstream/progsdefs.qc
new file mode 100644 (file)
index 0000000..2ccd843
--- /dev/null
@@ -0,0 +1,507 @@
+/*
+==============================================================================
+
+                       SOURCE FOR GLOBALVARS_T C STRUCTURE
+                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity         self;
+entity         other;
+entity         world;
+float          time;
+float          frametime;
+
+float          force_retouch;          // force all entities to touch triggers
+                                                               // next frame.  this is needed because
+                                                               // non-moving things don't normally scan
+                                                               // for triggers, and when a trigger is
+                                                               // created (like a teleport trigger), it
+                                                               // needs to catch everything.
+                                                               // decremented each frame, so set to 2
+                                                               // to guarantee everything is touched
+string         mapname;
+
+float          deathmatch;
+float          coop;
+float          teamplay;
+
+float          serverflags;            // propagated from level to level, used to
+                                                               // keep track of completed episodes
+
+float          total_secrets;
+float          total_monsters;
+
+float          found_secrets;          // number of secrets found
+float          killed_monsters;        // number of monsters killed
+
+
+// spawnparms are used to encode information about clients across server
+// level changes
+float          parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
+
+//
+// global variables set by built in functions
+//
+vector         v_forward, v_up, v_right;       // set by makevectors()
+
+// set by traceline / tracebox
+float          trace_allsolid;
+float          trace_startsolid;
+float          trace_fraction;
+vector         trace_endpos;
+vector         trace_plane_normal;
+float          trace_plane_dist;
+entity         trace_ent;
+float          trace_inopen;
+float          trace_inwater;
+
+entity         msg_entity;                             // destination of single entity writes
+
+//
+// required prog functions
+//
+void()                 main;                                           // only for testing
+
+void()         StartFrame;
+
+void()                 PlayerPreThink;
+void()                 PlayerPostThink;
+
+void()         ClientKill;
+void()         ClientConnect;
+void()                 PutClientInServer;              // call after setting the parm1... parms
+void()         ClientDisconnect;
+
+void()         SetNewParms;                    // called when a client first connects to
+                                                                       // a server. sets parms so they can be
+                                                                       // saved off for restarts
+
+void()         SetChangeParms;                 // call to set parms for self so they can
+                                                                       // be saved for a level transition
+
+
+//================================================
+void           end_sys_globals;                // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+                       SOURCE FOR ENTVARS_T C STRUCTURE
+                       MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float         modelindex;             // *** model index in the precached list
+.vector                absmin, absmax; // *** origin + mins / maxs
+
+.float         ltime;                  // local time for entity
+.float         movetype;
+.float         solid;
+
+.vector                origin;                 // ***
+.vector                oldorigin;              // ***
+.vector                velocity;
+.vector                angles;
+.vector                avelocity;
+
+.vector                punchangle;             // temp angle adjust from damage or recoil
+
+.string                classname;              // spawn function
+.string                model;
+.float         frame;
+.float         skin;
+.float         effects;
+
+.vector                mins, maxs;             // bounding box extents reletive to origin
+.vector                size;                   // maxs - mins
+
+.void()                touch;
+.void()                use;
+.void()                think;
+.void()                blocked;                // for doors or plats, called when can't push other
+
+.float         nextthink;
+.entity                groundentity;
+
+// stats
+.float         health;
+.float         frags;
+.float         weapon;                 // one of the IT_SHOTGUN, etc flags
+.string                weaponmodel;
+.float         weaponframe;
+.float         currentammo;
+.float         ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
+
+.float         items;                  // bit flags
+
+.float         takedamage;
+.entity                chain;
+.float         deadflag;
+
+.vector                view_ofs;                       // add to origin to get eye point
+
+
+.float         button0;                // fire
+.float         button1;                // use
+.float         button2;                // jump
+
+.float         impulse;                // weapon changes
+
+.float         fixangle;
+.vector                v_angle;                // view / targeting angle for players
+.float         idealpitch;             // calculated pitch angle for lookup up slopes
+
+
+.string                netname;
+
+.entity        enemy;
+
+.float         flags;
+
+.float         colormap;
+.float         team;
+
+.float         max_health;             // players maximum health is stored here
+
+.float         teleport_time;  // don't back up
+
+.float         armortype;              // save this fraction of incoming damage
+.float         armorvalue;
+
+.float         waterlevel;             // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
+.float         watertype;              // a contents value
+
+.float         ideal_yaw;
+.float         yaw_speed;
+
+.entity                aiment;
+
+.entity        goalentity;             // a movetarget or an enemy
+
+.float         spawnflags;
+
+.string                target;
+.string                targetname;
+
+// damage is accumulated through a frame. and sent as one single
+// message, so the super shotgun doesn't generate huge messages
+.float         dmg_take;
+.float         dmg_save;
+.entity                dmg_inflictor;
+
+.entity                owner;          // who launched a missile
+.vector                movedir;        // mostly for doors, but also used for waterjump
+
+.string                message;                // trigger messages
+
+.float         sounds;         // either a cd track number or sound number
+
+.string                noise, noise1, noise2, noise3;  // contains names of wavs to play
+
+//================================================
+void           end_sys_fields;                 // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+                               CONSTANT DEFINITIONS
+
+==============================================================================
+*/
+
+
+//
+// constants
+//
+
+float  FALSE                                   = 0;
+float  TRUE                                    = 1;
+
+// edict.flags
+float  FL_FLY                                  = 1;
+float  FL_SWIM                                 = 2;
+float  FL_CLIENT                               = 8;    // set for all client edicts
+float  FL_INWATER                              = 16;   // for enter / leave water splash
+float  FL_MONSTER                              = 32;
+float  FL_GODMODE                              = 64;   // player cheat
+float  FL_NOTARGET                             = 128;  // player cheat
+float  FL_ITEM                                 = 256;  // extra wide size for bonus items
+float  FL_ONGROUND                             = 512;  // standing on something
+float  FL_PARTIALGROUND                = 1024; // not all corners are valid
+float  FL_WATERJUMP                    = 2048; // player jumping out of water
+float  FL_JUMPRELEASED                 = 4096; // for jump debouncing
+
+// edict.movetype values
+float  MOVETYPE_NONE                   = 0;    // never moves
+//float        MOVETYPE_ANGLENOCLIP    = 1;
+//float        MOVETYPE_ANGLECLIP              = 2;
+float  MOVETYPE_WALK                   = 3;    // players only
+float  MOVETYPE_STEP                   = 4;    // discrete, not real time unless fall
+float  MOVETYPE_FLY                    = 5;
+float  MOVETYPE_TOSS                   = 6;    // gravity
+float  MOVETYPE_PUSH                   = 7;    // no clip to world, push and crush
+float  MOVETYPE_NOCLIP                 = 8;
+float  MOVETYPE_FLYMISSILE             = 9;    // fly with extra size against monsters
+float  MOVETYPE_BOUNCE                 = 10;
+float  MOVETYPE_BOUNCEMISSILE  = 11;   // bounce with extra size
+
+// edict.solid values
+float  SOLID_NOT                               = 0;    // no interaction with other objects
+float  SOLID_TRIGGER                   = 1;    // touch on edge, but not blocking
+float  SOLID_BBOX                              = 2;    // touch on edge, block
+float  SOLID_SLIDEBOX                  = 3;    // touch on edge, but not an onground
+float  SOLID_BSP                               = 4;    // bsp clip, touch on edge, block
+
+// range values
+float  RANGE_MELEE                             = 0;
+float  RANGE_NEAR                              = 1;
+float  RANGE_MID                               = 2;
+float  RANGE_FAR                               = 3;
+
+// deadflag values
+
+float  DEAD_NO                                 = 0;
+float  DEAD_DYING                              = 1;
+float  DEAD_DEAD                               = 2;
+float  DEAD_RESPAWNABLE                = 3;
+float  DEAD_RESPAWNING                 = 4; // dead, waiting for buttons to be released
+
+// takedamage values
+
+float  DAMAGE_NO                               = 0;
+float  DAMAGE_YES                              = 1;
+float  DAMAGE_AIM                              = 2;
+
+// items
+float  IT_AXE                                  = 4096;
+float  IT_SHOTGUN                              = 1;
+float  IT_SUPER_SHOTGUN                = 2;
+float  IT_NAILGUN                              = 4;
+float  IT_SUPER_NAILGUN                = 8;
+float  IT_GRENADE_LAUNCHER             = 16;
+float  IT_ROCKET_LAUNCHER              = 32;
+float  IT_LIGHTNING                    = 64;
+float  IT_EXTRA_WEAPON                 = 128;
+
+float  IT_SHELLS                               = 256;
+float  IT_NAILS                                = 512;
+float  IT_ROCKETS                              = 1024;
+float  IT_CELLS                                = 2048;
+
+float  IT_ARMOR1                               = 8192;
+float  IT_ARMOR2                               = 16384;
+float  IT_ARMOR3                               = 32768;
+float  IT_SUPERHEALTH                  = 65536;
+
+float  IT_KEY1                                 = 131072;
+float  IT_KEY2                                 = 262144;
+
+float  IT_INVISIBILITY                 = 524288;
+float  IT_INVULNERABILITY              = 1048576;
+float  IT_SUIT                                 = 2097152;
+float  IT_QUAD                                 = 4194304;
+
+// point content values
+
+float  CONTENT_EMPTY                   = -1;
+float  CONTENT_SOLID                   = -2;
+float  CONTENT_WATER                   = -3;
+float  CONTENT_SLIME                   = -4;
+float  CONTENT_LAVA                    = -5;
+float  CONTENT_SKY                             = -6;
+
+float  STATE_TOP               = 0;
+float  STATE_BOTTOM    = 1;
+float  STATE_UP                = 2;
+float  STATE_DOWN              = 3;
+
+vector VEC_ORIGIN = '0 0 0';
+vector VEC_HULL_MIN = '-16 -16 -24';
+vector VEC_HULL_MAX = '16 16 32';
+
+vector VEC_HULL2_MIN = '-32 -32 -24';
+vector VEC_HULL2_MAX = '32 32 64';
+
+// protocol bytes
+float  SVC_TEMPENTITY          = 23;
+float  SVC_KILLEDMONSTER       = 27;
+float  SVC_FOUNDSECRET         = 28;
+float  SVC_INTERMISSION        = 30;
+float  SVC_FINALE                      = 31;
+float  SVC_CDTRACK                     = 32;
+float  SVC_SELLSCREEN          = 33;
+
+
+float  TE_SPIKE                = 0;
+float  TE_SUPERSPIKE   = 1;
+float  TE_GUNSHOT              = 2;
+float  TE_EXPLOSION    = 3;
+float  TE_TAREXPLOSION = 4;
+float  TE_LIGHTNING1   = 5;
+float  TE_LIGHTNING2   = 6;
+float  TE_WIZSPIKE             = 7;
+float  TE_KNIGHTSPIKE  = 8;
+float  TE_LIGHTNING3   = 9;
+float  TE_LAVASPLASH   = 10;
+float  TE_TELEPORT             = 11;
+
+// sound channels
+// channel 0 never willingly overrides
+// other channels (1-7) allways override a playing sound on that channel
+float  CHAN_AUTO               = 0;
+float  CHAN_WEAPON             = 1;
+float  CHAN_VOICE              = 2;
+float  CHAN_ITEM               = 3;
+float  CHAN_BODY               = 4;
+
+float  ATTN_NONE               = 0;
+float  ATTN_NORM               = 1;
+float  ATTN_IDLE               = 2;
+float  ATTN_STATIC             = 3;
+
+// update types
+
+float  UPDATE_GENERAL  = 0;
+float  UPDATE_STATIC   = 1;
+float  UPDATE_BINARY   = 2;
+float  UPDATE_TEMP             = 3;
+
+// entity effects
+
+float  EF_BRIGHTFIELD  = 1;
+float  EF_MUZZLEFLASH  = 2;
+float  EF_BRIGHTLIGHT  = 4;
+float  EF_DIMLIGHT     = 8;
+
+
+// messages
+float  MSG_BROADCAST   = 0;            // unreliable to all
+float  MSG_ONE                 = 1;            // reliable to one (msg_entity)
+float  MSG_ALL                 = 2;            // reliable to all
+float  MSG_INIT                = 3;            // write to the init string
+
+//===========================================================================
+
+//
+// builtin functions
+//
+
+void(vector ang)       makevectors             = #1;           // sets v_forward, etc globals
+void(entity e, vector o) setorigin     = #2;
+void(entity e, string m) setmodel      = #3;           // set movetype and solid first
+void(entity e, vector min, vector max) setsize = #4;
+// #5 was removed
+void() break_to_debugger                                               = #6;
+float() random                                         = #7;           // returns 0 - 1
+void(entity e, float chan, string samp, float vol, float atten) sound = #8;
+vector(vector v) normalize                     = #9;
+void(string e, ...) error                              = #10;
+void(string e, ...) objerror                           = #11;
+float(vector v) vlen                           = #12;
+float(vector v) vectoyaw                       = #13;
+entity() spawn                                         = #14;
+void(entity e) remove                          = #15;
+
+// sets trace_* globals
+// nomonsters can be:
+// An entity will also be ignored for testing if forent == test,
+// forent->owner == test, or test->owner == forent
+// a forent of world is ignored
+void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
+
+entity() checkclient                           = #17;  // returns a client to look for
+entity(entity start, .string fld, string match) find = #18;
+string(string s) precache_sound                = #19;
+string(string s) precache_model                = #20;
+void(entity client, string s, ...)stuffcmd = #21;
+entity(vector org, float rad) findradius = #22;
+void(string s, ...) bprint                             = #23;
+void(entity client, string s, ...) sprint = #24;
+void(string s, ...) dprint                             = #25;
+string(float f) ftos                           = #26;
+string(vector v) vtos                          = #27;
+void() coredump                                                = #28;          // prints all edicts
+void() traceon                                         = #29;          // turns statment trace on
+void() traceoff                                                = #30;
+void(entity e) eprint                          = #31;          // prints an entire edict
+float(float yaw, float dist) walkmove  = #32;  // returns TRUE or FALSE
+// #33 was removed
+float() droptofloor= #34;      // TRUE if landed on floor
+void(float style, string value) lightstyle = #35;
+float(float v) rint                                    = #36;          // round to nearest int
+float(float v) floor                           = #37;          // largest integer <= v
+float(float v) ceil                                    = #38;          // smallest integer >= v
+// #39 was removed
+float(entity e) checkbottom                    = #40;          // true if self is on ground
+float(vector v) pointcontents          = #41;          // returns a CONTENT_*
+// #42 was removed
+float(float f) fabs = #43;
+vector(entity e, float speed) aim = #44;               // returns the shooting vector
+float(string s) cvar = #45;                                            // return cvar.value
+void(string s, ...) localcmd = #46;                                    // put string into local que
+entity(entity e) nextent = #47;                                        // for looping through all ents
+void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
+void() ChangeYaw = #49;                                                // turn towards self.ideal_yaw
+                                                                                       // at self.yaw_speed
+// #50 was removed
+vector(vector v) vectoangles                   = #51;
+
+//
+// direct client message generation
+//
+void(float to, float f) WriteByte              = #52;
+void(float to, float f) WriteChar              = #53;
+void(float to, float f) WriteShort             = #54;
+void(float to, float f) WriteLong              = #55;
+void(float to, float f) WriteCoord             = #56;
+void(float to, float f) WriteAngle             = #57;
+void(float to, string s, ...) WriteString      = #58;
+void(float to, entity s) WriteEntity   = #59;
+
+//
+// broadcast client message generation
+//
+
+// void(float f) bWriteByte            = #59;
+// void(float f) bWriteChar            = #60;
+// void(float f) bWriteShort           = #61;
+// void(float f) bWriteLong            = #62;
+// void(float f) bWriteCoord           = #63;
+// void(float f) bWriteAngle           = #64;
+// void(string s) bWriteString = #65;
+// void(entity e) bWriteEntity = #66;
+
+void(float step) movetogoal                            = #67;
+
+string(string s) precache_file         = #68;  // no effect except for -copy
+void(entity e) makestatic              = #69;
+void(string s) changelevel = #70;
+
+//#71 was removed
+
+void(string var, string val) cvar_set = #72;   // sets cvar.value
+
+void(entity client, string s, ...) centerprint = #73;  // sprint, but in middle
+
+void(vector pos, string samp, float vol, float atten) ambientsound = #74;
+
+string(string s) precache_model2       = #75;          // registered version only
+string(string s) precache_sound2       = #76;          // registered version only
+string(string s) precache_file2                = #77;          // registered version only
+
+void(entity e) setspawnparms           = #78;          // set parm1... to the
+                                                                                               // values at level start
+                                                                                               // for coop respawn
+
+//============================================================================
diff --git a/qcsrc/menu/_all.qh b/qcsrc/menu/_all.qh
new file mode 100644 (file)
index 0000000..cc07017
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef CLIENT___H
+#define CLIENT___H
+
+#include "../dpdefs/menudefs.qh"
+#include "../dpdefs/keycodes.qh"
+
+#endif
index 26b01d71801f3555fa7cc5f0b329c833a5752848..3039d85b8daff86bcc48ccac4d5a38b64f7eb864 100644 (file)
@@ -1,5 +1,8 @@
-#ifdef INTERFACE
-CLASS(Animation) EXTENDS(Object)
+#ifndef ANIM_ANIMATION_H
+#define ANIM_ANIMATION_H
+#include "../oo/base.qh"
+void setterDummy(entity, float);
+CLASS(Animation, Object)
        METHOD(Animation, configureAnimation, void(entity, entity, void(entity, float), float, float, float, float))
        METHOD(Animation, setTimeStartEnd, void(entity, float, float))
        METHOD(Animation, setTimeStartDuration, void(entity, float, float))
@@ -23,7 +26,6 @@ CLASS(Animation) EXTENDS(Object)
        ATTRIB(Animation, stopped, float, false)
        ATTRIB(Animation, finished, float, false)
 ENDCLASS(Animation)
-void setterDummy(entity, float);
 #endif
 
 #ifdef IMPLEMENTATION
index c46334d530aed763cd3e0c8706e387131e0d1730..61a040cff96801d4345b5cd27bd12002d6d0382a 100644 (file)
@@ -1,7 +1,9 @@
 #include "../menu.qh"
 
-#ifdef INTERFACE
-CLASS(AnimHost) EXTENDS(Object)
+#ifndef ANIM_ANIMHOST_H
+#define ANIM_ANIMHOST_H
+#include "../oo/base.qh"
+CLASS(AnimHost, Object)
        METHOD(AnimHost, addAnim, void(entity, entity))
        METHOD(AnimHost, removeAnim, void(entity, entity))
        METHOD(AnimHost, removeAllAnim, void(entity))
index 94ea9cf0872da839e836be94e28cda460f029bab..fe4c0fb65a9e0cbb1134bcef1300c5069075c698 100644 (file)
@@ -1,15 +1,17 @@
-#ifdef INTERFACE
-CLASS(Easing) EXTENDS(Animation)
-       METHOD(Easing, calcValue, float(entity, float, float, float, float))
-       METHOD(Easing, setMath, void(entity, float(float, float, float, float)))
-       ATTRIB(Easing, math, float(float, float, float, float), easingLinear)
-ENDCLASS(Easing)
+#ifndef ANIM_EASING_H
+#define ANIM_EASING_H
+#include "animation.qc"
 entity makeHostedEasing(entity, void(entity, float), float(float, float, float, float), float, float, float);
 entity makeEasing(entity, void(entity, float), float(float, float, float, float), float, float, float, float);
 float easingLinear(float, float, float, float);
 float easingQuadIn(float, float, float, float);
 float easingQuadOut(float, float, float, float);
 float easingQuadInOut(float, float, float, float);
+CLASS(Easing, Animation)
+       METHOD(Easing, calcValue, float(entity, float, float, float, float))
+       METHOD(Easing, setMath, void(entity, float(float, float, float, float)))
+       ATTRIB(Easing, math, float(float, float, float, float), easingLinear)
+ENDCLASS(Easing)
 #endif
 
 #ifdef IMPLEMENTATION
@@ -24,7 +26,7 @@ entity makeHostedEasing(entity obj, void(entity, float) objSetter, float(float,
 entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
 {
        entity me;
-       me = spawnEasing();
+       me = NEW(Easing);
        me.configureAnimation(me, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
        me.setMath(me, func);
        return me;
index 3bcda94e692939b733c668cf09e46b27e59364c6..d310ef72c7093c7eabd56045b7ab7506a5731738 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Keyframe) EXTENDS(Animation)
+#ifndef ANIM_KEYFRAME_H
+#define ANIM_KEYFRAME_H
+#include "animation.qc"
+CLASS(Keyframe, Animation)
        METHOD(Keyframe, addEasing, entity(entity, float, float, float(float, float, float, float)))
        METHOD(Keyframe, addAnim, void(entity, entity))
        METHOD(Keyframe, calcValue, float(entity, float, float, float, float))
@@ -26,7 +28,7 @@ entity makeHostedKeyframe(entity obj, void(entity, float) objSetter, float animD
 entity makeKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
 {
        entity me;
-       me = spawnKeyframe();
+       me = NEW(Keyframe);
        me.configureAnimation(me, obj, objSetter, time, animDuration, animStart, animEnd);
        return me;
 }
diff --git a/qcsrc/menu/classes.inc b/qcsrc/menu/classes.inc
new file mode 100644 (file)
index 0000000..68b90d5
--- /dev/null
@@ -0,0 +1,132 @@
+#include "anim/animation.qc"
+#include "anim/animhost.qc"
+#include "anim/easing.qc"
+#include "anim/keyframe.qc"
+
+#include "item.qc"
+#include "item/borderimage.qc"
+#include "item/button.qc"
+#include "item/checkbox.qc"
+#include "item/container.qc"
+#include "item/dialog.qc"
+#include "item/image.qc"
+#include "item/inputbox.qc"
+#include "item/inputcontainer.qc"
+#include "item/label.qc"
+#include "item/listbox.qc"
+#include "item/modalcontroller.qc"
+#include "item/nexposee.qc"
+#include "item/radiobutton.qc"
+#include "item/slider.qc"
+#include "item/tab.qc"
+#include "item/textslider.qc"
+
+#include "xonotic/bigbutton.qc"
+#include "xonotic/bigcommandbutton.qc"
+#include "xonotic/button.qc"
+#include "xonotic/campaign.qc"
+#include "xonotic/charmap.qc"
+#include "xonotic/checkbox.qc"
+#include "xonotic/checkbox_slider_invalid.qc"
+#include "xonotic/checkbox_string.qc"
+#include "xonotic/colorbutton.qc"
+#include "xonotic/colorpicker.qc"
+#include "xonotic/colorpicker_string.qc"
+#include "xonotic/commandbutton.qc"
+#include "xonotic/credits.qc"
+#include "xonotic/crosshairbutton.qc"
+#include "xonotic/cvarlist.qc"
+#include "xonotic/demolist.qc"
+#include "xonotic/dialog.qc"
+#include "xonotic/dialog_credits.qc"
+#include "xonotic/dialog_firstrun.qc"
+#include "xonotic/dialog_hudpanel_ammo.qc"
+#include "xonotic/dialog_hudpanel_buffs.qc"
+#include "xonotic/dialog_hudpanel_centerprint.qc"
+#include "xonotic/dialog_hudpanel_chat.qc"
+#include "xonotic/dialog_hudpanel_engineinfo.qc"
+#include "xonotic/dialog_hudpanel_healtharmor.qc"
+#include "xonotic/dialog_hudpanel_infomessages.qc"
+#include "xonotic/dialog_hudpanel_modicons.qc"
+#include "xonotic/dialog_hudpanel_notification.qc"
+#include "xonotic/dialog_hudpanel_physics.qc"
+#include "xonotic/dialog_hudpanel_powerups.qc"
+#include "xonotic/dialog_hudpanel_pressedkeys.qc"
+#include "xonotic/dialog_hudpanel_racetimer.qc"
+#include "xonotic/dialog_hudpanel_radar.qc"
+#include "xonotic/dialog_hudpanel_score.qc"
+#include "xonotic/dialog_hudpanel_timer.qc"
+#include "xonotic/dialog_hudpanel_vote.qc"
+#include "xonotic/dialog_hudpanel_weapons.qc"
+#include "xonotic/dialog_hudsetup_exit.qc"
+#include "xonotic/dialog_monstertools.qc"
+#include "xonotic/dialog_multiplayer.qc"
+#include "xonotic/dialog_multiplayer_create.qc"
+#include "xonotic/dialog_multiplayer_create_mapinfo.qc"
+#include "xonotic/dialog_multiplayer_create_mutators.qc"
+#include "xonotic/dialog_multiplayer_join.qc"
+#include "xonotic/dialog_multiplayer_join_serverinfo.qc"
+#include "xonotic/dialog_multiplayer_media.qc"
+#include "xonotic/dialog_multiplayer_media_demo.qc"
+#include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
+#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
+#include "xonotic/dialog_multiplayer_media_musicplayer.qc"
+#include "xonotic/dialog_multiplayer_media_screenshot.qc"
+#include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
+#include "xonotic/dialog_multiplayer_profile.qc"
+#include "xonotic/dialog_quit.qc"
+#include "xonotic/dialog_sandboxtools.qc"
+#include "xonotic/dialog_settings.qc"
+#include "xonotic/dialog_settings_audio.qc"
+#include "xonotic/dialog_settings_effects.qc"
+#include "xonotic/dialog_settings_game.qc"
+#include "xonotic/dialog_settings_game_crosshair.qc"
+#include "xonotic/dialog_settings_game_hudconfirm.qc"
+#include "xonotic/dialog_settings_game_hud.qc"
+#include "xonotic/dialog_settings_game_messages.qc"
+#include "xonotic/dialog_settings_game_model.qc"
+#include "xonotic/dialog_settings_game_view.qc"
+#include "xonotic/dialog_settings_game_weapons.qc"
+#include "xonotic/dialog_settings_input.qc"
+#include "xonotic/dialog_settings_input_userbind.qc"
+#include "xonotic/dialog_settings_misc.qc"
+#include "xonotic/dialog_settings_misc_cvars.qc"
+#include "xonotic/dialog_settings_misc_reset.qc"
+#include "xonotic/dialog_settings_user.qc"
+#include "xonotic/dialog_settings_user_languagewarning.qc"
+#include "xonotic/dialog_settings_video.qc"
+#include "xonotic/dialog_singleplayer.qc"
+#include "xonotic/dialog_singleplayer_winner.qc"
+#include "xonotic/dialog_teamselect.qc"
+#include "xonotic/gametypelist.qc"
+#include "xonotic/image.qc"
+#include "xonotic/inputbox.qc"
+#include "xonotic/keybinder.qc"
+#include "xonotic/languagelist.qc"
+#include "xonotic/listbox.qc"
+#include "xonotic/mainwindow.qc"
+#include "xonotic/maplist.qc"
+#include "xonotic/nexposee.qc"
+#include "xonotic/playerlist.qc"
+#include "xonotic/playermodel.qc"
+#include "xonotic/playlist.qc"
+#include "xonotic/radiobutton.qc"
+#include "xonotic/rootdialog.qc"
+#include "xonotic/screenshotimage.qc"
+#include "xonotic/screenshotlist.qc"
+#include "xonotic/serverlist.qc"
+#include "xonotic/skinlist.qc"
+#include "xonotic/slider.qc"
+#include "xonotic/slider_decibels.qc"
+#include "xonotic/slider_particles.qc"
+#include "xonotic/slider_picmip.qc"
+#include "xonotic/slider_resolution.qc"
+#include "xonotic/slider_sbfadetime.qc"
+#include "xonotic/soundlist.qc"
+#include "xonotic/statslist.qc"
+#include "xonotic/tabcontroller.qc"
+#include "xonotic/tab.qc"
+#include "xonotic/textlabel.qc"
+#include "xonotic/textslider.qc"
+#include "xonotic/weaponarenacheckbox.qc"
+#include "xonotic/weaponslist.qc"
diff --git a/qcsrc/menu/classes.qc b/qcsrc/menu/classes.qc
deleted file mode 100644 (file)
index 9b4bb4d..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "anim/animhost.qc"
-#include "anim/animation.qc"
-#include "anim/easing.qc"
-#include "anim/keyframe.qc"
-#include "item.qc"
-#include "item/container.qc"
-#include "item/inputcontainer.qc"
-#include "item/nexposee.qc"
-#include "item/modalcontroller.qc"
-#include "item/image.qc"
-#include "item/label.qc"
-#include "item/button.qc"
-#include "item/checkbox.qc"
-#include "item/radiobutton.qc"
-#include "item/borderimage.qc"
-#include "item/slider.qc"
-#include "item/dialog.qc"
-#include "item/tab.qc"
-#include "item/textslider.qc"
-#include "item/listbox.qc"
-#include "item/inputbox.qc"
-#include "xonotic/dialog.qc"
-#include "xonotic/tab.qc"
-#include "xonotic/mainwindow.qc"
-#include "xonotic/button.qc"
-#include "xonotic/bigbutton.qc"
-#include "xonotic/commandbutton.qc"
-#include "xonotic/bigcommandbutton.qc"
-#include "xonotic/textlabel.qc"
-#include "xonotic/dialog_firstrun.qc"
-#include "xonotic/dialog_teamselect.qc"
-#include "xonotic/dialog_sandboxtools.qc"
-#include "xonotic/dialog_monstertools.qc"
-#include "xonotic/dialog_settings.qc"
-#include "xonotic/dialog_settings_video.qc"
-#include "xonotic/dialog_settings_effects.qc"
-#include "xonotic/dialog_settings_audio.qc"
-#include "xonotic/dialog_settings_game.qc"
-#include "xonotic/dialog_settings_user.qc"
-#include "xonotic/dialog_settings_user_languagewarning.qc"
-#include "xonotic/dialog_settings_misc.qc"
-#include "xonotic/dialog_multiplayer.qc"
-#include "xonotic/dialog_multiplayer_profile.qc"
-#include "xonotic/tabcontroller.qc"
-#include "xonotic/slider.qc"
-#include "xonotic/slider_resolution.qc"
-#include "xonotic/checkbox.qc"
-#include "xonotic/checkbox_string.qc"
-#include "xonotic/weaponarenacheckbox.qc"
-#include "xonotic/radiobutton.qc"
-#include "xonotic/nexposee.qc"
-#include "xonotic/rootdialog.qc"
-#include "xonotic/textslider.qc"
-#include "xonotic/colorbutton.qc"
-#include "xonotic/dialog_multiplayer_join.qc"
-#include "xonotic/dialog_multiplayer_join_serverinfo.qc"
-#include "xonotic/playerlist.qc"
-#include "xonotic/listbox.qc"
-#include "xonotic/serverlist.qc"
-#include "xonotic/inputbox.qc"
-#include "xonotic/dialog_quit.qc"
-#include "xonotic/dialog_multiplayer_create.qc"
-#include "xonotic/dialog_multiplayer_create_mutators.qc"
-#include "xonotic/dialog_multiplayer_create_mapinfo.qc"
-#include "xonotic/gametypelist.qc"
-#include "xonotic/maplist.qc"
-#include "xonotic/skinlist.qc"
-#include "xonotic/languagelist.qc"
-#include "xonotic/image.qc"
-#include "xonotic/crosshairbutton.qc"
-#include "xonotic/playermodel.qc"
-#include "xonotic/checkbox_slider_invalid.qc"
-#include "xonotic/charmap.qc"
-#include "xonotic/keybinder.qc"
-#include "xonotic/dialog_settings_input.qc"
-#include "xonotic/dialog_settings_input_userbind.qc"
-#include "xonotic/slider_decibels.qc"
-#include "xonotic/dialog_singleplayer.qc"
-#include "xonotic/campaign.qc"
-#include "xonotic/dialog_singleplayer_winner.qc"
-#include "xonotic/dialog_credits.qc"
-#include "xonotic/credits.qc"
-#include "xonotic/dialog_settings_game_crosshair.qc"
-#include "xonotic/dialog_settings_game_hud.qc"
-#include "xonotic/dialog_settings_game_hudconfirm.qc"
-#include "xonotic/dialog_settings_game_model.qc"
-#include "xonotic/dialog_settings_game_messages.qc"
-#include "xonotic/dialog_settings_game_view.qc"
-#include "xonotic/dialog_settings_game_weapons.qc"
-#include "xonotic/weaponslist.qc"
-#include "xonotic/dialog_multiplayer_media.qc"
-#include "xonotic/dialog_multiplayer_media_demo.qc"
-#include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
-#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
-#include "xonotic/demolist.qc"
-#include "xonotic/screenshotimage.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
-#include "xonotic/screenshotlist.qc"
-#include "xonotic/statslist.qc"
-#include "xonotic/dialog_multiplayer_media_musicplayer.qc"
-#include "xonotic/soundlist.qc"
-#include "xonotic/playlist.qc"
-#include "xonotic/colorpicker.qc"
-#include "xonotic/colorpicker_string.qc"
-#include "xonotic/cvarlist.qc"
-#include "xonotic/dialog_settings_misc_cvars.qc"
-#include "xonotic/dialog_hudsetup_exit.qc"
-#include "xonotic/dialog_hudpanel_notification.qc"
-#include "xonotic/dialog_hudpanel_ammo.qc"
-#include "xonotic/dialog_hudpanel_healtharmor.qc"
-#include "xonotic/dialog_hudpanel_powerups.qc"
-#include "xonotic/dialog_hudpanel_racetimer.qc"
-#include "xonotic/dialog_hudpanel_pressedkeys.qc"
-#include "xonotic/dialog_hudpanel_radar.qc"
-#include "xonotic/dialog_hudpanel_score.qc"
-#include "xonotic/dialog_hudpanel_timer.qc"
-#include "xonotic/dialog_hudpanel_vote.qc"
-#include "xonotic/dialog_hudpanel_modicons.qc"
-#include "xonotic/dialog_hudpanel_chat.qc"
-#include "xonotic/dialog_hudpanel_engineinfo.qc"
-#include "xonotic/dialog_hudpanel_infomessages.qc"
-#include "xonotic/dialog_hudpanel_weapons.qc"
-#include "xonotic/dialog_hudpanel_physics.qc"
-#include "xonotic/dialog_hudpanel_centerprint.qc"
-#include "xonotic/dialog_hudpanel_buffs.qc"
-#include "xonotic/slider_picmip.qc"
-#include "xonotic/slider_particles.qc"
-#include "xonotic/slider_sbfadetime.qc"
-#include "xonotic/dialog_settings_misc_reset.qc"
diff --git a/qcsrc/menu/command/commands.qc b/qcsrc/menu/command/commands.qc
new file mode 100644 (file)
index 0000000..5b5911f
--- /dev/null
@@ -0,0 +1,5 @@
+#include "../menu.qh"
+
+#include "../../common/command/commands.qc"
+
+#include "menu_cmd.qc"
diff --git a/qcsrc/menu/command/commands.qh b/qcsrc/menu/command/commands.qh
new file mode 100644 (file)
index 0000000..5ea3006
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef MENU_COMMANDS_H
+#define MENU_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "menu_cmd.qh"
+
+#endif
index 93825cd56098d73e2ebe53aa0aee97041fcaf03c..3f3f72f5753f61a291966d325f64ea0481d53bd3 100644 (file)
@@ -1,7 +1,12 @@
 #include "menu_cmd.qh"
 
+#include "../menu.qh"
+#include "../oo/classes.qc"
+
 #include "../../common/command/generic.qh"
 
+.entity firstChild, nextSibling;
+
 string _dumptree_space;
 void _dumptree_open(entity pass, entity me)
 {
@@ -29,6 +34,8 @@ void _dumptree_close(entity pass, entity me)
        }
 }
 
+float updateConwidths(float width, float height, float pixelheight);
+
 void GameCommand(string theCommand)
 {
        float argc;
index 05e7af227adccb9040870bc7e690e405a7b1d400..2796c05706d0647662ebff6c4dafd88ac5c24b7b 100644 (file)
@@ -1,7 +1,6 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "draw.qh"
+#include "../common/util.qh"
+#include "../common/constants.qh"
 
 string draw_mousepointer;
 vector draw_mousepointer_offset;
index d0bd40b03884c30d4e83c6727e82d89ac23019a3..cb24866d1ffbe198431b7fc414cb0adf650e2452 100644 (file)
@@ -1,5 +1,8 @@
-#ifdef INTERFACE
-CLASS(Item) EXTENDS(Object)
+#ifndef ITEM_H
+#define ITEM_H
+#include "skin.qh"
+#include "oo/base.qh"
+CLASS(Item, Object)
        METHOD(Item, draw, void(entity))
        METHOD(Item, keyDown, float(entity, float, float, float))
        METHOD(Item, keyUp, float(entity, float, float, float))
index e6affc1c03a848c93edbf95e9a9d1b6fe8fccaa8..6b6f4693dc4a48d83823a7144c29f033daacc632 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(BorderImage) EXTENDS(Label)
+#ifndef ITEM_BORDERIMAGE_H
+#define ITEM_BORDERIMAGE_H
+#include "label.qc"
+CLASS(BorderImage, Label)
        METHOD(BorderImage, configureBorderImage, void(entity, string, float, vector, string, float))
        METHOD(BorderImage, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(BorderImage, recalcPositionWithText, void(entity, string))
index 52e58238c86916248549bfb6c87a917913705098..796ce40a3365374b2e870e2fc630a84f250a6fd6 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Button) EXTENDS(Label)
+#ifndef ITEM_BUTTON_H
+#define ITEM_BUTTON_H
+#include "label.qc"
+CLASS(Button, Label)
        METHOD(Button, configureButton, void(entity, string, float, string))
        METHOD(Button, draw, void(entity))
        METHOD(Button, showNotify, void(entity))
index 2540cc846fdbddf80ef44a5d8f4bd022e7f1dee8..e8b4e15e339349ad655af6f866aefccd5eb35796 100644 (file)
@@ -1,6 +1,8 @@
-#ifdef INTERFACE
+#ifndef ITEM_CHECKBOX_H
+#define ITEM_CHECKBOX_H
+#include "button.qc"
 void CheckBox_Click(entity me, entity other);
-CLASS(CheckBox) EXTENDS(Button)
+CLASS(CheckBoxButton)
        METHOD(CheckBox, configureCheckBox, void(entity, string, float, string))
        METHOD(CheckBox, draw, void(entity))
        METHOD(CheckBox, playClickSound, void(entity))
index dc369862f3c8bf61fe9d2584af9263059f11b3f6..449bb0675f773f0e683e9133c8751005d567c99a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Container) EXTENDS(Item)
+#ifndef ITEM_CONTAINER_H
+#define ITEM_CONTAINER_H
+#include "../item.qc"
+CLASS(Container, Item)
        METHOD(Container, draw, void(entity))
        METHOD(Container, keyUp, float(entity, float, float, float))
        METHOD(Container, keyDown, float(entity, float, float, float))
@@ -117,9 +119,9 @@ void Container_resizeNotifyLie(entity me, vector relOrigin, vector relSize, vect
        float d;
        for(e = me.firstChild; e; e = e.nextSibling)
        {
-               o = e.originField;
-               s = e.sizeField;
-               me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha);
+               o = e.(originField);
+               s = e.(sizeField);
+               me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha);
                e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize));
                me.leaveSubitem(me);
        }
@@ -131,9 +133,9 @@ void Container_resizeNotifyLie(entity me, vector relOrigin, vector relSize, vect
                        {
                                e.resized = 0;
                                d = 1;
-                               o = e.originField;
-                               s = e.sizeField;
-                               me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha);
+                               o = e.(originField);
+                               s = e.(sizeField);
+                               me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha);
                                e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize));
                                me.leaveSubitem(me);
                        }
index 2f64c4e9194397c473423d7c3aa01eededed55b4..77037ace61132e48fc3bf57e87f24fc7e249756a 100644 (file)
 //
 // a subclass may help with using this as a tab
 
-#ifdef INTERFACE
-CLASS(Dialog) EXTENDS(InputContainer)
+#ifndef ITEM_DIALOG_H
+#define ITEM_DIALOG_H
+#include "inputcontainer.qc"
+CLASS(Dialog, InputContainer)
        METHOD(Dialog, configureDialog, void(entity)) // no runtime configuration, all parameters are given in the code!
        METHOD(Dialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        METHOD(Dialog, keyDown, float(entity, float, float, float))
@@ -130,7 +132,7 @@ void Dialog_configureDialog(entity me)
 
        if(me.isTabRoot)
        {
-               me.frame = spawnBorderImage();
+               me.frame = NEW(BorderImage);
                me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.borderLines * me.titleHeight);
                me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
                me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
@@ -159,7 +161,7 @@ void Dialog_configureDialog(entity me)
        if(me.isTabRoot && me.closable && me.borderLines > 0)
        {
                entity closebutton;
-               closebutton = me.closeButton = me.frame.closeButton = spawnButton();
+               closebutton = me.closeButton = me.frame.closeButton = NEW(Button);
                closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
                closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
                closebutton.srcMulti = 0;
index b67df840cc7f8e58134592ee4332fdd04370c9d3..7756b4991338ff440342a137dc362553230a9723 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Image) EXTENDS(Item)
+#ifndef ITEM_IMAGE_H
+#define ITEM_IMAGE_H
+#include "../item.qc"
+CLASS(Image, Item)
        METHOD(Image, configureImage, void(entity, string))
        METHOD(Image, draw, void(entity))
        METHOD(Image, toString, string(entity))
index 275b20046def9e411a8211d231fc55a3117e162e..5bcfd5f9c0491f4e2a8a36310f74e805ac5f4b72 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(InputBox) EXTENDS(Label)
+#ifndef ITEM_INPUTBOX_H
+#define ITEM_INPUTBOX_H
+#include "label.qc"
+CLASS(InputBox, Label)
        METHOD(InputBox, configureInputBox, void(entity, string, float, float, string))
        METHOD(InputBox, draw, void(entity))
        METHOD(InputBox, setText, void(entity, string))
index 8c09d1991be2a474eaa0e331918fce0ff3698307..90ca719dce9e25326e54a700df5799f7a5a83189 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(InputContainer) EXTENDS(Container)
+#ifndef ITEM_INPUTCONTAINER_H
+#define ITEM_INPUTCONTAINER_H
+#include "container.qc"
+CLASS(InputContainer, Container)
        METHOD(InputContainer, keyDown, float(entity, float, float, float))
        METHOD(InputContainer, mouseMove, float(entity, vector))
        METHOD(InputContainer, mousePress, float(entity, vector))
index a1769fc03d7ba5ed5235f99bbef65e5437cdc566..75e79f0b228394e3d5da4c0c377992e9a1e12b4b 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Label) EXTENDS(Item)
+#ifndef ITEM_LABEL_H
+#define ITEM_LABEL_H
+#include "../item.qc"
+CLASS(Label, Item)
        METHOD(Label, configureLabel, void(entity, string, float, float))
        METHOD(Label, draw, void(entity))
        METHOD(Label, resizeNotify, void(entity, vector, vector, vector, vector))
index 478a2063ff74f71c7921d505134e0a1578ca500c..044c9e34a0feb71d857d9ebb4b0f48d6cb5969c2 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(ListBox) EXTENDS(Item)
+#ifndef ITEM_LISTBOX_H
+#define ITEM_LISTBOX_H
+#include "../item.qc"
+CLASS(ListBox, Item)
        METHOD(ListBox, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(ListBox, configureListBox, void(entity, float, float))
        METHOD(ListBox, draw, void(entity))
index 3ef656744568ad3b0ebfd25768e5acf3267fbfe5..a13fcdd69f5706d663ea529072735ae0a85c4dcc 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(ModalController) EXTENDS(Container)
+#ifndef ITEM_MODALCONTROLLER_H
+#define ITEM_MODALCONTROLLER_H
+#include "container.qc"
+CLASS(ModalController, Container)
        METHOD(ModalController, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(ModalController, draw, void(entity))
        METHOD(ModalController, showChild, void(entity, entity, vector, vector, float))
index 1413039851ee7fcde86e3869d8778c9d2fc72614..69d54b7a0733e6d6b766f88b385906237e6a4fb7 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Nexposee) EXTENDS(Container)
+#ifndef ITEM_NEXPOSEE_H
+#define ITEM_NEXPOSEE_H
+#include "container.qc"
+CLASS(Nexposee, Container)
        METHOD(Nexposee, draw, void(entity))
        METHOD(Nexposee, keyDown, float(entity, float, float, float))
        METHOD(Nexposee, keyUp, float(entity, float, float, float))
@@ -23,7 +25,6 @@ CLASS(Nexposee) EXTENDS(Container)
 ENDCLASS(Nexposee)
 
 void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the current state
-#endif
 
 // animation states:
 //   0 = thumbnails seen
@@ -31,9 +32,6 @@ void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the c
 //   2 = zoomed in
 //   3 = zooming out
 // animation factor: 0 = minimum theSize, 1 = maximum theSize
-
-#ifdef IMPLEMENTATION
-
 .vector Nexposee_initialSize;
 .vector Nexposee_initialFontScale;
 .vector Nexposee_initialOrigin;
@@ -47,6 +45,9 @@ void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the c
 .vector Nexposee_align;
 .float Nexposee_animationFactor;
 
+#endif
+
+#ifdef IMPLEMENTATION
 void Nexposee_close(entity me)
 {
        // user must override this
index 80fd5329b41f70f2dedab6ced75caea971e58284..c1e034855aeaa2cc7992ddea2373ff9ae79fa06e 100644 (file)
@@ -1,6 +1,8 @@
-#ifdef INTERFACE
+#ifndef ITEM_RADIOBUTTON_H
+#define ITEM_RADIOBUTTON_H
+#include "checkbox.qc"
 void RadioButton_Click(entity me, entity other);
-CLASS(RadioButton) EXTENDS(CheckBox)
+CLASS(RadioButtonCheckBox)
        METHOD(RadioButton, configureRadioButton, void(entity, string, float, string, float, float))
        ATTRIB(RadioButton, checked, float, 0)
        ATTRIB(RadioButton, group, float, 0)
index 2c74f6131c8f06e40e4a530bcb3720e2e2612613..e944a96aea18f010c7a6e3dd5b25ddc8ec15cfbf 100644 (file)
@@ -1,7 +1,9 @@
 // Note:
 //   to use this, you FIRST call configureSliderVisuals, then configureSliderValues
-#ifdef INTERFACE
-CLASS(Slider) EXTENDS(Label)
+#ifndef ITEM_SLIDER_H
+#define ITEM_SLIDER_H
+#include "label.qc"
+CLASS(Slider, Label)
        METHOD(Slider, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(Slider, configureSliderVisuals, void(entity, float, float, float, string))
        METHOD(Slider, configureSliderValues, void(entity, float, float, float, float, float, float))
index 8cd72ba9c76a253b73001f2b1a32e3b95d23bf89..fbbf77668750c26a27b5e1b1e018e0805d0cb822 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(Tab) EXTENDS(Dialog)
+#ifndef ITEM_TAB_H
+#define ITEM_TAB_H
+#include "dialog.qc"
+CLASS(Tab, Dialog)
        ATTRIB(Tab, isTabRoot, float, 0)
        ATTRIB(Tab, closable, float, 0)
        ATTRIB(Tab, rootDialog, float, 0)
index 93d4090e02f762e3c2269683e795fb4ba716204b..f22e632d6f03f9973b47540bbbcfe69975e8f22c 100644 (file)
@@ -1,7 +1,9 @@
 // Note:
 //   to use this, you FIRST call configureSliderVisuals, then multiple times addValue, then configureTextSlider
-#ifdef INTERFACE
-CLASS(TextSlider) EXTENDS(Slider)
+#ifndef ITEM_TEXTSLIDER_H
+#define ITEM_TEXTSLIDER_H
+#include "slider.qc"
+CLASS(TextSlider, Slider)
        METHOD(TextSlider, valueToText, string(entity, float))
        METHOD(TextSlider, valueToIdentifier, string(entity, float))
        METHOD(TextSlider, setValueFromIdentifier, void(entity, string))
index a2c2c941320c1ff6dbb2bc80cc024b64b34c05fb..669e08fe726dbed788ad2cd7e363d4a31e4edb9f 100644 (file)
@@ -1,7 +1,9 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "menu.qh"
+#include "oo/classes.qc"
+#include "xonotic/util.qh"
+
+#include "../common/weapons/weapons.qh"
+#include "../common/mapinfo.qh"
 
 ///////////////////////////////////////////////
 // Menu Source File
@@ -211,8 +213,8 @@ void m_init_delayed()
        draw_setMousePointer(SKINGFX_CURSOR, SKINSIZE_CURSOR, SKINOFFSET_CURSOR);
 
        loadTooltips();
-       anim = spawnAnimHost();
-       main = spawnMainWindow(); main.configureMainWindow(main);
+       anim = NEW(AnimHost);
+       main = NEW(MainWindow); main.configureMainWindow(main);
        unloadTooltips();
 
        main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
index 00f6017aa06b3bdf4b2143fbd132cd4dac4885e3..020a65a20c318ac1cf8f1bbf5e1625759aa30cc2 100644 (file)
@@ -14,9 +14,6 @@
 
 #define localcmd cmd
 
-#define NULL (null_entity)
-#define world NULL
-
 // constants
 
 const int GAME_ISSERVER        = 1;
@@ -53,6 +50,8 @@ void postMenuDraw(); // this is run just after the menu is drawn (or not). Usefu
 
 void m_sync();
 
+void draw_reset_cropped();
+
 // sounds
 
 const string MENU_SOUND_CLEAR   = "sound/menu/clear.wav";
index 55af8adb84cfa4ddbba23e7eb60f4089be48a557..5c74f0d6dffaca4a914b2ea2aedeceb5d7d4ef6b 100644 (file)
@@ -1,31 +1,71 @@
 #ifndef BASE_H
 #define BASE_H
 
+#include "../../common/util.qh"
+#include "../../dpdefs/keycodes.qh"
+
+#define NULL (null_entity)
+#define world NULL
+
 .string classname;
-entity Object_vtbl;
 .string vtblname;
 .entity vtblbase;
-// THIS LINE INTENTIONALLY LEFT BLANK
-entity spawnVtbl(entity e, entity b)
+entity spawnVtbl(entity this, entity base)
 {
-       entity v;
-       v = spawn();
-       copyentity(e, v);
-       v.vtblname = v.classname;
-       v.classname = "vtbl";
-       if(b)
-               v.vtblbase = b;
-       else
-               v.vtblbase = v;
-       return v;
+       entity vtbl = spawn();
+       copyentity(this, vtbl);
+       vtbl.vtblname = vtbl.classname;
+       vtbl.classname = "vtbl";
+       vtbl.vtblbase = base ? base : vtbl; // Top level objects use vtbl as base
+       return vtbl;
 }
-entity spawnObject()
+
+entity Object_vtbl;
+entity spawnObject(entity this, entity)
 {
-       entity e;
-       e = spawn();
-       e.classname = "Object";
-       if(!Object_vtbl)
-               Object_vtbl = spawnVtbl(e, null_entity);
-       return e;
+       this = spawn();
+       this.classname = "Object";
+       if (!Object_vtbl) Object_vtbl = spawnVtbl(this, null_entity);
+       return this;
+}
+
+// Classes have a `spawn##cname(entity, entity)` constructor
+// The parameters are used as locals for [[accumulate]]
+
+// Macro to hide this implementation detail
+#define NEW(cname) (spawn##cname(null_entity, null_entity))
+
+#define CLASS(cname, base)                                          \
+entity spawn##cname(entity this, entity basevtbl) {                 \
+    this = NEW(base); basevtbl = base##_vtbl;                       \
 }
-#endif
+
+#define METHOD(cname, name, prototype)                              \
+prototype cname##_##name;                                           \
+.prototype name;                                                    \
+[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
+    this.name = cname##_##name;                                     \
+}
+
+#define ATTRIB(cname, name, type, val)                              \
+.type name;                                                         \
+[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
+    this.name = val;                                                \
+}
+
+#define ATTRIBARRAY(cname, name, type, cnt)                         \
+.type name[cnt];
+
+#define ENDCLASS(cname)                                             \
+.bool instanceOf##cname;                                            \
+entity cname##_vtbl;                                                \
+[[last]] entity spawn##cname(entity this, entity basevtbl) {        \
+    this.instanceOf##cname = true;                                  \
+    this.classname = #cname;                                        \
+    if (!cname##_vtbl) cname##_vtbl = spawnVtbl(this, basevtbl);    \
+    return this;                                                    \
+}
+
+#define SUPER(cname) (cname##_vtbl.vtblbase)
+
+#endif
\ No newline at end of file
diff --git a/qcsrc/menu/oo/classes.qc b/qcsrc/menu/oo/classes.qc
new file mode 100644 (file)
index 0000000..2170a83
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef CLASSES_H
+#define CLASSES_H
+#include "base.qh"
+
+#include "../classes.inc"
+#define IMPLEMENTATION
+#include "../classes.inc"
+
+#endif
diff --git a/qcsrc/menu/oo/implementation.qh b/qcsrc/menu/oo/implementation.qh
deleted file mode 100644 (file)
index 42a74be..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef IMPLEMENTATION_H
-#define IMPLEMENTATION_H
-
-#ifndef INTERFACE
-#define INTERFACE
-#endif
-
-#ifndef IMPLEMENTATION
-#define IMPLEMENTATION
-#endif
-
-#ifdef CLASS
-#undef CLASS
-#undef EXTENDS
-#undef METHOD
-#undef ATTRIB
-#undef ATTRIBARRAY
-#undef ENDCLASS
-#undef SUPER
-#endif
-
-// for the constructor
-#define CLASS(cname)                       entity spawn##cname() { entity me;
-#define EXTENDS(base)                      me = spawn##base (); entity basevtbl; basevtbl = base##_vtbl;
-#define METHOD(cname,name,prototype)       me.name = cname##_##name;
-#define ATTRIB(cname,name,type,val)        me.name = val;
-#define ATTRIBARRAY(cname,name,type,cnt)
-#define ENDCLASS(cname)                    me.instanceOf##cname = 1; me.classname = #cname; if(!cname##_vtbl) cname##_vtbl = spawnVtbl(me, basevtbl); return me; }
-
-// for the implementation
-#define SUPER(cname) (cname##_vtbl.vtblbase)
-#endif
diff --git a/qcsrc/menu/oo/interface.qh b/qcsrc/menu/oo/interface.qh
deleted file mode 100644 (file)
index e24bb3f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef INTERFACE_H
-#define INTERFACE_H
-
-#ifndef INTERFACE
-#define INTERFACE
-#endif
-
-#ifdef IMPLEMENTATION
-#undef IMPLEMENTATION
-#endif
-
-#ifdef CLASS
-#undef CLASS
-#undef EXTENDS
-#undef METHOD
-#undef ATTRIB
-#undef ATTRIBARRAY
-#undef ENDCLASS
-#undef SUPER
-#endif
-
-#define CLASS(cname)                       entity spawn##cname(); entity cname##_vtbl;
-#define EXTENDS(base)
-#define METHOD(cname,name,prototype)       prototype cname##_##name; .prototype name;
-#define ATTRIB(cname,name,type,val)        .type name;
-#define ATTRIBARRAY(cname,name,type,cnt)   .type name[cnt];
-#define ENDCLASS(cname)                    .float instanceOf##cname;
-#define SUPER(cname)
-#endif
index a1fb38b1a12bec97dcc2026da161c364a779563b..abfb303dbc21487eed7174c609081f95a85ba378 100644 (file)
@@ -4,15 +4,12 @@
 ../dpdefs/menudefs.qh
 ../dpdefs/keycodes.qh
 
-oo/interface.qh
-       classes.qc
-oo/implementation.qh
-       classes.qc
+oo/classes.qc
 
 draw.qc
 menu.qc
 
-command/menu_cmd.qc
+command/commands.qc
 
 xonotic/util.qc
 
@@ -24,10 +21,6 @@ xonotic/util.qc
 ../common/urllib.qc
 ../common/util.qc
 
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
-
 ../common/monsters/monsters.qc
 
 ../common/weapons/weapons.qc // TODO
index 84f9029c0f155d1317ed355209a5b88e9ae2ac6a..10c81e7ef34bbec061df61789857970764025c1f 100644 (file)
 #undef SKINFLOAT
 #undef SKINVECTOR
 
-#define SKINBEGIN void Skin_ApplySetting(string key, string value) { switch(key) {
-#define SKINVECTOR(name,def) case #name: SKIN##name = stov(value); break
-#define SKINFLOAT(name,def) case #name: SKIN##name = stof(value); break
+#define SKINBEGIN void Skin_ApplySetting(string key, string _value) { switch(key) {
+#define SKINVECTOR(name,def) case #name: SKIN##name = stov(_value); break
+#define SKINFLOAT(name,def) case #name: SKIN##name = stof(_value); break
 //#define SKINSTRING(name,def) case #name: break
-#define SKINSTRING(name,def) case #name: SKIN##name = strzone(value); break
+#define SKINSTRING(name,def) case #name: SKIN##name = strzone(_value); break
        // I know this leaks memory when skin is read multiple times. Screw it.
 #define SKINEND case "": break; case "//": break; default: dprint("Invalid key in skin file: ", key, "\n"); } }
 #include "skin-customizables.inc"
index a63189b63a850dc326e46216e7429f5d80ba98cb..07b6a074ceca2a341dba0c81976c0df3ab7c6046 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticBigButton) EXTENDS(XonoticButton)
+#ifndef BIGBUTTON_H
+#define BIGBUTTON_H
+#include "button.qc"
+CLASS(XonoticBigButton, XonoticButton)
        METHOD(XonoticBigButton, configureXonoticBigButton, void(entity, string, vector))
        ATTRIB(XonoticBigButton, image, string, SKINGFX_BUTTON_BIG)
        ATTRIB(XonoticBigButton, grayImage, string, SKINGFX_BUTTON_BIG_GRAY)
@@ -11,7 +13,7 @@ entity makeXonoticButton(string theText, vector theColor);
 entity makeXonoticBigButton(string theText, vector theColor)
 {
        entity me;
-       me = spawnXonoticBigButton();
+       me = NEW(XonoticBigButton);
        me.configureXonoticBigButton(me, theText, theColor);
        return me;
 }
index c96dd57a16afcc614fedff7ce68d5a65b6076182..6798d9b01b2602ba4cae85e78768788a6dde2467 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticBigCommandButton) EXTENDS(XonoticCommandButton)
+#ifndef BIGCOMMANDBUTTON_H
+#define BIGCOMMANDBUTTON_H
+#include "commandbutton.qc"
+CLASS(XonoticBigCommandButton, XonoticCommandButton)
        METHOD(XonoticBigCommandButton, configureXonoticBigCommandButton, void(entity, string, vector, string, float))
        ATTRIB(XonoticBigCommandButton, image, string, SKINGFX_BUTTON_BIG)
        ATTRIB(XonoticBigCommandButton, grayImage, string, SKINGFX_BUTTON_BIG_GRAY)
@@ -11,7 +13,7 @@ entity makeXonoticBigCommandButton(string theText, vector theColor, string theCo
 entity makeXonoticBigCommandButton(string theText, vector theColor, string theCommand, float theFlags)
 {
        entity me;
-       me = spawnXonoticBigCommandButton();
+       me = NEW(XonoticBigCommandButton);
        me.configureXonoticBigCommandButton(me, theText, theColor, theCommand, theFlags);
        return me;
 }
index cbc7c47c40acbb84a88f39c154b7299428559531..73518ef96ad3396471e4a3497e9203bf92d0104a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticButton) EXTENDS(Button)
+#ifndef BUTTON_H
+#define BUTTON_H
+#include "../item/button.qc"
+CLASS(XonoticButton, Button)
        METHOD(XonoticButton, configureXonoticButton, void(entity, string, vector))
        ATTRIB(XonoticButton, fontSize, float, SKINFONTSIZE_NORMAL)
        ATTRIB(XonoticButton, image, string, SKINGFX_BUTTON)
@@ -20,7 +22,7 @@ entity makeXonoticButton(string theText, vector theColor);
 entity makeXonoticButton(string theText, vector theColor)
 {
        entity me;
-       me = spawnXonoticButton();
+       me = NEW(XonoticButton);
        me.configureXonoticButton(me, theText, theColor);
        return me;
 }
index 16967a688f8b915d047bd0ec6846ab087bb83fde..826a0b4f2d7c6d81cf22f906f3fd7230dbc99a32 100644 (file)
@@ -1,7 +1,9 @@
 #include "../../common/campaign_common.qh"
 
-#ifdef INTERFACE
-CLASS(XonoticCampaignList) EXTENDS(XonoticListBox)
+#ifndef CAMPAIGN_H
+#define CAMPAIGN_H
+#include "listbox.qc"
+CLASS(XonoticCampaignList, XonoticListBox)
        METHOD(XonoticCampaignList, configureXonoticCampaignList, void(entity))
        ATTRIB(XonoticCampaignList, rowsPerItem, float, 10)
        METHOD(XonoticCampaignList, draw, void(entity))
@@ -92,7 +94,7 @@ void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize)
 entity makeXonoticCampaignList()
 {
        entity me;
-       me = spawnXonoticCampaignList();
+       me = NEW(XonoticCampaignList);
        me.configureXonoticCampaignList(me);
        return me;
 }
index 0ba72a5d83404ff3fee24deb3d9d93aac7fccb36..d6bc52461846995ad7f0d09f0e4f3a871a4bd3ac 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCharmap) EXTENDS(Item)
+#ifndef CHARMAP_H
+#define CHARMAP_H
+#include "../item.qc"
+CLASS(XonoticCharmap, Item)
        METHOD(XonoticCharmap, configureXonoticCharmap, void(entity, entity))
        METHOD(XonoticCharmap, mousePress, float(entity, vector))
        METHOD(XonoticCharmap, mouseRelease, float(entity, vector))
@@ -57,7 +59,7 @@ string charmap_cellToChar(vector cell)
 entity makeXonoticCharmap(entity controlledInputBox)
 {
        entity me;
-       me = spawnXonoticCharmap();
+       me = NEW(XonoticCharmap);
        me.configureXonoticCharmap(me, controlledInputBox);
        return me;
 }
index 631a430dcc455947d8c63e83e0e24297ba5dd7ae..65db0f5a73bbcf4f0223998d1d07b0b30dcd003f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCheckBox) EXTENDS(CheckBox)
+#ifndef CHECKBOX_H
+#define CHECKBOX_H
+#include "../item/checkbox.qc"
+CLASS(XonoticCheckBox, CheckBox)
        METHOD(XonoticCheckBox, configureXonoticCheckBox, void(entity, float, float, string, string))
        METHOD(XonoticCheckBox, setChecked, void(entity, float))
        ATTRIB(XonoticCheckBox, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -53,7 +55,7 @@ entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
 entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
 {
        entity me;
-       me = spawnXonoticCheckBox();
+       me = NEW(XonoticCheckBox);
        me.configureXonoticCheckBox(me, theYesValue, theNoValue, theCvar, theText);
        return me;
 }
index e3043184a44f35cd2676375466fff57ec9c91014..9cce51d828fe2b99c3749e954b06e20b6a1a2f4a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSliderCheckBox) EXTENDS(CheckBox)
+#ifndef CHECKBOX_SLIDER_INVALID_H
+#define CHECKBOX_SLIDER_INVALID_H
+#include "../item/checkbox.qc"
+CLASS(XonoticSliderCheckBox, CheckBox)
        METHOD(XonoticSliderCheckBox, configureXonoticSliderCheckBox, void(entity, float, float, entity, string))
        METHOD(XonoticSliderCheckBox, setChecked, void(entity, float))
        METHOD(XonoticSliderCheckBox, draw, void(entity))
@@ -26,7 +28,7 @@ entity makeXonoticSliderCheckBox(float, float, entity, string);
 entity makeXonoticSliderCheckBox(float theOffValue, float isInverted, entity theControlledSlider, string theText)
 {
        entity me;
-       me = spawnXonoticSliderCheckBox();
+       me = NEW(XonoticSliderCheckBox);
        me.configureXonoticSliderCheckBox(me, theOffValue, isInverted, theControlledSlider, theText);
        return me;
 }
index aeda757f0e83718cbca511cace58aa2c9fc04d85..2efa1a102b67a3dde096c51b2b3ec51c852a0e22 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCheckBoxString) EXTENDS(CheckBox)
+#ifndef CHECKBOX_STRING_H
+#define CHECKBOX_STRING_H
+#include "../item/checkbox.qc"
+CLASS(XonoticCheckBoxString, CheckBox)
        METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string))
        METHOD(XonoticCheckBoxString, setChecked, void(entity, float))
        ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -27,7 +29,7 @@ entity makeXonoticCheckBoxString(string, string, string, string);
 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
 {
        entity me;
-       me = spawnXonoticCheckBoxString();
+       me = NEW(XonoticCheckBoxString);
        me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
        return me;
 }
index bcbdfee8db9d3585a4aa4e51567492207cd392bc..950661d73dc8d33699eccbca95191b213626872a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticColorButton) EXTENDS(RadioButton)
+#ifndef COLORBUTTON_H
+#define COLORBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticColorButton, RadioButton)
        METHOD(XonoticColorButton, configureXonoticColorButton, void(entity, float, float, float))
        METHOD(XonoticColorButton, setChecked, void(entity, float))
        METHOD(XonoticColorButton, draw, void(entity))
@@ -21,7 +23,7 @@ entity makeXonoticColorButton(float, float, float);
 entity makeXonoticColorButton(float theGroup, float theColor, float theValue)
 {
        entity me;
-       me = spawnXonoticColorButton();
+       me = NEW(XonoticColorButton);
        me.configureXonoticColorButton(me, theGroup, theColor, theValue);
        return me;
 }
index f16ab0ebd45fd0a16a0f941e06cfb9766941fe69..450c5fb29e1d6cf9f8770e0a271a49244e0bad4f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticColorpicker) EXTENDS(Image)
+#ifndef COLORPICKER_H
+#define COLORPICKER_H
+#include "../item/image.qc"
+CLASS(XonoticColorpicker, Image)
        METHOD(XonoticColorpicker, configureXonoticColorpicker, void(entity, entity))
        METHOD(XonoticColorpicker, mousePress, float(entity, vector))
        METHOD(XonoticColorpicker, mouseRelease, float(entity, vector))
@@ -19,7 +21,7 @@ entity makeXonoticColorpicker(entity theTextbox);
 entity makeXonoticColorpicker(entity theTextbox)
 {
        entity me;
-       me = spawnXonoticColorpicker();
+       me = NEW(XonoticColorpicker);
        me.configureXonoticColorpicker(me, theTextbox);
        return me;
 }
index 458a72c01a6fe1dd47ced6e06c2dffb4ddfe41e3..0695f057ea034d625b7e5804e38aa85b81480dc4 100644 (file)
@@ -1,12 +1,14 @@
-#ifdef INTERFACE
-CLASS(XonoticColorpickerString) EXTENDS(Image)
+#ifndef COLORPICKER_STRING_H
+#define COLORPICKER_STRING_H
+#include "../item/image.qc"
+CLASS(XonoticColorpickerString, Image)
        METHOD(XonoticColorpickerString, configureXonoticColorpickerString, void(entity, string, string))
        METHOD(XonoticColorpickerString, mousePress, float(entity, vector))
        METHOD(XonoticColorpickerString, mouseRelease, float(entity, vector))
        METHOD(XonoticColorpickerString, mouseDrag, float(entity, vector))
        ATTRIB(XonoticColorpickerString, cvarName, string, string_null)
-       METHOD(XonoticColorPickerString, loadCvars, void(entity))
-       METHOD(XonoticColorPickerString, saveCvars, void(entity))
+       METHOD(XonoticColorpickerString, loadCvars, void(entity))
+       METHOD(XonoticColorpickerString, saveCvars, void(entity))
        ATTRIB(XonoticColorpickerString, prevcoords, vector, '0 0 0')
        ATTRIB(XonoticColorpickerString, image, string, SKINGFX_COLORPICKER)
        ATTRIB(XonoticColorpickerString, imagemargin, vector, SKINMARGIN_COLORPICKER)
@@ -21,7 +23,7 @@ entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar);
 entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
 {
        entity me;
-       me = spawnXonoticColorpickerString();
+       me = NEW(XonoticColorpickerString);
        me.configureXonoticColorpickerString(me, theCvar, theDefaultCvar);
        return me;
 }
@@ -38,7 +40,7 @@ void XonoticColorpickerString_configureXonoticColorpickerString(entity me, strin
        }
 }
 
-void XonoticColorPickerString_loadCvars(entity me)
+void XonoticColorpickerString_loadCvars(entity me)
 {
        if (!me.cvarName)
                return;
@@ -55,7 +57,7 @@ void XonoticColorPickerString_loadCvars(entity me)
                me.prevcoords = color_hslimage(stov(cvar_string(me.cvarName)), me.imagemargin);
 }
 
-void XonoticColorPickerString_saveCvars(entity me)
+void XonoticColorpickerString_saveCvars(entity me)
 {
        if (!me.cvarName)
                return;
index 8ee4e7de3a75503215591c49e643a68768c580bf..afea74cb47d80b0e618c266e24c5f39e13105640 100644 (file)
@@ -4,8 +4,10 @@
 //# define COMMANDBUTTON_REVERT 4
 #endif
 
-#ifdef INTERFACE
-CLASS(XonoticCommandButton) EXTENDS(XonoticButton)
+#ifndef COMMANDBUTTON_H
+#define COMMANDBUTTON_H
+#include "button.qc"
+CLASS(XonoticCommandButton, XonoticButton)
        METHOD(XonoticCommandButton, configureXonoticCommandButton, void(entity, string, vector, string, float))
        ATTRIB(XonoticCommandButton, onClickCommand, string, string_null)
        ATTRIB(XonoticCommandButton, flags, float, 0)
@@ -17,7 +19,7 @@ entity makeXonoticCommandButton(string theText, vector theColor, string theComma
 entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, float theFlags)
 {
        entity me;
-       me = spawnXonoticCommandButton();
+       me = NEW(XonoticCommandButton);
        me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags);
        return me;
 }
index 67848f9144978dd87bce3648aed4e65ed336c90b..d7e17f53296c40dc158eb4b97b62464b04e62009 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCreditsList) EXTENDS(XonoticListBox)
+#ifndef CREDITS_H
+#define CREDITS_H
+#include "listbox.qc"
+CLASS(XonoticCreditsList, XonoticListBox)
        METHOD(XonoticCreditsList, configureXonoticCreditsList, void(entity))
        ATTRIB(XonoticCreditsList, rowsPerItem, float, 1)
        METHOD(XonoticCreditsList, draw, void(entity))
@@ -13,7 +15,7 @@ CLASS(XonoticCreditsList) EXTENDS(XonoticListBox)
        ATTRIB(XonoticCreditsList, bufferIndex, float, 0)
        ATTRIB(XonoticCreditsList, scrolling, float, 0)
 
-       ATTRIB(XonoticListBox, alphaBG, float, 0)
+       ATTRIB(XonoticCreditsList, alphaBG, float, 0)
 ENDCLASS(XonoticCreditsList)
 entity makeXonoticCreditsList();
 #endif
@@ -22,7 +24,7 @@ entity makeXonoticCreditsList();
 entity makeXonoticCreditsList()
 {
        entity me;
-       me = spawnXonoticCreditsList();
+       me = NEW(XonoticCreditsList);
        me.configureXonoticCreditsList(me);
        return me;
 }
index 3b562cb776e4c3f8f2815c7046ccb1830f7d2d3b..466846f12d54d9520bb82390d2a494afb92ad9b1 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCrosshairButton) EXTENDS(RadioButton)
+#ifndef CROSSHAIRBUTTON_H
+#define CROSSHAIRBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticCrosshairButton, RadioButton)
        METHOD(XonoticCrosshairButton, configureXonoticCrosshairButton, void(entity, float, float))
        METHOD(XonoticCrosshairButton, setChecked, void(entity, float))
        METHOD(XonoticCrosshairButton, draw, void(entity))
@@ -22,7 +24,7 @@ entity makeXonoticCrosshairButton(float, float);
 entity makeXonoticCrosshairButton(float theGroup, float theCrosshair)
 {
        entity me;
-       me = spawnXonoticCrosshairButton();
+       me = NEW(XonoticCrosshairButton);
        me.configureXonoticCrosshairButton(me, theGroup, theCrosshair);
        return me;
 }
index 421142aac0746ca798ebe8157080071ee4254c79..44520c1f22f58857b72d43d71e63ae97e9556843 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCvarList) EXTENDS(XonoticListBox)
+#ifndef CVARLIST_H
+#define CVARLIST_H
+#include "listbox.qc"
+CLASS(XonoticCvarList, XonoticListBox)
        METHOD(XonoticCvarList, configureXonoticCvarList, void(entity))
        ATTRIB(XonoticCvarList, rowsPerItem, float, 1)
        METHOD(XonoticCvarList, drawListBoxItem, void(entity, float, vector, float))
@@ -44,7 +46,7 @@ void CvarList_End_Editing(entity box, entity me);
 entity makeXonoticCvarList()
 {
        entity me;
-       me = spawnXonoticCvarList();
+       me = NEW(XonoticCvarList);
        me.configureXonoticCvarList(me);
        return me;
 }
index 6882fcc5eb78b2d49d6733639fd18b31b2298eea..4f759f68ad7e6e58bd70e60c5d003014052e5dfd 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticDemoList) EXTENDS(XonoticListBox)
+#ifndef DEMOLIST_H
+#define DEMOLIST_H
+#include "listbox.qc"
+CLASS(XonoticDemoList, XonoticListBox)
        METHOD(XonoticDemoList, configureXonoticDemoList, void(entity))
        ATTRIB(XonoticDemoList, rowsPerItem, float, 1)
        METHOD(XonoticDemoList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -38,7 +40,7 @@ void DemoList_Filter_Change(entity box, entity me);
 entity makeXonoticDemoList()
 {
        entity me;
-       me = spawnXonoticDemoList();
+       me = NEW(XonoticDemoList);
        me.configureXonoticDemoList(me);
        return me;
 }
index 6ca90254a3eb24b70318fe5972a58e85473cdfd0..c1ea16c6b7cbca86cd7131ab19456b199c388305 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticDialog) EXTENDS(Dialog)
+#ifndef DIALOG_H
+#define DIALOG_H
+#include "../item/dialog.qc"
+CLASS(XonoticDialog, Dialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
index e90ae4b42590d08435472ea66b76c31e5a317fe4..a9966266301ece966058bd2d53d484b657b03a65 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCreditsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_CREDITS_H
+#define DIALOG_CREDITS_H
+#include "dialog.qc"
+CLASS(XonoticCreditsDialog, XonoticDialog)
        METHOD(XonoticCreditsDialog, fill, void(entity))
        METHOD(XonoticCreditsDialog, focusEnter, void(entity))
        ATTRIB(XonoticCreditsDialog, title, string, _("Credits"))
index c9238a979313f1086226ce5082b1e2c92038aaf5..894a702d8a026a155c1c05a1d4553003c474ec6a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticFirstRunDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_FIRSTRUN_H
+#define DIALOG_FIRSTRUN_H
+#include "rootdialog.qc"
+CLASS(XonoticFirstRunDialog, XonoticRootDialog)
        METHOD(XonoticFirstRunDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        ATTRIB(XonoticFirstRunDialog, title, string, _("Welcome"))
        ATTRIB(XonoticFirstRunDialog, color, vector, SKINCOLOR_DIALOG_FIRSTRUN)
index 307efdec023ea0a27c7eb5029290f668f8ad65ea..9f14754bd37f793f9917e1192e59c28d334fb66f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDAmmoDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_AMMO_H
+#define DIALOG_HUDPANEL_AMMO_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDAmmoDialog, XonoticRootDialog)
        METHOD(XonoticHUDAmmoDialog, fill, void(entity))
        ATTRIB(XonoticHUDAmmoDialog, title, string, _("Ammo Panel"))
        ATTRIB(XonoticHUDAmmoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 226bd972403cafd7ba560c8984eabd5df2b24efc..7733fd35003a0fc65a326f57f7d1a2efee6c7f6f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDBuffsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_BUFFS_H
+#define DIALOG_HUDPANEL_BUFFS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDBuffsDialog, XonoticRootDialog)
        METHOD(XonoticHUDBuffsDialog, fill, void(entity))
        ATTRIB(XonoticHUDBuffsDialog, title, string, _("Buffs Panel"))
        ATTRIB(XonoticHUDBuffsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index bb7312f13e213002ecd65a4f2c07d2818c75e299..7e74cdf5e8f959b94488867fe4c0c1e0f82e85ad 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDCenterprintDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_CENTERPRINT_H
+#define DIALOG_HUDPANEL_CENTERPRINT_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDCenterprintDialog, XonoticRootDialog)
        METHOD(XonoticHUDCenterprintDialog, fill, void(entity))
        ATTRIB(XonoticHUDCenterprintDialog, title, string, _("Centerprint Panel"))
        ATTRIB(XonoticHUDCenterprintDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index e16f76ac3ea8d8f8022b1d8e2f8d1cde4ca5c19a..c56c312efc0461b39e2365f481d82f5106af340f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDChatDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_CHAT_H
+#define DIALOG_HUDPANEL_CHAT_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDChatDialog, XonoticRootDialog)
        METHOD(XonoticHUDChatDialog, fill, void(entity))
        ATTRIB(XonoticHUDChatDialog, title, string, _("Chat Panel"))
        ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 534f1ebfe146da507f81f2fc1fea49e6278a3e59..0220ea2325f1818cd5eef5408afdfaaba810bf10 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDEngineInfoDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_ENGINEINFO_H
+#define DIALOG_HUDPANEL_ENGINEINFO_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDEngineInfoDialog, XonoticRootDialog)
        METHOD(XonoticHUDEngineInfoDialog, fill, void(entity))
        ATTRIB(XonoticHUDEngineInfoDialog, title, string, _("Engine Info Panel"))
        ATTRIB(XonoticHUDEngineInfoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index dc864203b46c0c7a1c0a54abe3925af18c5e357a..f0482bd73efbb4dbfb9c567cf2ff9e55bc3b7043 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDHealthArmorDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_HEALTHARMOR_H
+#define DIALOG_HUDPANEL_HEALTHARMOR_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDHealthArmorDialog, XonoticRootDialog)
        METHOD(XonoticHUDHealthArmorDialog, fill, void(entity))
        ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel"))
        ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index b705531209bda727d8f066e9cac3a810858fb485..84625df73dd693e95c40119456346ddc8dbf4b68 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDInfoMessagesDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_INFOMESSAGES_H
+#define DIALOG_HUDPANEL_INFOMESSAGES_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDInfoMessagesDialog, XonoticRootDialog)
        METHOD(XonoticHUDInfoMessagesDialog, fill, void(entity))
        ATTRIB(XonoticHUDInfoMessagesDialog, title, string, _("Info Messages Panel"))
        ATTRIB(XonoticHUDInfoMessagesDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 3133a7e83a1228651c4e6b512ef35ab057105d36..9737c548055a1a367f560279afac18e311634c1c 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDModIconsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_MODICONS_H
+#define DIALOG_HUDPANEL_MODICONS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDModIconsDialog, XonoticRootDialog)
        METHOD(XonoticHUDModIconsDialog, fill, void(entity))
        ATTRIB(XonoticHUDModIconsDialog, title, string, _("Mod Icons Panel"))
        ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 722b5d539d169de9e9ca106279e7f341f129c0b4..d0586710cf63ad55fc88e3a32184d418e81d18c8 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_NOTIFICATION_H
+#define DIALOG_HUDPANEL_NOTIFICATION_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDNotificationDialog, XonoticRootDialog)
        METHOD(XonoticHUDNotificationDialog, fill, void(entity))
        ATTRIB(XonoticHUDNotificationDialog, title, string, _("Notification Panel"))
        ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 6e4917d93c0f8bb75be6906680c94c54d2faae28..606f01aaab8e6ee3b0741b3166760780f22f0fa2 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDPhysicsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_PHYSICS_H
+#define DIALOG_HUDPANEL_PHYSICS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDPhysicsDialog, XonoticRootDialog)
        METHOD(XonoticHUDPhysicsDialog, fill, void(entity))
        ATTRIB(XonoticHUDPhysicsDialog, title, string, _("Physics Panel"))
        ATTRIB(XonoticHUDPhysicsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 3449e0604a046ffa0ddac263a988770c82fad713..45a2049fc26b0cc87e6c15f28c3866ab352d29fc 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDPowerupsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_POWERUPS_H
+#define DIALOG_HUDPANEL_POWERUPS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDPowerupsDialog, XonoticRootDialog)
        METHOD(XonoticHUDPowerupsDialog, fill, void(entity))
        ATTRIB(XonoticHUDPowerupsDialog, title, string, _("Powerups Panel"))
        ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 79f581d13456f2f5bb93fd34ca5d324137375254..4499d7c0f62a3370c5b9bcf11f27cb81588caad4 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDPressedKeysDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_PRESSEDKEYS_H
+#define DIALOG_HUDPANEL_PRESSEDKEYS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDPressedKeysDialog, XonoticRootDialog)
        METHOD(XonoticHUDPressedKeysDialog, fill, void(entity))
        ATTRIB(XonoticHUDPressedKeysDialog, title, string, _("Pressed Keys Panel"))
        ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index b8ecbee59bcb49bd555eb636e6294d5c59801217..3333a0e641ac0b43d500e92c8f23c03ffb6d25d5 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDRaceTimerDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_RACETIMER_H
+#define DIALOG_HUDPANEL_RACETIMER_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDRaceTimerDialog, XonoticRootDialog)
        METHOD(XonoticHUDRaceTimerDialog, fill, void(entity))
        ATTRIB(XonoticHUDRaceTimerDialog, title, string, _("Race Timer Panel"))
        ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index bdff50cb5ec915e270a37e38ac4bb96892377959..0d159b2766095b6f52537bc402369572444c9528 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDRadarDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_RADAR_H
+#define DIALOG_HUDPANEL_RADAR_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDRadarDialog, XonoticRootDialog)
        METHOD(XonoticHUDRadarDialog, fill, void(entity))
        ATTRIB(XonoticHUDRadarDialog, title, string, _("Radar Panel"))
        ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index edd4da66e0cb9654b326ec9e185fbee29206d4c8..690fc3b109adcf45cd09f6e82d90c31da001bff5 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDScoreDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_SCORE_H
+#define DIALOG_HUDPANEL_SCORE_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDScoreDialog, XonoticRootDialog)
        METHOD(XonoticHUDScoreDialog, fill, void(entity))
        ATTRIB(XonoticHUDScoreDialog, title, string, _("Score Panel"))
        ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 754a5f1003481dfe06d65cf3dfa5c5c7f84a6269..d140dea22276632a2f5fc0bb2e5c46e9761ae984 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_TIMER_H
+#define DIALOG_HUDPANEL_TIMER_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDTimerDialog, XonoticRootDialog)
        METHOD(XonoticHUDTimerDialog, fill, void(entity))
        ATTRIB(XonoticHUDTimerDialog, title, string, _("Timer Panel"))
        ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index e2b398ef2ed2e839dda0c74ac11e4812b1be73d5..62d439e33b370fc8bbb587bf6b4ee643cd7880fe 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDVoteDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_VOTE_H
+#define DIALOG_HUDPANEL_VOTE_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDVoteDialog, XonoticRootDialog)
        METHOD(XonoticHUDVoteDialog, fill, void(entity))
        ATTRIB(XonoticHUDVoteDialog, title, string, _("Vote Panel"))
        ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index ce1479cb1d775da4681ec211f58a7f8d2a7371ed..7f58e6c4abe904435eaa553c1ab14cc3715149df 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_WEAPONS_H
+#define DIALOG_HUDPANEL_WEAPONS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDWeaponsDialog, XonoticRootDialog)
        METHOD(XonoticHUDWeaponsDialog, fill, void(entity))
        ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"))
        ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 7cf0ea6dab934c6e8d5b6b125e60e3d88688c966..f8f6b9e6e4414654b354f75886a2404db63b52b8 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDExitDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDSETUP_EXIT_H
+#define DIALOG_HUDSETUP_EXIT_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDExitDialog, XonoticRootDialog)
        METHOD(XonoticHUDExitDialog, fill, void(entity))
        ATTRIB(XonoticHUDExitDialog, title, string, _("Panel HUD Setup"))
        ATTRIB(XonoticHUDExitDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
index 8b67094a725a945be5ef7ec5fc4f3215edda6441..14587e2a9f1933fb78f17038a54618e637bba0bb 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMonsterToolsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_MONSTERTOOLS_H
+#define DIALOG_MONSTERTOOLS_H
+#include "rootdialog.qc"
+CLASS(XonoticMonsterToolsDialog, XonoticRootDialog)
        METHOD(XonoticMonsterToolsDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        ATTRIB(XonoticMonsterToolsDialog, title, string, _("Monster Tools"))
        ATTRIB(XonoticMonsterToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
index eaaa22339f4441fb51c87b3a0fde2993ad591fda..64cfbd91dd415e04198517a1d4ef991c580fd7f7 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMultiplayerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_H
+#define DIALOG_MULTIPLAYER_H
+#include "dialog.qc"
+CLASS(XonoticMultiplayerDialog, XonoticDialog)
        METHOD(XonoticMultiplayerDialog, fill, void(entity))
        ATTRIB(XonoticMultiplayerDialog, title, string, _("Multiplayer"))
        ATTRIB(XonoticMultiplayerDialog, color, vector, SKINCOLOR_DIALOG_MULTIPLAYER)
index 455bb2fd2ebbd9f9d201061d5529bb2ec04a2fe9..e56f2eef3d991e447f6b5e9d09ffdbff7a30bdd1 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticServerCreateTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_CREATE_H
+#define DIALOG_MULTIPLAYER_CREATE_H
+#include "tab.qc"
+CLASS(XonoticServerCreateTab, XonoticTab)
        METHOD(XonoticServerCreateTab, fill, void(entity))
        METHOD(XonoticServerCreateTab, gameTypeChangeNotify, void(entity))
        METHOD(XonoticServerCreateTab, gameTypeSelectNotify, void(entity))
@@ -55,7 +57,7 @@ void GameType_ConfigureSliders(entity e, entity l, string pLabel, float pMin, fl
 entity makeXonoticServerCreateTab()
 {
        entity me;
-       me = spawnXonoticServerCreateTab();
+       me = NEW(XonoticServerCreateTab);
        me.configureDialog(me);
        return me;
 }
index 90cbcac0dbbd40910e6203702ff8ed825252a029..5254f5aa37223a251bd7364992b80a1684767489 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_CREATE_MAPINFO_H
+#define DIALOG_MULTIPLAYER_CREATE_MAPINFO_H
+#include "dialog.qc"
+CLASS(XonoticMapInfoDialog, XonoticDialog)
        METHOD(XonoticMapInfoDialog, fill, void(entity))
        METHOD(XonoticMapInfoDialog, loadMapInfo, void(entity, float, entity))
        ATTRIB(XonoticMapInfoDialog, title, string, _("Map Information"))
index d7825e06a395705cdac822d833107c6943a488fc..449445225644317321ae12b2443a15ee3332d81a 100644 (file)
@@ -1,7 +1,9 @@
 #include "../../common/weapons/weapons.qh"
 
-#ifdef INTERFACE
-CLASS(XonoticMutatorsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_CREATE_MUTATORS_H
+#define DIALOG_MULTIPLAYER_CREATE_MUTATORS_H
+#include "dialog.qc"
+CLASS(XonoticMutatorsDialog, XonoticDialog)
        METHOD(XonoticMutatorsDialog, toString, string(entity))
        METHOD(XonoticMutatorsDialog, fill, void(entity))
        METHOD(XonoticMutatorsDialog, showNotify, void(entity))
index 86e1624a81175472570c90feb6a6ef3147f5bd63..a4e480e18ab4197e5f0fdd52b0ac27fcab1a1e8d 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticServerListTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_JOIN_H
+#define DIALOG_MULTIPLAYER_JOIN_H
+#include "tab.qc"
+CLASS(XonoticServerListTab, XonoticTab)
        METHOD(XonoticServerListTab, fill, void(entity))
        ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticServerListTab, rows, float, 23)
@@ -13,7 +15,7 @@ entity makeXonoticServerListTab();
 entity makeXonoticServerListTab()
 {
        entity me;
-       me = spawnXonoticServerListTab();
+       me = NEW(XonoticServerListTab);
        me.configureDialog(me);
        return me;
 }
index dabb1be541bf3b50131d7ef827e61dc9aae7d890..a5ad6332054becb57d53167ccb7ddc9eaae92e3d 100644 (file)
@@ -1,7 +1,9 @@
 #include "../../common/mapinfo.qh"
 
-#ifdef INTERFACE
-CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_JOIN_SERVERINFO_H
+#define DIALOG_MULTIPLAYER_JOIN_SERVERINFO_H
+#include "dialog.qc"
+CLASS(XonoticServerInfoDialog, XonoticDialog)
        METHOD(XonoticServerInfoDialog, fill, void(entity))
        METHOD(XonoticServerInfoDialog, loadServerInfo, void(entity, float))
        ATTRIB(XonoticServerInfoDialog, title, string, _("Server Information"))
index fb52c5315b30bce67fa8150ec428e05f07d92ead..03ffd0f36dc361d814707081bb8b6efd18eb9890 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMediaTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_H
+#define DIALOG_MULTIPLAYER_MEDIA_H
+#include "tab.qc"
+CLASS(XonoticMediaTab, XonoticTab)
        METHOD(XonoticMediaTab, fill, void(entity))
        ATTRIB(XonoticMediaTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticMediaTab, rows, float, 23)
@@ -13,7 +15,7 @@ entity makeXonoticMediaTab();
 entity makeXonoticMediaTab()
 {
        entity me;
-       me = spawnXonoticMediaTab();
+       me = NEW(XonoticMediaTab);
        me.configureDialog(me);
        return me;
 }
index 7a6ddf219cbfec75482a4224bf0254f1c8f31d2c..788aa5381bac5ca7c2ac8de7d1ae2d67d3dc7360 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_DEMO_H
+#define DIALOG_MULTIPLAYER_MEDIA_DEMO_H
+#include "tab.qc"
+CLASS(XonoticDemoBrowserTab, XonoticTab)
        METHOD(XonoticDemoBrowserTab, fill, void(entity))
        ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticDemoBrowserTab, rows, float, 21)
@@ -8,14 +10,11 @@ CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab)
        ATTRIB(XonoticDemoBrowserTab, democlicktype, float, 0)
 ENDCLASS(XonoticDemoBrowserTab)
 entity makeXonoticDemoBrowserTab();
-#ifdef IMPLEMENTATION
-// private:
-const float DMO_PLAY = 1;
-const float DMO_TIME = 2;
-#endif
 #endif
 
 #ifdef IMPLEMENTATION
+const float DMO_PLAY = 1;
+const float DMO_TIME = 2;
 void DemoConfirm_Check_Gamestatus(entity btn, entity me)
 {
        if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, lets watch the demo
@@ -37,7 +36,7 @@ void DemoConfirm_Check_Gamestatus(entity btn, entity me)
 entity makeXonoticDemoBrowserTab()
 {
        entity me;
-       me = spawnXonoticDemoBrowserTab();
+       me = NEW(XonoticDemoBrowserTab);
        me.configureDialog(me);
        return me;
 }
index 136997eec0afae2a1b2451d1b5eb5d8e6af68e6f..8d410ca7de87629fbfd38a9cfbb12c173a4d50ec 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticDemoStartConfirmDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_DEMO_STARTCONFIRM_H
+#define DIALOG_MULTIPLAYER_MEDIA_DEMO_STARTCONFIRM_H
+#include "dialog.qc"
+CLASS(XonoticDemoStartConfirmDialog, XonoticDialog)
        METHOD(XonoticDemoStartConfirmDialog, fill, void(entity))
        ATTRIB(XonoticDemoStartConfirmDialog, title, string, _("Disconnect"))
        ATTRIB(XonoticDemoStartConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
index 5c9bf8cb3d12ba9d6b633d1f1cd8cf27448728f8..fc3aa4448d36d678a3227e08a32abbb1d5019cac 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticDemoTimeConfirmDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_DEMO_TIMECONFIRM_H
+#define DIALOG_MULTIPLAYER_MEDIA_DEMO_TIMECONFIRM_H
+#include "dialog.qc"
+CLASS(XonoticDemoTimeConfirmDialog, XonoticDialog)
        METHOD(XonoticDemoTimeConfirmDialog, fill, void(entity))
        ATTRIB(XonoticDemoTimeConfirmDialog, title, string, _("Disconnect"))
        ATTRIB(XonoticDemoTimeConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
index 5a1720a30ac6f05ef0173d5ae6993abb5197e287..6c0791ff7ca66833470e02386876af59b5878774 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMusicPlayerTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_MUSICPLAYER_H
+#define DIALOG_MULTIPLAYER_MEDIA_MUSICPLAYER_H
+#include "tab.qc"
+CLASS(XonoticMusicPlayerTab, XonoticTab)
        METHOD(XonoticMusicPlayerTab, fill, void(entity))
        ATTRIB(XonoticMusicPlayerTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticMusicPlayerTab, rows, float, 21)
@@ -13,7 +15,7 @@ entity makeXonoticMusicPlayerTab();
 entity makeXonoticMusicPlayerTab()
 {
        entity me;
-       me = spawnXonoticMusicPlayerTab();
+       me = NEW(XonoticMusicPlayerTab);
        me.configureDialog(me);
        return me;
 }
index 751bf5d9e4ca9d589a2806995a70a8b34296facd..c6526f2ec8db9044663a6922081d8bb41199fd40 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticScreenshotBrowserTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_H
+#define DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_H
+#include "tab.qc"
+CLASS(XonoticScreenshotBrowserTab, XonoticTab)
        METHOD(XonoticScreenshotBrowserTab, fill, void(entity))
        ATTRIB(XonoticScreenshotBrowserTab, intendedWidth, float, 1)
        ATTRIB(XonoticScreenshotBrowserTab, rows, float, 21)
@@ -17,7 +19,7 @@ entity makeXonoticScreenshotBrowserTab();
 entity makeXonoticScreenshotBrowserTab()
 {
        entity me;
-       me = spawnXonoticScreenshotBrowserTab();
+       me = NEW(XonoticScreenshotBrowserTab);
        me.configureDialog(me);
        return me;
 }
index bcf168a93a3036da416233dd427d6027d2df0eca..fa63a17b01c717a1501d381b9b3d0c24a79056b1 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticScreenshotViewerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_VIEWER_H
+#define DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_VIEWER_H
+#include "dialog.qc"
+CLASS(XonoticScreenshotViewerDialog, XonoticDialog)
        METHOD(XonoticScreenshotViewerDialog, fill, void(entity))
        METHOD(XonoticScreenshotViewerDialog, keyDown, float(entity, float, float, float))
        METHOD(XonoticScreenshotViewerDialog, loadScreenshot, void(entity, string))
index 0f1062038b996c800dd9d44b55e1b24d72c75f66..9faf42888e83ef6e4f84c9ea4ba8152815029a6b 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticProfileTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_PROFILE_H
+#define DIALOG_MULTIPLAYER_PROFILE_H
+#include "tab.qc"
+CLASS(XonoticProfileTab, XonoticTab)
        METHOD(XonoticProfileTab, fill, void(entity))
        METHOD(XonoticProfileTab, draw, void(entity))
        ATTRIB(XonoticProfileTab, intendedWidth, float, 0.9)
@@ -15,7 +17,7 @@ entity makeXonoticProfileTab();
 entity makeXonoticProfileTab()
 {
        entity me;
-       me = spawnXonoticProfileTab();
+       me = NEW(XonoticProfileTab);
        me.configureDialog(me);
        return me;
 }
index 71de59dac2e33166fb3479d29655656498a8089c..fa4cacecb46fb5bec1c402812b20f84cc60b5116 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticQuitDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_QUIT_H
+#define DIALOG_QUIT_H
+#include "dialog.qc"
+CLASS(XonoticQuitDialog, XonoticDialog)
        METHOD(XonoticQuitDialog, fill, void(entity))
        ATTRIB(XonoticQuitDialog, title, string, _("Quit"))
        ATTRIB(XonoticQuitDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
index fa7f40aea11911cdbf41db33b354c2e9e24d7e33..bcc1ea1f0c6fbe2b2deadd8418b036e5677e77b8 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSandboxToolsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_SANDBOXTOOLS_H
+#define DIALOG_SANDBOXTOOLS_H
+#include "rootdialog.qc"
+CLASS(XonoticSandboxToolsDialog, XonoticRootDialog)
        METHOD(XonoticSandboxToolsDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        ATTRIB(XonoticSandboxToolsDialog, title, string, _("Sandbox Tools")) // ;)
        ATTRIB(XonoticSandboxToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
index a992e80593e4b14b62b86aa96f683f5d4df4695e..e17ab14e6cf14ecaf9ff8a53f8d2b759babdb862 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSettingsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_H
+#define DIALOG_SETTINGS_H
+#include "dialog.qc"
+CLASS(XonoticSettingsDialog, XonoticDialog)
        METHOD(XonoticSettingsDialog, fill, void(entity))
        ATTRIB(XonoticSettingsDialog, title, string, _("Settings"))
        ATTRIB(XonoticSettingsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS)
index 2a4aa3ea56b9624990cd97bcf8c2b72f5aee693e..af8faddacecceb7a6fa9531152b26fd09a8c1bc9 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticAudioSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_AUDIO_H
+#define DIALOG_SETTINGS_AUDIO_H
+#include "tab.qc"
+CLASS(XonoticAudioSettingsTab, XonoticTab)
        METHOD(XonoticAudioSettingsTab, fill, void(entity))
        ATTRIB(XonoticAudioSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticAudioSettingsTab, rows, float, 15.5)
@@ -13,7 +15,7 @@ entity makeXonoticAudioSettingsTab();
 entity makeXonoticAudioSettingsTab()
 {
        entity me;
-       me = spawnXonoticAudioSettingsTab();
+       me = NEW(XonoticAudioSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 9fc10167566529ba59236dca42adf18c3771e65f..d06465082b395303a4a1857c4982c7bb7f6258a2 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_EFFECTS_H
+#define DIALOG_SETTINGS_EFFECTS_H
+#include "tab.qc"
+CLASS(XonoticEffectsSettingsTab, XonoticTab)
        METHOD(XonoticEffectsSettingsTab, fill, void(entity))
        ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticEffectsSettingsTab, rows, float, 15.5)
@@ -12,7 +14,7 @@ entity makeXonoticEffectsSettingsTab();
 entity makeXonoticEffectsSettingsTab()
 {
        entity me;
-       me = spawnXonoticEffectsSettingsTab();
+       me = NEW(XonoticEffectsSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 4524b5133f97459da3144c390d701d1ee5988d2e..5b14b7bdb698669a8cd0531ed77d8dedbdafb7f0 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_H
+#define DIALOG_SETTINGS_GAME_H
+#include "tab.qc"
+CLASS(XonoticGameSettingsTab, XonoticTab)
        METHOD(XonoticGameSettingsTab, fill, void(entity))
        ATTRIB(XonoticGameSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticGameSettingsTab, rows, float, 15.5)
@@ -12,7 +14,7 @@ entity makeXonoticGameSettingsTab();
 entity makeXonoticGameSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameSettingsTab();
+       me = NEW(XonoticGameSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 052794b0899618499b8f7498ef89877e82bfb64d..be0d60edcc3d9ca7aede010de1a0c94e33561682 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameCrosshairSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_CROSSHAIR_H
+#define DIALOG_SETTINGS_GAME_CROSSHAIR_H
+#include "tab.qc"
+CLASS(XonoticGameCrosshairSettingsTab, XonoticTab)
        METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity))
        METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity))
        ATTRIB(XonoticGameCrosshairSettingsTab, intendedWidth, float, 0.9)
@@ -17,7 +19,7 @@ void XonoticGameCrosshairSettingsTab_showNotify(entity me)
 entity makeXonoticGameCrosshairSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameCrosshairSettingsTab();
+       me = NEW(XonoticGameCrosshairSettingsTab);
        me.configureDialog(me);
        return me;
 }
index c934d66be324f3bf6f7a8422e5d1e67eec82fab5..941daa7922ecf70ac744ba5c7ffb5f4c8c4de2e5 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameHUDSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_HUD_H
+#define DIALOG_SETTINGS_GAME_HUD_H
+#include "tab.qc"
+CLASS(XonoticGameHUDSettingsTab, XonoticTab)
        METHOD(XonoticGameHUDSettingsTab, fill, void(entity))
        METHOD(XonoticGameHUDSettingsTab, showNotify, void(entity))
        ATTRIB(XonoticGameHUDSettingsTab, intendedWidth, float, 0.9)
@@ -29,7 +31,7 @@ void XonoticGameHUDSettingsTab_showNotify(entity me)
 entity makeXonoticGameHUDSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameHUDSettingsTab();
+       me = NEW(XonoticGameHUDSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 12312c36bbe7b6b4e1e27caf235d0931fab69171..d0b460b9167ae897d238161f15c33461b1eb6b19 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticHUDConfirmDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_GAME_HUDCONFIRM_H
+#define DIALOG_SETTINGS_GAME_HUDCONFIRM_H
+#include "dialog.qc"
+CLASS(XonoticHUDConfirmDialog, XonoticDialog)
        METHOD(XonoticHUDConfirmDialog, fill, void(entity))
        ATTRIB(XonoticHUDConfirmDialog, title, string, _("Enter HUD editor"))
        ATTRIB(XonoticHUDConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
index 276fd13cfdc9ffec693a025e982a53da54f26318..d52a102d4259f812fac042856d707e434fe0faea 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameMessageSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_MESSAGES_H
+#define DIALOG_SETTINGS_GAME_MESSAGES_H
+#include "tab.qc"
+CLASS(XonoticGameMessageSettingsTab, XonoticTab)
        METHOD(XonoticGameMessageSettingsTab, fill, void(entity))
        METHOD(XonoticGameMessageSettingsTab, showNotify, void(entity))
        ATTRIB(XonoticGameMessageSettingsTab, intendedWidth, float, 0.9)
@@ -18,7 +20,7 @@ void XonoticGameMessageSettingsTab_showNotify(entity me)
 entity makeXonoticGameMessageSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameMessageSettingsTab();
+       me = NEW(XonoticGameMessageSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 850cb1e639202de9635cec931f9c06a12e66b2ee..db3e4082c99a2cf5d3ec391dc933e8924cd8e55a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameModelSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_MODEL_H
+#define DIALOG_SETTINGS_GAME_MODEL_H
+#include "tab.qc"
+CLASS(XonoticGameModelSettingsTab, XonoticTab)
        METHOD(XonoticGameModelSettingsTab, fill, void(entity))
        METHOD(XonoticGameModelSettingsTab, showNotify, void(entity))
        ATTRIB(XonoticGameModelSettingsTab, intendedWidth, float, 0.9)
@@ -17,7 +19,7 @@ void XonoticGameModelSettingsTab_showNotify(entity me)
 entity makeXonoticGameModelSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameModelSettingsTab();
+       me = NEW(XonoticGameModelSettingsTab);
        me.configureDialog(me);
        return me;
 }
index d1f9e550be69764a2bf29aee3d220de98c70aa7d..40a526d56ae863e25e25de98ea47fa27b78e994f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameViewSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_VIEW_H
+#define DIALOG_SETTINGS_GAME_VIEW_H
+#include "tab.qc"
+CLASS(XonoticGameViewSettingsTab, XonoticTab)
        METHOD(XonoticGameViewSettingsTab, fill, void(entity))
        METHOD(XonoticGameViewSettingsTab, showNotify, void(entity))
        ATTRIB(XonoticGameViewSettingsTab, intendedWidth, float, 0.9)
@@ -17,7 +19,7 @@ void XonoticGameViewSettingsTab_showNotify(entity me)
 entity makeXonoticGameViewSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameViewSettingsTab();
+       me = NEW(XonoticGameViewSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 237b761272019522d997a3c3bc04af8a0808d60d..c59a9620d477d7826198061fdd67190f5f70d91f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGameWeaponsSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_WEAPONS_H
+#define DIALOG_SETTINGS_GAME_WEAPONS_H
+#include "tab.qc"
+CLASS(XonoticGameWeaponsSettingsTab, XonoticTab)
        METHOD(XonoticGameWeaponsSettingsTab, fill, void(entity))
        METHOD(XonoticGameWeaponsSettingsTab, showNotify, void(entity))
        ATTRIB(XonoticGameWeaponsSettingsTab, intendedWidth, float, 0.9)
@@ -18,7 +20,7 @@ void XonoticGameWeaponsSettingsTab_showNotify(entity me)
 entity makeXonoticGameWeaponsSettingsTab()
 {
        entity me;
-       me = spawnXonoticGameWeaponsSettingsTab();
+       me = NEW(XonoticGameWeaponsSettingsTab);
        me.configureDialog(me);
        return me;
 }
index f7fc31f1139479ee9e30df81943a49efe9d73aa2..f8e53c03a9fd069804bb0e9a37d8a4a2da6c9aef 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticInputSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_INPUT_H
+#define DIALOG_SETTINGS_INPUT_H
+#include "tab.qc"
+CLASS(XonoticInputSettingsTab, XonoticTab)
        METHOD(XonoticInputSettingsTab, fill, void(entity))
        ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticInputSettingsTab, rows, float, 15.5)
@@ -12,7 +14,7 @@ entity makeXonoticInputSettingsTab();
 entity makeXonoticInputSettingsTab()
 {
        entity me;
-       me = spawnXonoticInputSettingsTab();
+       me = NEW(XonoticInputSettingsTab);
        me.configureDialog(me);
        return me;
 }
index aaf182fcd80e93a92e15ca4ca5af48ae27481534..d6ad2e7090a255ee66e9ee48e8de6e2c1118af6e 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticUserbindEditDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_INPUT_USERBIND_H
+#define DIALOG_SETTINGS_INPUT_USERBIND_H
+#include "dialog.qc"
+CLASS(XonoticUserbindEditDialog, XonoticDialog)
        METHOD(XonoticUserbindEditDialog, loadUserBind, void(entity, string, string, string))
        METHOD(XonoticUserbindEditDialog, fill, void(entity))
        ATTRIB(XonoticUserbindEditDialog, title, string, _("User defined key bind"))
index e60ca4969cfd402e23825c2f6932ee170d1b0670..79e196170669f430519c20fe627d15c8d85fa4c9 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMiscSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_MISC_H
+#define DIALOG_SETTINGS_MISC_H
+#include "tab.qc"
+CLASS(XonoticMiscSettingsTab, XonoticTab)
        METHOD(XonoticMiscSettingsTab, fill, void(entity))
        ATTRIB(XonoticMiscSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticMiscSettingsTab, rows, float, 15.5)
@@ -12,7 +14,7 @@ entity makeXonoticMiscSettingsTab();
 entity makeXonoticMiscSettingsTab()
 {
        entity me;
-       me = spawnXonoticMiscSettingsTab();
+       me = NEW(XonoticMiscSettingsTab);
        me.configureDialog(me);
        return me;
 }
index c2ea2a5b66167c8dfc366bd8361ba0238a7e9c22..af75e64b92000ee69bf9d86f22d650cae7f6f2c8 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticCvarsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_MISC_CVARS_H
+#define DIALOG_SETTINGS_MISC_CVARS_H
+#include "dialog.qc"
+CLASS(XonoticCvarsDialog, XonoticDialog)
        METHOD(XonoticCvarsDialog, fill, void(entity))
        METHOD(XonoticCvarsDialog, showNotify, void(entity))
        ATTRIB(XonoticCvarsDialog, title, string, _("Advanced settings"))
index 8f6da0a55207b6b4c69426670ffddfa6b12d61ec..2f99321598be9001429aead38c46d7b32c464632 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticResetDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_MISC_RESET_H
+#define DIALOG_SETTINGS_MISC_RESET_H
+#include "dialog.qc"
+CLASS(XonoticResetDialog, XonoticDialog)
        METHOD(XonoticResetDialog, fill, void(entity))
        ATTRIB(XonoticResetDialog, title, string, _("Factory reset"))
        ATTRIB(XonoticResetDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
index d934f9050e980ce16927d973c7f394a65471cd68..35246ae1700159de66f3dc23760cf1ce93204b48 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticUserSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_USER_H
+#define DIALOG_SETTINGS_USER_H
+#include "tab.qc"
+CLASS(XonoticUserSettingsTab, XonoticTab)
        METHOD(XonoticUserSettingsTab, fill, void(entity))
        ATTRIB(XonoticUserSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticUserSettingsTab, rows, float, 15.5)
@@ -12,7 +14,7 @@ entity makeXonoticUserSettingsTab();
 entity makeXonoticUserSettingsTab()
 {
        entity me;
-       me = spawnXonoticUserSettingsTab();
+       me = NEW(XonoticUserSettingsTab);
        me.configureDialog(me);
        return me;
 }
index c830b5583a04615e72f72ffe739784ea29ae16e3..0a340eaff4452b035654a596c5dbe711fd997432 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticLanguageWarningDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_USER_LANGUAGEWARNING_H
+#define DIALOG_SETTINGS_USER_LANGUAGEWARNING_H
+#include "dialog.qc"
+CLASS(XonoticLanguageWarningDialog, XonoticDialog)
        METHOD(XonoticLanguageWarningDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        ATTRIB(XonoticLanguageWarningDialog, title, string, _("Warning"))
        ATTRIB(XonoticLanguageWarningDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
index d242666b92fd731c8c41b96709484217c17d06e9..61a93f62e2696c06ff047745363e45cbb69278db 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticVideoSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_VIDEO_H
+#define DIALOG_SETTINGS_VIDEO_H
+#include "tab.qc"
+CLASS(XonoticVideoSettingsTab, XonoticTab)
        METHOD(XonoticVideoSettingsTab, fill, void(entity))
        ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticVideoSettingsTab, rows, float, 15.5)
@@ -13,7 +15,7 @@ entity makeXonoticVideoSettingsTab();
 entity makeXonoticVideoSettingsTab()
 {
        entity me;
-       me = spawnXonoticVideoSettingsTab();
+       me = NEW(XonoticVideoSettingsTab);
        me.configureDialog(me);
        return me;
 }
index 6e13f65b818ea6cb348a1d47a744e43072d33299..1620349bf58864aea5f1f462c90853469d6180a4 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSingleplayerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SINGLEPLAYER_H
+#define DIALOG_SINGLEPLAYER_H
+#include "dialog.qc"
+CLASS(XonoticSingleplayerDialog, XonoticDialog)
        METHOD(XonoticSingleplayerDialog, fill, void(entity))
        ATTRIB(XonoticSingleplayerDialog, title, string, _("Singleplayer"))
        ATTRIB(XonoticSingleplayerDialog, color, vector, SKINCOLOR_DIALOG_SINGLEPLAYER)
index 0d1c05af44a10a89281bc4c668d06dd1827608ba..bc9d1c4eae6d7cc334d601153601734daac59eb3 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticWinnerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SINGLEPLAYER_WINNER_H
+#define DIALOG_SINGLEPLAYER_WINNER_H
+#include "dialog.qc"
+CLASS(XonoticWinnerDialog, XonoticDialog)
        METHOD(XonoticWinnerDialog, fill, void(entity))
        METHOD(XonoticWinnerDialog, focusEnter, void(entity))
        ATTRIB(XonoticWinnerDialog, title, string, _("Winner"))
index 1ab68c3fbe34cf16416325451690cf34542d58d3..8ed9d7ef23d0c1484d09e4fc4f18449a3b93af10 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticTeamSelectDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_TEAMSELECT_H
+#define DIALOG_TEAMSELECT_H
+#include "rootdialog.qc"
+CLASS(XonoticTeamSelectDialog, XonoticRootDialog)
        METHOD(XonoticTeamSelectDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        METHOD(XonoticTeamSelectDialog, showNotify, void(entity))
        ATTRIB(XonoticTeamSelectDialog, title, string, _("Team Selection")) // ;)
index cc10f3da9ea5d722627ab283f2a4d6ab83d06dbc..ae202560c4b5c2de648f33d1a318cc05d45ed8ba 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGametypeButton) EXTENDS(RadioButton)
+#ifndef GAMETYPEBUTTON_H
+#define GAMETYPEBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticGametypeButton, RadioButton)
        METHOD(XonoticGametypeButton, configureXonoticGametypeButton, void(entity, float, string, string))
        METHOD(XonoticGametypeButton, setChecked, void(entity, float))
        ATTRIB(XonoticGametypeButton, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -26,7 +28,7 @@ void GameTypeButton_Click(entity me, entity other);
 entity makeXonoticGametypeButton(float theGroup, string theCvar, string theText)
 {
        entity me;
-       me = spawnXonoticGametypeButton();
+       me = NEW(XonoticGametypeButton);
        me.configureXonoticGametypeButton(me, theGroup, theCvar, theText);
        return me;
 }
index 0d36c836340f7b463d2c0af41c9197990ec67619..d8dbc8838ea5bdb709931008cf7f3207a614ad9a 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticGametypeList) EXTENDS(XonoticListBox)
+#ifndef GAMETYPELIST_H
+#define GAMETYPELIST_H
+#include "listbox.qc"
+CLASS(XonoticGametypeList, XonoticListBox)
        METHOD(XonoticGametypeList, configureXonoticGametypeList, void(entity))
        ATTRIB(XonoticGametypeList, rowsPerItem, float, 2)
        METHOD(XonoticGametypeList, drawListBoxItem, void(entity, float, vector, float))
@@ -25,7 +27,7 @@ entity makeXonoticGametypeList();
 entity makeXonoticGametypeList(void)
 {
        entity me;
-       me = spawnXonoticGametypeList();
+       me = NEW(XonoticGametypeList);
        me.configureXonoticGametypeList(me);
        return me;
 }
index 9f0de67b8a1deb592ddf0aff2eb8c6f5b03097d0..e8f5a8269351a4f81648181517415e6c3c8130e5 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticImage) EXTENDS(Image)
+#ifndef IMAGE_H
+#define IMAGE_H
+#include "../item/image.qc"
+CLASS(XonoticImage, Image)
        METHOD(XonoticImage, configureXonoticImage, void(entity, string, float))
 ENDCLASS(XonoticImage)
 entity makeXonoticImage(string theImage, float theAspect);
@@ -9,7 +11,7 @@ entity makeXonoticImage(string theImage, float theAspect);
 entity makeXonoticImage(string theImage, float theAspect)
 {
        entity me;
-       me = spawnXonoticImage();
+       me = NEW(XonoticImage);
        me.configureXonoticImage(me, theImage, theAspect);
        return me;
 }
index 5d7d179995028719bc107d1158edcd91678bc1e8..de1580160edb904f3de775482c9dcdc8c03cab35 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticInputBox) EXTENDS(InputBox)
+#ifndef INPUTBOX_H
+#define INPUTBOX_H
+#include "../item/inputbox.qc"
+CLASS(XonoticInputBox, InputBox)
        METHOD(XonoticInputBox, configureXonoticInputBox, void(entity, float, string))
        METHOD(XonoticInputBox, focusLeave, void(entity))
        METHOD(XonoticInputBox, setText, void(entity, string))
@@ -38,7 +40,7 @@ entity makeXonoticInputBox(float, string);
 entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
 {
        entity me;
-       me = spawnXonoticInputBox();
+       me = NEW(XonoticInputBox);
        me.configureXonoticInputBox(me, doEditColorCodes, theCvar);
        return me;
 }
@@ -58,18 +60,18 @@ void XonoticInputBox_focusLeave(entity me)
 {
        me.saveCvars(me);
 }
-void XonoticInputBox_setText(entity me, string new)
+void XonoticInputBox_setText(entity me, string val)
 {
-       if(me.text != new)
+       if(me.text != val)
        {
-               SUPER(XonoticInputBox).setText(me, new);
+               SUPER(XonoticInputBox).setText(me, val);
                if(me.onChange)
                        me.onChange(me, me.onChangeEntity);
                if(me.saveImmediately)
                        me.saveCvars(me);
        }
        else
-               SUPER(XonoticInputBox).setText(me, new);
+               SUPER(XonoticInputBox).setText(me, val);
 }
 void XonoticInputBox_loadCvars(entity me)
 {
index 5c2b898f21acdd93e4d9eaa5d8d33753fd6dc001..82d3db4e5d7d5489cae3c1d9fb414a7fa1132cc7 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticKeyBinder) EXTENDS(XonoticListBox)
+#ifndef KEYBINDER_H
+#define KEYBINDER_H
+#include "listbox.qc"
+CLASS(XonoticKeyBinder, XonoticListBox)
        METHOD(XonoticKeyBinder, configureXonoticKeyBinder, void(entity))
        ATTRIB(XonoticKeyBinder, rowsPerItem, int, 1)
        METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, float, vector, float))
@@ -28,6 +30,7 @@ entity makeXonoticKeyBinder();
 void KeyBinder_Bind_Change(entity btn, entity me);
 void KeyBinder_Bind_Clear(entity btn, entity me);
 void KeyBinder_Bind_Edit(entity btn, entity me);
+void KeyBinder_Bind_Reset_All(entity btn, entity me);
 #endif
 
 #ifdef IMPLEMENTATION
@@ -65,7 +68,7 @@ void Xonotic_KeyBinds_Read()
 entity makeXonoticKeyBinder()
 {
        entity me;
-       me = spawnXonoticKeyBinder();
+       me = NEW(XonoticKeyBinder);
        me.configureXonoticKeyBinder(me);
        return me;
 }
index 8aa0d2c077dd4efde44e0b94d249ba0512fc58ea..367da94dfb5df0ad26d6f001866c77896da4415b 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticLanguageList) EXTENDS(XonoticListBox)
+#ifndef LANGUAGELIST_H
+#define LANGUAGELIST_H
+#include "listbox.qc"
+CLASS(XonoticLanguageList, XonoticListBox)
        METHOD(XonoticLanguageList, configureXonoticLanguageList, void(entity))
        ATTRIB(XonoticLanguageList, rowsPerItem, float, 1)
        METHOD(XonoticLanguageList, drawListBoxItem, void(entity, float, vector, float))
@@ -43,7 +45,7 @@ const float LANGPARM_COUNT = 4;
 entity makeXonoticLanguageList()
 {
        entity me;
-       me = spawnXonoticLanguageList();
+       me = NEW(XonoticLanguageList);
        me.configureXonoticLanguageList(me);
        return me;
 }
index 0ab574fa2f1b3869422e5b137d6a49459695580b..c4a0923858afa4ff668826089e038f0391779055 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticListBox) EXTENDS(ListBox)
+#ifndef LISTBOX_H
+#define LISTBOX_H
+#include "../item/listbox.qc"
+CLASS(XonoticListBox, ListBox)
        METHOD(XonoticListBox, configureXonoticListBox, void(entity))
        ATTRIB(XonoticListBox, fontSize, float, SKINFONTSIZE_NORMAL)
        ATTRIB(XonoticListBox, scrollbarWidth, float, SKINWIDTH_SCROLLBAR)
@@ -21,7 +23,7 @@ entity makeXonoticListBox();
 entity makeXonoticListBox()
 {
        entity me;
-       me = spawnXonoticListBox();
+       me = NEW(XonoticListBox);
        me.configureXonoticListBox(me);
        return me;
 }
index 45a0f93dcc571fee3b676a596c8348f37bfadd76..76e71381d326314c75a6e0f37c141da57418021f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(MainWindow) EXTENDS(ModalController)
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+#include "../item/modalcontroller.qc"
+CLASS(MainWindow, ModalController)
        METHOD(MainWindow, configureMainWindow, void(entity))
        METHOD(MainWindow, draw, void(entity))
        ATTRIB(MainWindow, firstRunDialog, entity, NULL)
@@ -48,162 +50,162 @@ void MainWindow_configureMainWindow(entity me)
        entity n, i;
 
        // dialog run upon startup
-       me.firstRunDialog = i = spawnXonoticFirstRunDialog();
+       me.firstRunDialog = i = NEW(XonoticFirstRunDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
 
        // hud_configure dialogs
-       i = spawnXonoticHUDExitDialog();
+       i = NEW(XonoticHUDExitDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDNotificationDialog();
+       i = NEW(XonoticHUDNotificationDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDAmmoDialog();
+       i = NEW(XonoticHUDAmmoDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDHealthArmorDialog();
+       i = NEW(XonoticHUDHealthArmorDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDChatDialog();
+       i = NEW(XonoticHUDChatDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDModIconsDialog();
+       i = NEW(XonoticHUDModIconsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDPowerupsDialog();
+       i = NEW(XonoticHUDPowerupsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDPressedKeysDialog();
+       i = NEW(XonoticHUDPressedKeysDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDRaceTimerDialog();
+       i = NEW(XonoticHUDRaceTimerDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDRadarDialog();
+       i = NEW(XonoticHUDRadarDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDScoreDialog();
+       i = NEW(XonoticHUDScoreDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDTimerDialog();
+       i = NEW(XonoticHUDTimerDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDVoteDialog();
+       i = NEW(XonoticHUDVoteDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDWeaponsDialog();
+       i = NEW(XonoticHUDWeaponsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDEngineInfoDialog();
+       i = NEW(XonoticHUDEngineInfoDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDInfoMessagesDialog();
+       i = NEW(XonoticHUDInfoMessagesDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDPhysicsDialog();
+       i = NEW(XonoticHUDPhysicsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
+       me.screenshotViewerDialog = i = NEW(XonoticScreenshotViewerDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDCenterprintDialog();
+       i = NEW(XonoticHUDCenterprintDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticHUDBuffsDialog();
+       i = NEW(XonoticHUDBuffsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
 
        // dialogs used by settings
-       me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
+       me.userbindEditDialog = i = NEW(XonoticUserbindEditDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.cvarsDialog = i = spawnXonoticCvarsDialog();
+       me.cvarsDialog = i = NEW(XonoticCvarsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.resetDialog = i = spawnXonoticResetDialog();
+       me.resetDialog = i = NEW(XonoticResetDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
+       me.languageWarningDialog = i = NEW(XonoticLanguageWarningDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
+       me.hudconfirmDialog = i = NEW(XonoticHUDConfirmDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
 
        // dialog used by singleplayer
-       me.winnerDialog = i = spawnXonoticWinnerDialog();
+       me.winnerDialog = i = NEW(XonoticWinnerDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
 
        // dialog used by multiplayer/join
-       me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
+       me.serverInfoDialog = i = NEW(XonoticServerInfoDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.demostartconfirmDialog = i = spawnXonoticDemoStartConfirmDialog();
+       me.demostartconfirmDialog = i = NEW(XonoticDemoStartConfirmDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.demotimeconfirmDialog = i = spawnXonoticDemoTimeConfirmDialog();
+       me.demotimeconfirmDialog = i = NEW(XonoticDemoTimeConfirmDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
 
        // dialogs used by multiplayer/create
-       me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
+       me.mapInfoDialog = i = NEW(XonoticMapInfoDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
+       me.mutatorsDialog = i = NEW(XonoticMutatorsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
        // mutator dialogs
-       i = spawnXonoticSandboxToolsDialog();
+       i = NEW(XonoticSandboxToolsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
 
 
        // miscellaneous dialogs
-       i = spawnXonoticTeamSelectDialog();
+       i = NEW(XonoticTeamSelectDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       i = spawnXonoticMonsterToolsDialog();
+       i = NEW(XonoticMonsterToolsDialog);
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
 
 
        // main dialogs/windows
-       me.mainNexposee = n = spawnXonoticNexposee();
+       me.mainNexposee = n = NEW(XonoticNexposee);
        /*
                if(checkextension("DP_GECKO_SUPPORT"))
                {
@@ -213,28 +215,28 @@ void MainWindow_configureMainWindow(entity me)
                        n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
                }
        */
-               i = spawnXonoticSingleplayerDialog();
+               i = NEW(XonoticSingleplayerDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
 
-               i = spawnXonoticMultiplayerDialog();
+               i = NEW(XonoticMultiplayerDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
 
-               i = spawnXonoticSettingsDialog();
+               i = NEW(XonoticSettingsDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
 
-               i = spawnXonoticCreditsDialog();
+               i = NEW(XonoticCreditsDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
                n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
 
-               i = spawnXonoticQuitDialog();
+               i = NEW(XonoticQuitDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
index d88ad0e8e6747beddf8296226b33a7d03fad2289..ec9aa1f4c7bc104216e3329d0d4c710e88c4e95b 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticMapList) EXTENDS(XonoticListBox)
+#ifndef MAPLIST_H
+#define MAPLIST_H
+#include "listbox.qc"
+CLASS(XonoticMapList, XonoticListBox)
        METHOD(XonoticMapList, configureXonoticMapList, void(entity))
        ATTRIB(XonoticMapList, rowsPerItem, float, 4)
        METHOD(XonoticMapList, draw, void(entity))
@@ -40,7 +42,7 @@ CLASS(XonoticMapList) EXTENDS(XonoticListBox)
 
        METHOD(XonoticMapList, destroy, void(entity))
 
-       ATTRIB(XonoticListBox, alphaBG, float, 0)
+       ATTRIB(XonoticMapList, alphaBG, float, 0)
 ENDCLASS(XonoticMapList)
 entity makeXonoticMapList();
 void MapList_All(entity btn, entity me);
@@ -57,7 +59,7 @@ void XonoticMapList_destroy(entity me)
 entity makeXonoticMapList()
 {
        entity me;
-       me = spawnXonoticMapList();
+       me = NEW(XonoticMapList);
        me.configureXonoticMapList(me);
        return me;
 }
index b375393c02a30047a31ed6442a0c7d16d6bc4a5a..966b11a988a0e9fbb2604c682dafea668a113255 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticNexposee) EXTENDS(Nexposee)
+#ifndef NEXPOSEE_H
+#define NEXPOSEE_H
+#include "../item/nexposee.qc"
+CLASS(XonoticNexposee, Nexposee)
        METHOD(XonoticNexposee, configureXonoticNexposee, void(entity))
        METHOD(XonoticNexposee, close, void(entity))
 ENDCLASS(XonoticNexposee)
@@ -10,7 +12,7 @@ entity makeXonoticNexposee();
 entity makeXonoticNexposee()
 {
        entity me;
-       me = spawnXonoticNexposee();
+       me = NEW(XonoticNexposee);
        me.configureXonoticNexposee(me);
        return me;
 }
index d4dc5af05df05e60fa6eaec11eaa50ff45e85365..437206b881352bbd59cff5caade6eade963125a8 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticPlayerList) EXTENDS(XonoticListBox)
+#ifndef PLAYERLIST_H
+#define PLAYERLIST_H
+#include "listbox.qc"
+CLASS(XonoticPlayerList, XonoticListBox)
        ATTRIB(XonoticPlayerList, rowsPerItem, float, 1)
        METHOD(XonoticPlayerList, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(XonoticPlayerList, drawListBoxItem, void(entity, float, vector, float))
@@ -30,7 +32,7 @@ const float PLAYERPARM_COUNT = 4;
 entity makeXonoticPlayerList()
 {
        entity me;
-       me = spawnXonoticPlayerList();
+       me = NEW(XonoticPlayerList);
        me.configureXonoticListBox(me);
        return me;
 }
index f498f8d2133cf01628bb8b4518bacc51e2588641..760e8f93d9c7c99a77e6230a5e5047363b502dfa 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticPlayerModelSelector) EXTENDS(XonoticImage)
+#ifndef PLAYERMODEL_H
+#define PLAYERMODEL_H
+#include "image.qc"
+CLASS(XonoticPlayerModelSelector, XonoticImage)
        METHOD(XonoticPlayerModelSelector, configureXonoticPlayerModelSelector, void(entity))
        METHOD(XonoticPlayerModelSelector, loadCvars, void(entity))
        METHOD(XonoticPlayerModelSelector, saveCvars, void(entity))
@@ -31,7 +33,7 @@ void PlayerModelSelector_Prev_Click(entity btn, entity me);
 entity makeXonoticPlayerModelSelector()
 {
        entity me;
-       me = spawnXonoticPlayerModelSelector();
+       me = NEW(XonoticPlayerModelSelector);
        me.configureXonoticPlayerModelSelector(me);
        return me;
 }
index fbe3c92c6793f03d25d3bede3118f9ccfd533857..e912f8f081a4c2e3b45e7b0a6ff653c02c1a6ae4 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticPlayList) EXTENDS(XonoticListBox)
+#ifndef PLAYLIST_H
+#define PLAYLIST_H
+#include "listbox.qc"
+CLASS(XonoticPlayList, XonoticListBox)
        METHOD(XonoticPlayList, configureXonoticPlayList, void(entity))
        ATTRIB(XonoticPlayList, rowsPerItem, float, 1)
        METHOD(XonoticPlayList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -42,7 +44,7 @@ void NextSound_Click(entity btn, entity me);
 entity makeXonoticPlayList()
 {
        entity me;
-       me = spawnXonoticPlayList();
+       me = NEW(XonoticPlayList);
        me.configureXonoticPlayList(me);
        return me;
 }
index 85cc4fc5c559a3c56125fcce05e8aef6f1f7bf6e..05c8238d488b8b460cb6277dcefde8604ce967e1 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticRadioButton) EXTENDS(RadioButton)
+#ifndef RADIOBUTTON_H
+#define RADIOBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticRadioButton, RadioButton)
        METHOD(XonoticRadioButton, configureXonoticRadioButton, void(entity, float, string, string, string))
        METHOD(XonoticRadioButton, draw, void(entity))
        METHOD(XonoticRadioButton, setChecked, void(entity, float))
@@ -27,7 +29,7 @@ entity makeXonoticRadioButton(float, string, string, string);
 entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
 {
        entity me;
-       me = spawnXonoticRadioButton();
+       me = NEW(XonoticRadioButton);
        me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText);
        return me;
 }
index e8c9db364e9d3caaa31f4ee904b82ebc08c33523..209fcade83d408af69ab57a4b8c727ba78d91810 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticRootDialog) EXTENDS(XonoticDialog)
+#ifndef ROOTDIALOG_H
+#define ROOTDIALOG_H
+#include "dialog.qc"
+CLASS(XonoticRootDialog, XonoticDialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
index a800a849486aceae4d7651f2adbaf41a4c36db40..f2eb0b00d7ee6596afe0b9b0cbe62d9a826adee9 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticScreenshotImage) EXTENDS(XonoticImage)
+#ifndef SCREENSHOTIMAGE_H
+#define SCREENSHOTIMAGE_H
+#include "image.qc"
+CLASS(XonoticScreenshotImage, XonoticImage)
        METHOD(XonoticScreenshotImage, configureXonoticScreenshotImage, void(entity))
        METHOD(XonoticScreenshotImage, load, void(entity, string))
        METHOD(XonoticScreenshotImage, draw, void(entity))
@@ -21,7 +23,7 @@ entity makeXonoticScreenshotImage();
 entity makeXonoticScreenshotImage()
 {
        entity me;
-       me = spawnXonoticScreenshotImage();
+       me = NEW(XonoticScreenshotImage);
        me.configureXonoticScreenshotImage(me);
        return me;
 }
index 225eefb249d1660579047ed82d775660dbefee41..650b3381fd5defa893145a8841184b570bc0eeee 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticScreenshotList) EXTENDS(XonoticListBox)
+#ifndef SCREENSHOTLIST_H
+#define SCREENSHOTLIST_H
+#include "listbox.qc"
+CLASS(XonoticScreenshotList, XonoticListBox)
        METHOD(XonoticScreenshotList, configureXonoticScreenshotList, void(entity))
        ATTRIB(XonoticScreenshotList, rowsPerItem, float, 1)
        METHOD(XonoticScreenshotList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -49,7 +51,7 @@ void ScreenshotList_Filter_Change(entity box, entity me);
 entity makeXonoticScreenshotList()
 {
        entity me;
-       me = spawnXonoticScreenshotList();
+       me = NEW(XonoticScreenshotList);
        me.configureXonoticScreenshotList(me);
        return me;
 }
index 29877c5d5e888a8c16a9469ab480580176e018a2..3f9648be66566f57ca681862ae82e1f9d4aa4ea5 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticServerList) EXTENDS(XonoticListBox)
+#ifndef SERVERLIST_H
+#define SERVERLIST_H
+#include "listbox.qc"
+CLASS(XonoticServerList, XonoticListBox)
        METHOD(XonoticServerList, configureXonoticServerList, void(entity))
        ATTRIB(XonoticServerList, rowsPerItem, float, 1)
        METHOD(XonoticServerList, draw, void(entity))
@@ -440,7 +442,7 @@ void ServerList_Update_favoriteButton(entity btn, entity me)
 entity makeXonoticServerList()
 {
        entity me;
-       me = spawnXonoticServerList();
+       me = NEW(XonoticServerList);
        me.configureXonoticServerList(me);
        return me;
 }
index 9990c83fe162ee2c2ab4f37ea7e1c43a1fcf24ce..936ca7baf1125253a3698b784b2fc433721a30d0 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSkinList) EXTENDS(XonoticListBox)
+#ifndef SKINLIST_H
+#define SKINLIST_H
+#include "listbox.qc"
+CLASS(XonoticSkinList, XonoticListBox)
        METHOD(XonoticSkinList, configureXonoticSkinList, void(entity))
        ATTRIB(XonoticSkinList, rowsPerItem, float, 4)
        METHOD(XonoticSkinList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -42,7 +44,7 @@ const float SKINPARM_COUNT = 4;
 entity makeXonoticSkinList()
 {
        entity me;
-       me = spawnXonoticSkinList();
+       me = NEW(XonoticSkinList);
        me.configureXonoticSkinList(me);
        return me;
 }
index d63fe1c336c8ae2d2577803b67bd12cbfe59b5cb..d95cac7e9eebedce1ddb3c4df75369e06b4a0251 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSlider) EXTENDS(Slider)
+#ifndef SLIDER_H
+#define SLIDER_H
+#include "../item/slider.qc"
+CLASS(XonoticSlider, Slider)
        METHOD(XonoticSlider, configureXonoticSlider, void(entity, float, float, float, string))
        METHOD(XonoticSlider, setValue, void(entity, float))
        ATTRIB(XonoticSlider, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -28,7 +30,7 @@ entity makeXonoticSlider(float, float, float, string);
 entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
 {
        entity me;
-       me = spawnXonoticSlider();
+       me = NEW(XonoticSlider);
        me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
        return me;
 }
index 07632320ed29d89da88f90d7e914c00576833b35..29d2a86ac94425cc4ce88f0da4107735368acd6a 100644 (file)
@@ -1,7 +1,9 @@
 #include "../../warpzonelib/mathlib.qh"
 
-#ifdef INTERFACE
-CLASS(XonoticDecibelsSlider) EXTENDS(XonoticSlider)
+#ifndef SLIDER_DECIBELS_H
+#define SLIDER_DECIBELS_H
+#include "slider.qc"
+CLASS(XonoticDecibelsSlider, XonoticSlider)
        METHOD(XonoticDecibelsSlider, loadCvars, void(entity))
        METHOD(XonoticDecibelsSlider, saveCvars, void(entity))
        METHOD(XonoticDecibelsSlider, valueToText, string(entity, float))
@@ -42,7 +44,7 @@ float fromDecibelOfSquare(float f, float mi)
 entity makeXonoticDecibelsSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
 {
        entity me;
-       me = spawnXonoticDecibelsSlider();
+       me = NEW(XonoticDecibelsSlider);
        me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
        return me;
 }
index 818dcb84b842c2ad2dd7c9b9456ecbbcd22e5e0b..9a098165e47eb4666c692a483255a4aced7eb0e7 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticParticlesSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_PARTICLES_H
+#define SLIDER_PARTICLES_H
+#include "textslider.qc"
+CLASS(XonoticParticlesSlider, XonoticTextSlider)
        METHOD(XonoticParticlesSlider, configureXonoticParticlesSlider, void(entity))
        METHOD(XonoticParticlesSlider, loadCvars, void(entity))
        METHOD(XonoticParticlesSlider, saveCvars, void(entity))
@@ -11,7 +13,7 @@ entity makeXonoticParticlesSlider();
 entity makeXonoticParticlesSlider()
 {
        entity me;
-       me = spawnXonoticParticlesSlider();
+       me = NEW(XonoticParticlesSlider);
        me.configureXonoticParticlesSlider(me);
        return me;
 }
index ddedc4bab2901e2cd077a60c475aef525f223e80..f663f7dd6d3be0f91f7a5cbffb87e9b3ec1af526 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticPicmipSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_PICMIP_H
+#define SLIDER_PICMIP_H
+#include "textslider.qc"
+CLASS(XonoticPicmipSlider, XonoticTextSlider)
        METHOD(XonoticPicmipSlider, configureXonoticPicmipSlider, void(entity))
        METHOD(XonoticPicmipSlider, draw, void(entity))
        METHOD(XonoticPicmipSlider, autofix, void(entity))
@@ -12,7 +14,7 @@ entity makeXonoticPicmipSlider(); // note: you still need to call addValue and c
 entity makeXonoticPicmipSlider()
 {
        entity me;
-       me = spawnXonoticPicmipSlider();
+       me = NEW(XonoticPicmipSlider);
        me.configureXonoticPicmipSlider(me);
        return me;
 }
index c1443628106e7b4b2947d8a86c669d6c2a2a5e88..3d1f8302f18695c902d61d3ae93987ea6dadd680 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticResolutionSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_RESOLUTION_H
+#define SLIDER_RESOLUTION_H
+#include "textslider.qc"
+CLASS(XonoticResolutionSlider, XonoticTextSlider)
        METHOD(XonoticResolutionSlider, configureXonoticResolutionSlider, void(entity))
        METHOD(XonoticResolutionSlider, loadResolutions, void(entity, float))
        METHOD(XonoticResolutionSlider, addResolution, void(entity, float, float, float))
@@ -83,7 +85,7 @@ float updateConwidths(float width, float height, float pixelheight)
 entity makeXonoticResolutionSlider()
 {
        entity me;
-       me = spawnXonoticResolutionSlider();
+       me = NEW(XonoticResolutionSlider);
        me.configureXonoticResolutionSlider(me);
        return me;
 }
index 39f91f933cf734ccdbee07587f8f9757e94c1f19..4d30c64f008a195502f1cbb12d0508ec7ddc017d 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticScoreboardFadeTimeSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_SBFADETIME_H
+#define SLIDER_SBFADETIME_H
+#include "textslider.qc"
+CLASS(XonoticScoreboardFadeTimeSlider, XonoticTextSlider)
        METHOD(XonoticScoreboardFadeTimeSlider, configureXonoticScoreboardFadeTimeSlider, void(entity))
        METHOD(XonoticScoreboardFadeTimeSlider, loadCvars, void(entity))
        METHOD(XonoticScoreboardFadeTimeSlider, saveCvars, void(entity))
@@ -11,7 +13,7 @@ entity makeXonoticScoreboardFadeTimeSlider();
 entity makeXonoticScoreboardFadeTimeSlider()
 {
        entity me;
-       me = spawnXonoticScoreboardFadeTimeSlider();
+       me = NEW(XonoticScoreboardFadeTimeSlider);
        me.configureXonoticScoreboardFadeTimeSlider(me);
        return me;
 }
index e443a53efb42ddcab91cd3d1df8804df0d8b0777..bba66d19d16a651f50ceb5be5ac5a4fd441e67c3 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticSoundList) EXTENDS(XonoticListBox)
+#ifndef SOUNDLIST_H
+#define SOUNDLIST_H
+#include "listbox.qc"
+CLASS(XonoticSoundList, XonoticListBox)
        METHOD(XonoticSoundList, configureXonoticSoundList, void(entity))
        ATTRIB(XonoticSoundList, rowsPerItem, float, 1)
        METHOD(XonoticSoundList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -38,7 +40,7 @@ void SoundList_Menu_Track_Reset(entity box, entity me);
 entity makeXonoticSoundList()
 {
        entity me;
-       me = spawnXonoticSoundList();
+       me = NEW(XonoticSoundList);
        me.configureXonoticSoundList(me);
        return me;
 }
index 99c850f13558e456d599b2ba333816748431dcba..1cf4a688e0b82e5ba4487bc1dc85301dfdaa9e1d 100644 (file)
@@ -1,8 +1,10 @@
 #include "../../common/counting.qh"
 #include "../../common/playerstats.qh"
 
-#ifdef INTERFACE
-CLASS(XonoticStatsList) EXTENDS(XonoticListBox)
+#ifndef STATSLIST_H
+#define STATSLIST_H
+#include "listbox.qc"
+CLASS(XonoticStatsList, XonoticListBox)
        METHOD(XonoticStatsList, configureXonoticStatsList, void(entity))
        ATTRIB(XonoticStatsList, rowsPerItem, float, 1.4)
        METHOD(XonoticStatsList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -32,7 +34,7 @@ entity makeXonoticStatsList();
 entity makeXonoticStatsList()
 {
        entity me;
-       me = spawnXonoticStatsList();
+       me = NEW(XonoticStatsList);
        me.configureXonoticStatsList(me);
        return me;
 }
index 663e8a2c72d1a614bfbfc35ede5fbda140d2fcdd..0383c7aae6fd53483ebb677486efceab44584b6f 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticTab) EXTENDS(Tab)
+#ifndef TAB_H
+#define TAB_H
+#include "../item/tab.qc"
+CLASS(XonoticTab, Tab)
        // still to be customized by user
        /*
        ATTRIB(XonoticTab, intendedWidth, float, 0)
index 1faa625aee83c607a4af8eab55117a0ddde091ea..c95424b177018ff2ac5ed1375531c0dac7e453de 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticTabController) EXTENDS(ModalController)
+#ifndef TABCONTROLLER_H
+#define TABCONTROLLER_H
+#include "../item/modalcontroller.qc"
+CLASS(XonoticTabController, ModalController)
        METHOD(XonoticTabController, configureXonoticTabController, void(entity, float))
        METHOD(XonoticTabController, makeTabButton, entity(entity, string, entity))
        ATTRIB(XonoticTabController, rows, float, 0)
@@ -13,7 +15,7 @@ entity makeXonoticTabController(float theRows);
 entity makeXonoticTabController(float theRows)
 {
        entity me;
-       me = spawnXonoticTabController();
+       me = NEW(XonoticTabController);
        me.configureXonoticTabController(me, theRows);
        return me;
 }
index cb54da19e21b81f901cea7d1e5c697ecfdbfe5d1..e33182f2dadf584316cf97dc5839d01fc171c515 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticTextLabel) EXTENDS(Label)
+#ifndef TEXTLABEL_H
+#define TEXTLABEL_H
+#include "../item/label.qc"
+CLASS(XonoticTextLabel, Label)
        METHOD(XonoticTextLabel, configureXonoticTextLabel, void(entity, float, string))
        METHOD(XonoticTextLabel, draw, void(entity))
        ATTRIB(XonoticTextLabel, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -7,13 +9,14 @@ CLASS(XonoticTextLabel) EXTENDS(Label)
        ATTRIB(XonoticTextLabel, disabledAlpha, float, SKINALPHA_DISABLED)
 ENDCLASS(XonoticTextLabel)
 entity makeXonoticTextLabel(float theAlign, string theText);
+entity makeXonoticHeaderLabel(string theText);
 #endif
 
 #ifdef IMPLEMENTATION
 entity makeXonoticTextLabel(float theAlign, string theText)
 {
        entity me;
-       me = spawnXonoticTextLabel();
+       me = NEW(XonoticTextLabel);
        me.configureXonoticTextLabel(me, theAlign, theText);
        return me;
 }
index dabd1b1a6bacba2fd479e2d2b6fba021661147b1..47d9eb44dc7fbaffa0fd310b868534f204cc2b90 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticTextSlider) EXTENDS(TextSlider)
+#ifndef TEXTSLIDER_H
+#define TEXTSLIDER_H
+#include "../item/textslider.qc"
+CLASS(XonoticTextSlider, TextSlider)
        METHOD(XonoticTextSlider, configureXonoticTextSlider, void(entity, string))
        METHOD(XonoticTextSlider, setValue, void(entity, float))
        METHOD(XonoticTextSlider, configureXonoticTextSliderValues, void(entity))
@@ -29,7 +31,7 @@ entity makeXonoticTextSlider(string); // note: you still need to call addValue a
 entity makeXonoticTextSlider(string theCvar)
 {
        entity me;
-       me = spawnXonoticTextSlider();
+       me = NEW(XonoticTextSlider);
        me.configureXonoticTextSlider(me, theCvar);
        return me;
 }
index 330b2bb726a0e89ccc19822ee8c8af0182b82e0e..444292712d1a968861d673f960441bd8d7d48347 100644 (file)
@@ -1,4 +1,12 @@
+#include "util.qh"
+#include "../menu.qh"
+#include "../oo/base.qh"
+#include "../../common/campaign_common.qh"
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
 #include "../../common/urllib.qh"
+#include "../../common/util.qh"
+#include "../../common/command/generic.qh"
 
 float GL_CheckExtension(string ext)
 {
@@ -43,6 +51,7 @@ string getZonedTooltipForIdentifier(string s)
        return string_null;
 }
 
+.entity parent, firstChild, nextSibling;
 void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
 {
        depthfirst(root, parent, firstChild, nextSibling, funcPre, funcPost, pass);
@@ -52,11 +61,15 @@ void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, e
 void SUB_Null_ee(entity e1, entity e2)
 {
 }
+
+.void(entity) saveCvars;
 void saveCvarsOf(entity ignore, entity e)
 {
        if(e.saveCvars)
                e.saveCvars(e);
 }
+
+.void(entity) loadCvars;
 void loadCvarsOf(entity ignore, entity e)
 {
        if(e.loadCvars)
@@ -135,6 +148,7 @@ void makeCallback(entity e, entity cbent, void(entity, entity) cbfunc)
 .string cvarString_setDependent;
 .string cvarValue_setDependent;
 .float(entity) func_setDependent;
+.bool disabled;
 void setDependent_Check(entity e)
 {
        float f;
@@ -181,6 +195,7 @@ void setDependent_Draw(entity e)
        setDependent_Check(e);
        e.draw_setDependent(e);
 }
+.void(entity) draw;
 void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
 {
        e.draw_setDependent = e.draw;
@@ -529,6 +544,8 @@ void postMenuDraw()
                draw_CenterText('0.5 0.1 0', sprintf(_("^1%s TEST BUILD"), autocvar_menu_watermark), globalToBoxSize('32 32 0', draw_scale), '1 1 1', 0.05, 1);
        }
 }
+void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize);
+.entity winnerDialog;
 void preMenuDraw()
 {
        vector fs, sz = '0 0 0', line, mid;
@@ -709,6 +726,18 @@ string GameType_GetIcon(int cnt)
        return "";
 }
 
+.void(entity) TR;
+.void(entity, float, float, entity) TD;
+.void(entity, float) TDempty;
+entity makeXonoticTextLabel(float theAlign, string theText);
+entity makeXonoticTextSlider(string);
+.void(entity, string, string) addValue;
+.void(entity) configureXonoticTextSliderValues;
+entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar);
+entity makeXonoticCheckBoxString(string, string, string, string);
+entity makeXonoticCheckBox(float, string, string);
+.bool sendCvars;
+
 void dialog_hudpanel_common_notoggle(entity me, string panelname)
 {
        float i;
index a7d71f0d2cf5db902dd9106f9e7985477ecd7453..2a8f3aa0332a2da23f409fe14a6217f989d2e19c 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticWeaponarenaCheckBox) EXTENDS(CheckBox)
+#ifndef WEAPONARENACHECKBOX_H
+#define WEAPONARENACHECKBOX_H
+#include "../item/checkbox.qc"
+CLASS(XonoticWeaponarenaCheckBox, CheckBox)
        METHOD(XonoticWeaponarenaCheckBox, configureXonoticWeaponarenaCheckBox, void(entity, string, string))
        METHOD(XonoticWeaponarenaCheckBox, setChecked, void(entity, float))
        ATTRIB(XonoticWeaponarenaCheckBox, fontSize, float, SKINFONTSIZE_NORMAL)
@@ -16,7 +18,7 @@ entity makeXonoticWeaponarenaCheckBox(string, string);
 entity makeXonoticWeaponarenaCheckBox(string theWeapon, string theText)
 {
        entity me;
-       me = spawnXonoticWeaponarenaCheckBox();
+       me = NEW(XonoticWeaponarenaCheckBox);
        me.configureXonoticWeaponarenaCheckBox(me, theWeapon, theText);
        return me;
 }
index 46d4e273f089004d503c074149e39d7da1f9e222..622505af838703e637330daa709687d61d073352 100644 (file)
@@ -1,5 +1,7 @@
-#ifdef INTERFACE
-CLASS(XonoticWeaponsList) EXTENDS(XonoticListBox)
+#ifndef WEAPONSLIST_H
+#define WEAPONSLIST_H
+#include "listbox.qc"
+CLASS(XonoticWeaponsList, XonoticListBox)
        METHOD(XonoticWeaponsList, configureXonoticWeaponsList, void(entity))
        METHOD(XonoticWeaponsList, toString, string(entity))
        ATTRIB(XonoticWeaponsList, rowsPerItem, float, 1)
@@ -20,7 +22,7 @@ void WeaponsList_MoveDown_Click(entity box, entity me);
 entity makeXonoticWeaponsList()
 {
        entity me;
-       me = spawnXonoticWeaponsList();
+       me = NEW(XonoticWeaponsList);
        me.configureXonoticWeaponsList(me);
        return me;
 }
diff --git a/qcsrc/server/_all.qh b/qcsrc/server/_all.qh
new file mode 100644 (file)
index 0000000..6438a10
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef SERVER___H
+#define SERVER___H
+
+#include "autocvars.qh"
+#include "constants.qh"
+#include "defs.qh"
+#include "miscfunctions.qh"
+
+#include "../dpdefs/progsdefs.qh"
+#include "../dpdefs/dpextensions.qh"
+
+#endif
index dab5fa30087248413d00907f4fea25b483bfffd7..1e6759684a593df5fea8690173ee76946d2b4fbe 100644 (file)
 
 void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
 {
-       if(weight == 0)
+       if (weight == 0)
                return;
-       if(mean == 0)
-               e.a *= pow(value, weight);
+       if (mean == 0)
+               e.(a) *= pow(value, weight);
        else
-               e.a += pow(value, mean) * weight;
-       e.c += weight;
+               e.(a) += pow(value, mean) * weight;
+       e.(c) += weight;
 }
 
 float mean_evaluate(entity e, .float a, .float c, float mean)
 {
-       if(e.c == 0)
+       if (e.(c) == 0)
                return 0;
-       if(mean == 0)
-               return pow(e.a, 1.0 / e.c);
+       if (mean == 0)
+               return pow(e.(a), 1.0 / e.(c));
        else
-               return pow(e.a / e.c, 1.0 / mean);
+               return pow(e.(a) / e.(c), 1.0 / mean);
 }
 
 #define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w)
index 6f8f0f487e0c7e811cd425d7ceb9da8dcc93ec63..f4fe2058b9790db8bba4c311597bb8940b6bb421 100644 (file)
@@ -3,7 +3,7 @@
 #elif defined(SVQC)
        #include "../dpdefs/progsdefs.qh"
     #include "../dpdefs/dpextensions.qh"
-    #include "vehicles/vehicles_def.qh"
+    #include "vehicles/vehicle.qh"
     #include "antilag.qh"
 #endif
 
@@ -65,10 +65,8 @@ vector lerpv(float t0, vector v0, float t1, vector v1, float t)
 
 vector antilag_takebackorigin(entity e, float t)
 {
-       float i0, i1;
-
-       i0 = antilag_find(e, t);
-       if(i0 < 0)
+       int i0 = antilag_find(e, t);
+       if (i0 < 0)
        {
                // IN THE PRESENT
                if(e.antilag_takenback)
@@ -76,8 +74,8 @@ vector antilag_takebackorigin(entity e, float t)
                else
                        return e.origin;
        }
-       i1 = i0 + 1;
-       if(i1 >= ANTILAG_MAX_ORIGINS)
+       int i1 = i0 + 1;
+       if (i1 >= ANTILAG_MAX_ORIGINS)
                i1 = 0;
 
        return lerpv(e.(antilag_times[i0]), e.(antilag_origins[i0]), e.(antilag_times[i1]), e.(antilag_origins[i1]), t);
@@ -127,10 +125,8 @@ void antilag_restore(entity e)
 
 void antilag_clear(entity e)
 {
-       float i;
-
        antilag_restore(e);
-       for(i = 0; i < ANTILAG_MAX_ORIGINS; ++i)
+       for (int i = 0; i < ANTILAG_MAX_ORIGINS; ++i)
        {
                e.(antilag_times[i]) = -2342;
                e.(antilag_origins[i]) = e.origin;
index b529ed1c32f2899650b7dd498024f2b5b6bb0929..320257fa1908286430b2d05ebe9d3f696e3e7748 100644 (file)
@@ -1,3 +1,9 @@
+#include "aim.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+
+#include "../mutators/mutators_include.qh"
 
 // traces multiple trajectories to find one that will impact the target
 // 'end' vector is the place it aims for,
index fb191a91cce7e61f9f0c930d78c85a988bfd979b..d1cbd0d629a71368ed5b8ea74fe26b4a73ea245d 100644 (file)
@@ -86,6 +86,7 @@ vector shotdir;
  * Functions
  */
 
+float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4);
 void lag_update();
 void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4);
 
index 0acd32993595139f9a777ba74b527a1c574ee7a2..1879b186047181f39f509e7dc059d9fdd7e706f1 100644 (file)
@@ -1,37 +1,41 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../warpzonelib/common.qh"
-    #include "../../warpzonelib/util_server.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/teams.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "../weapons/accuracy.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../campaign.qh"
-    #include "../../common/mapinfo.qh"
-    #include "../../csqcmodellib/sv_model.qh"
-    #include "../antilag.qh"
-#endif
-
 #include "bot.qh"
+#include "../_all.qh"
+
 #include "aim.qh"
 #include "navigation.qh"
+#include "scripting.qh"
 #include "waypoints.qh"
 
-#include "aim.qc"
-#include "navigation.qc"
-#include "waypoints.qc"
-#include "scripting.qc"
+#include "havocbot/havocbot.qh"
+#include "havocbot/scripting.qh"
+
+#include "../antilag.qh"
+#include "../autocvars.qh"
+#include "../campaign.qh"
+#include "../cl_client.qh"
+#include "../constants.qh"
+#include "../defs.qh"
+#include "../race.qh"
+#include "../t_items.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#include "../weapons/accuracy.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+
+#include "../../common/weapons/weapons.qh"
+
+#include "../../csqcmodellib/sv_model.qh"
+
+#include "../../dpdefs/dpextensions.qh"
+#include "../../dpdefs/progsdefs.qh"
 
-#include "havocbot/havocbot.qc"
+#include "../../warpzonelib/common.qh"
+#include "../../warpzonelib/util_server.qh"
 
 entity bot_spawn()
 {
index bcae58dc181e0c89b9db7ef02e729d2660516e04..ac89f06a7382dc91aec1d68427af2b4b0a6269c1 100644 (file)
@@ -91,6 +91,7 @@ float bot_ignore_bots; // let bots not attack other bots (only works in non-team
  */
 
 entity bot_spawn();
+float bot_fixcount();
 
 void bot_think();
 void bot_setnameandstuff();
index 0ecafaf1e87c7aa62fda4892d2c38ef300e05683..dfb615d03715ecd4e3ee5f5b5fb2ea32a6c4b497 100644 (file)
@@ -1,7 +1,15 @@
 #include "havocbot.qh"
-#include "role_onslaught.qc"
-#include "role_keyhunt.qc"
-#include "roles.qc"
+#include "../../_all.qh"
+
+#include "../aim.qh"
+#include "../bot.qh"
+#include "../navigation.qh"
+#include "../scripting.qh"
+#include "../waypoints.qh"
+
+#include "../../../common/constants.qh"
+
+#include "../../../warpzonelib/common.qh"
 
 void havocbot_ai()
 {
@@ -148,9 +156,6 @@ void havocbot_ai()
        // if the bot is not attacking, consider reloading weapons
        if (!(self.aistatus & AI_STATUS_ATTACKING))
        {
-               float i;
-               entity e;
-
                // we are currently holding a weapon that's not fully loaded, reload it
                if(skill >= 2) // bots can only reload the held weapon on purpose past this skill
                if(self.clip_load < self.clip_size)
@@ -161,9 +166,9 @@ void havocbot_ai()
                if(skill >= 5) // bots can only look for unloaded weapons past this skill
                if(self.clip_load >= 0) // only if we're not reloading a weapon already
                {
-                       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+                       for (int i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
-                               e = get_weaponinfo(i);
+                               entity e = get_weaponinfo(i);
                                if ((self.weapons & WepSet_FromWeapon(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < e.reloading_ammo))
                                        self.switchweapon = i;
                        }
index 3b641d9ce757762c430d03be58e9b4e948dc90ea..ea163f4efb56cdd0f9e67b339206573fbe48cedf 100644 (file)
@@ -1,10 +1,18 @@
+#include "role_keyhunt.qh"
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
+
+#include "../../mutators/mutators_include.qh"
+
 void() havocbot_role_kh_carrier;
 void() havocbot_role_kh_defense;
 void() havocbot_role_kh_offense;
 void() havocbot_role_kh_freelancer;
 
-entity kh_worldkeylist;
-.entity kh_worldkeynext;
 
 void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, float ratingscale_enemy)
 {
diff --git a/qcsrc/server/bot/havocbot/role_keyhunt.qh b/qcsrc/server/bot/havocbot/role_keyhunt.qh
new file mode 100644 (file)
index 0000000..f3136c6
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ROLE_KEYHUNT_H
+#define ROLE_KEYHUNT_H
+
+entity kh_worldkeylist;
+.entity kh_worldkeynext;
+
+void havocbot_chooserole_kh();
+#endif
index 119ea83c81b77c90b659518bf03a601d49f2f360..6924f5122949e8edf715cded97d9c9ea6e98f159 100644 (file)
@@ -1,3 +1,15 @@
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
+#include "../waypoints.qh"
+
+#include "../../mutators/mutators_include.qh"
+
+#include "../../../common/teams.qh"
+
 const int HAVOCBOT_ONS_ROLE_NONE               = 0;
 const int HAVOCBOT_ONS_ROLE_DEFENSE    = 2;
 const int HAVOCBOT_ONS_ROLE_ASSISTANT  = 4;
diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qh b/qcsrc/server/bot/havocbot/role_onslaught.qh
new file mode 100644 (file)
index 0000000..3fca678
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef ROLE_ONSLAUGHT_H
+#define ROLE_ONSLAUGHT_H
+void havocbot_chooserole_ons();
+#endif
index af219b8ec730272f85f334402ea9c8cc4dc229f4..65ea2a809b6be9d105d88ab5d1bd272952bf9028 100644 (file)
@@ -1,3 +1,11 @@
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+#include "role_keyhunt.qh"
+#include "role_onslaught.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
 
 .float max_armorvalue;
 .float havocbot_role_timeout;
diff --git a/qcsrc/server/bot/havocbot/roles.qh b/qcsrc/server/bot/havocbot/roles.qh
new file mode 100644 (file)
index 0000000..cfabf05
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef ROLES_H
+#define ROLES_H
+void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius);
+#endif
diff --git a/qcsrc/server/bot/havocbot/scripting.qh b/qcsrc/server/bot/havocbot/scripting.qh
new file mode 100644 (file)
index 0000000..c09dbde
--- /dev/null
@@ -0,0 +1,5 @@
+#ifndef HAVOCBOT_SCRIPTING_H
+#define HAVOCBOT_SCRIPTING_H
+
+void bot_clearqueue(entity bot);
+#endif
index d80f8336c8ba179bd52e862bc2807181d92efebc..3c3f135cc4d35be6c9b2af1db02d5aada325983d 100644 (file)
@@ -1,3 +1,13 @@
+#include "navigation.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+#include "waypoints.qh"
+
+#include "../t_items.qh"
+
+#include "../../common/constants.qh"
+
 void bot_debug(string input)
 {
        switch(autocvar_bot_debug)
index 08e1c53ac88d4fb8304076157bd4a95e88ea8f9b..cf4a5ce5b261dcf6c4e154bef405c480d85a2afb 100644 (file)
@@ -76,4 +76,5 @@ void navigation_unstuck();
 void botframe_updatedangerousobjects(float maxupdate);
 
 entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
+float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist);
 #endif
index ead8ceac9ec5c3adba637e35df67207f6abc6391..b1425c1a821dadaf447b5d291c539079e3fc83bb 100644 (file)
@@ -1,3 +1,8 @@
+#include "scripting.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+
 .float bot_cmdqueuebuf_allocated;
 .float bot_cmdqueuebuf;
 .float bot_cmdqueuebuf_start;
@@ -137,68 +142,6 @@ entity bot_getplace(string placename)
 }
 
 
-// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
-const int BOT_CMD_NULL                         = 0;
-const int BOT_CMD_PAUSE                = 1;
-const int BOT_CMD_CONTINUE             = 2;
-const int BOT_CMD_WAIT                         = 3;
-const int BOT_CMD_TURN                         = 4;
-const int BOT_CMD_MOVETO               = 5;
-const int BOT_CMD_RESETGOAL    = 6;    // Not implemented yet
-const int BOT_CMD_CC                   = 7;
-const int BOT_CMD_IF                   = 8;
-const int BOT_CMD_ELSE                         = 9;
-const int BOT_CMD_FI                   = 10;
-const int BOT_CMD_RESETAIM             = 11;
-const int BOT_CMD_AIM                  = 12;
-const int BOT_CMD_PRESSKEY             = 13;
-const int BOT_CMD_RELEASEKEY   = 14;
-const int BOT_CMD_SELECTWEAPON         = 15;
-const int BOT_CMD_IMPULSE              = 16;
-const int BOT_CMD_WAIT_UNTIL   = 17;
-const int BOT_CMD_MOVETOTARGET         = 18;
-const int BOT_CMD_AIMTARGET    = 19;
-const int BOT_CMD_BARRIER              = 20;
-const int BOT_CMD_CONSOLE              = 21;
-const int BOT_CMD_SOUND                = 22;
-const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
-const int BOT_CMD_WHILE                = 24;   // TODO: Not implemented yet
-const int BOT_CMD_WEND                         = 25;   // TODO: Not implemented yet
-const int BOT_CMD_CHASE                = 26;   // TODO: Not implemented yet
-
-const int BOT_CMD_COUNTER              = 24;   // Update this value if you add/remove a command
-
-// NOTE: Following commands should be implemented on the bot ai
-//              If a new command should be handled by the target ai(s) please declare it here
-.float(vector) cmd_moveto;
-.float() cmd_resetgoal;
-
-//
-const int BOT_CMD_PARAMETER_NONE = 0;
-const int BOT_CMD_PARAMETER_FLOAT = 1;
-const int BOT_CMD_PARAMETER_STRING = 2;
-const int BOT_CMD_PARAMETER_VECTOR = 3;
-
-float bot_cmds_initialized;
-int bot_cmd_parm_type[BOT_CMD_COUNTER];
-string bot_cmd_string[BOT_CMD_COUNTER];
-
-// Bots command queue
-entity bot_cmd;        // global current command
-.entity bot_cmd_current; // current command of this bot
-
-.float is_bot_cmd;                     // Tells if the entity is a bot command
-.float bot_cmd_index;                  // Position of the command in the queue
-.int bot_cmd_type;                     // If of command (see the BOT_CMD_* defines)
-.float bot_cmd_parm_float;             // Field to store a float parameter
-.string bot_cmd_parm_string;           // Field to store a string parameter
-.vector bot_cmd_parm_vector;           // Field to store a vector parameter
-
-float bot_barriertime;
-.float bot_barrier;
-
-.float bot_cmd_execution_index;                // Position in the queue of the command to be executed
-
 // Initialize global commands list
 // NOTE: New commands should be initialized here
 void bot_commands_init()
@@ -529,14 +472,6 @@ void bot_list_commands()
 // Commands code
 .int bot_exec_status;
 
-#define BOT_EXEC_STATUS_IDLE   0
-#define BOT_EXEC_STATUS_PAUSED 1
-#define BOT_EXEC_STATUS_WAITING        2
-
-#define CMD_STATUS_EXECUTING   0
-#define CMD_STATUS_FINISHED    1
-#define CMD_STATUS_ERROR       2
-
 void SV_ParseClientCommand(string s);
 float bot_cmd_cc()
 {
@@ -1215,7 +1150,6 @@ void bot_setcurrentcommand()
 void bot_resetqueues()
 {
        entity cl;
-       float i;
 
        FOR_EACH_CLIENT(cl) if(cl.isbot)
        {
@@ -1223,7 +1157,7 @@ void bot_resetqueues()
                bot_clearqueue(cl);
                // also, cancel all barriers
                cl.bot_barrier = 0;
-               for(i = 0; i < cl.bot_places_count; ++i)
+               for(int i = 0; i < cl.bot_places_count; ++i)
                {
                        strunzone(cl.(bot_placenames[i]));
                        cl.(bot_placenames[i]) = string_null;
diff --git a/qcsrc/server/bot/scripting.qh b/qcsrc/server/bot/scripting.qh
new file mode 100644 (file)
index 0000000..d5cdda9
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef BOT_SCRIPTING_H
+#define BOT_SCRIPTING_H
+
+#define BOT_EXEC_STATUS_IDLE 0
+#define BOT_EXEC_STATUS_PAUSED 1
+#define BOT_EXEC_STATUS_WAITING 2
+
+#define CMD_STATUS_EXECUTING 0
+#define CMD_STATUS_FINISHED 1
+#define CMD_STATUS_ERROR 2
+
+
+// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
+const int BOT_CMD_NULL                         = 0;
+const int BOT_CMD_PAUSE                = 1;
+const int BOT_CMD_CONTINUE             = 2;
+const int BOT_CMD_WAIT                         = 3;
+const int BOT_CMD_TURN                         = 4;
+const int BOT_CMD_MOVETO               = 5;
+const int BOT_CMD_RESETGOAL    = 6;    // Not implemented yet
+const int BOT_CMD_CC                   = 7;
+const int BOT_CMD_IF                   = 8;
+const int BOT_CMD_ELSE                         = 9;
+const int BOT_CMD_FI                   = 10;
+const int BOT_CMD_RESETAIM             = 11;
+const int BOT_CMD_AIM                  = 12;
+const int BOT_CMD_PRESSKEY             = 13;
+const int BOT_CMD_RELEASEKEY   = 14;
+const int BOT_CMD_SELECTWEAPON         = 15;
+const int BOT_CMD_IMPULSE              = 16;
+const int BOT_CMD_WAIT_UNTIL   = 17;
+const int BOT_CMD_MOVETOTARGET         = 18;
+const int BOT_CMD_AIMTARGET    = 19;
+const int BOT_CMD_BARRIER              = 20;
+const int BOT_CMD_CONSOLE              = 21;
+const int BOT_CMD_SOUND                = 22;
+const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
+const int BOT_CMD_WHILE                = 24;   // TODO: Not implemented yet
+const int BOT_CMD_WEND                         = 25;   // TODO: Not implemented yet
+const int BOT_CMD_CHASE                = 26;   // TODO: Not implemented yet
+
+const int BOT_CMD_COUNTER              = 24;   // Update this value if you add/remove a command
+
+// NOTE: Following commands should be implemented on the bot ai
+//              If a new command should be handled by the target ai(s) please declare it here
+.float(vector) cmd_moveto;
+.float() cmd_resetgoal;
+
+//
+const int BOT_CMD_PARAMETER_NONE = 0;
+const int BOT_CMD_PARAMETER_FLOAT = 1;
+const int BOT_CMD_PARAMETER_STRING = 2;
+const int BOT_CMD_PARAMETER_VECTOR = 3;
+
+float bot_cmds_initialized;
+int bot_cmd_parm_type[BOT_CMD_COUNTER];
+string bot_cmd_string[BOT_CMD_COUNTER];
+
+// Bots command queue
+entity bot_cmd;        // global current command
+.entity bot_cmd_current; // current command of this bot
+
+.float is_bot_cmd;                     // Tells if the entity is a bot command
+.float bot_cmd_index;                  // Position of the command in the queue
+.int bot_cmd_type;                     // If of command (see the BOT_CMD_* defines)
+.float bot_cmd_parm_float;             // Field to store a float parameter
+.string bot_cmd_parm_string;           // Field to store a string parameter
+.vector bot_cmd_parm_vector;           // Field to store a vector parameter
+
+float bot_barriertime;
+.float bot_barrier;
+
+.float bot_cmd_execution_index;                // Position in the queue of the command to be executed
+
+
+void bot_resetqueues();
+void bot_queuecommand(entity bot, string cmdstring);
+void bot_cmdhelp(string scmd);
+void bot_list_commands();
+float bot_execute_commands();
+entity find_bot_by_name(string name);
+entity find_bot_by_number(float number);
+#endif
index 23e7af3f9242061e5ffeadd5a0d0d924c569052d..9e45474dadef57aaee49708f405cd32eaf944b73 100644 (file)
@@ -1,3 +1,15 @@
+#include "waypoints.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+#include "navigation.qh"
+
+#include "../antilag.qh"
+
+#include "../../common/constants.qh"
+
+#include "../../warpzonelib/util_server.qh"
+
 // create a new spawnfunc_waypoint and automatically link it to other waypoints, and link
 // them back to it as well
 // (suitable for spawnfunc_waypoint editor)
@@ -893,7 +905,7 @@ float botframe_autowaypoints_createwp(vector v, entity p, .entity fld, float f)
                w = find(w, classname, "waypoint");
        }
 
-       waypoint_schedulerelink(p.fld = waypoint_spawn(v, v, f));
+       waypoint_schedulerelink(p.(fld) = waypoint_spawn(v, v, f));
        return 1;
 }
 
@@ -948,14 +960,14 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
                                                if(navigation_waypoint_will_link(w.origin, porg, p, walkfromwp, 1050))
                                                {
                                                        bestdist = d;
-                                                       p.fld = w;
+                                                       p.(fld) = w;
                                                }
                        }
                        w = find(w, classname, "waypoint");
                }
                if(bestdist < maxdist)
                {
-                       print("update chain to new nearest WP ", etos(p.fld), "\n");
+                       print("update chain to new nearest WP ", etos(p.(fld)), "\n");
                        return 0;
                }
 
@@ -964,7 +976,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
                        // we know maxdist < 2100
                        // so wp -> porg is still valid
                        // all is good
-                       p.fld = wp;
+                       p.(fld) = wp;
                        return 0;
                }
 
@@ -978,7 +990,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
                setorigin(p, save);
                if(w)
                {
-                       p.fld = w;
+                       p.(fld) = w;
                        return 0;
                }
        }
@@ -1043,8 +1055,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
 .entity botframe_autowaypoints_lastwp0, botframe_autowaypoints_lastwp1;
 void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld)
 {
-       float r;
-       r = botframe_autowaypoints_fix_from(p, walkfromwp, p.fld, fld);
+       float r = botframe_autowaypoints_fix_from(p, walkfromwp, p.(fld), fld);
        if(r != -1)
                return;
        r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld);
index 657ec4d7fd3c0e15f6477c5a56c766b5a5effcb1..75a93d267d6b05fe5026f46a28f10913874fd055 100644 (file)
@@ -1,26 +1,26 @@
 #include "cheats.qh"
+#include "_all.qh"
+
 #include "g_damage.qh"
 #include "race.qh"
 #include "t_teleporters.qh"
 
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/anglestransform.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "../common/monsters/monsters.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "weapons/tracing.qh"
-    #include "autocvars.qh"
-    #include "defs.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
-    #include "../csqcmodellib/sv_model.qh"
-#endif
+#include "mutators/mutators_include.qh"
+
+#include "weapons/tracing.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/util.qh"
+
+#include "../common/monsters/monsters.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/util_server.qh"
 
 void CopyBody(float keepvelocity);
 
@@ -40,15 +40,7 @@ void Drag_MoveDrag(entity from, entity to) { }
 .float maycheat;
 float gamestart_sv_cheats;
 
-const float CHIMPULSE_SPEEDRUN_INIT = 30;
-const float CHIMPULSE_GIVE_ALL = 99;
-const float CHIMPULSE_CLONE_MOVING = 140;
-const float CHIMPULSE_SPEEDRUN = 141;
-const float CHIMPULSE_CLONE_STANDING = 142;
-const float CHIMPULSE_TELEPORT = 143;
-const float CHIMPULSE_R00T = 148;
 
-const float CHRAME_DRAG = 8;
 
 void CheatInit()
 {
index 625a304bd51f99ce3539942cd58d5a47f3c4aff3..f200c4c867bc5afc73e7c3eb86483a38e7f621ed 100644 (file)
@@ -13,5 +13,15 @@ float CheatImpulse(float i);
 float CheatCommand(float argc);
 float CheatFrame();
 
+const float CHIMPULSE_SPEEDRUN_INIT = 30;
+const float CHIMPULSE_GIVE_ALL = 99;
+const float CHIMPULSE_CLONE_MOVING = 140;
+const float CHIMPULSE_SPEEDRUN = 141;
+const float CHIMPULSE_CLONE_STANDING = 142;
+const float CHIMPULSE_TELEPORT = 143;
+const float CHIMPULSE_R00T = 148;
+
+const float CHRAME_DRAG = 8;
+
 void Drag_MoveDrag(entity from, entity to); // call this from CopyBody
 #endif
index 222e0291337ea9c52fdf357799a5ecb7ad99e577..259b7e260c3d2025707bb6e83f5964fda5cac480 100644 (file)
@@ -1,5 +1,8 @@
+#include "cl_client.qh"
+
 #include "waypointsprites.qh"
 
+#include "anticheat.qh"
 #include "cl_impulse.qh"
 #include "cl_player.qh"
 #include "ent_cs.qh"
 #include "teamplay.qh"
 #include "playerdemo.qh"
 #include "secret.qh"
+#include "spawnpoints.qh"
+#include "g_damage.qh"
+#include "g_hook.qh"
+#include "t_teleporters.qh"
+#include "command/common.qh"
+#include "cheats.qh"
+#include "g_world.qh"
+#include "race.qh"
+#include "antilag.qh"
+#include "campaign.qh"
+#include "command/common.qh"
 
 #include "bot/bot.qh"
 #include "bot/navigation.qh"
 
+#include "vehicles/vehicle.qh"
+
 #include "weapons/hitplot.qh"
 #include "weapons/weaponsystem.qh"
 
@@ -23,7 +39,6 @@
 
 #include "../warpzonelib/server.qh"
 
-float c1, c2, c3, c4;
 
 void send_CSQC_teamnagger() {
        WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
@@ -409,7 +424,6 @@ void PutClientInServer (void)
        if(IS_PLAYER(self))
        {
                entity spot, oldself;
-               float j;
 
                accuracy_resend(self);
 
@@ -598,13 +612,13 @@ void PutClientInServer (void)
                target_voicescript_clear(self);
 
                // reset fields the weapons may use
-               for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+               for (int j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        WEP_ACTION(j, WR_RESETPLAYER);
 
                        // all weapons must be fully loaded when we spawn
                        entity e = get_weaponinfo(j);
-                       if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
+                       if (e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.(weapon_load[j]) = e.reloading_ammo;
                }
 
diff --git a/qcsrc/server/cl_client.qh b/qcsrc/server/cl_client.qh
new file mode 100644 (file)
index 0000000..213a029
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef CL_CLIENT_H
+#define CL_CLIENT_H
+float c1, c2, c3, c4;
+
+void play_countdown(float finished, string samp);
+
+float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit);
+
+float Spectate(entity pl);
+
+void CTS_ClientKill (entity e);
+
+#endif
index 2cc8e0215bb8c1b1f0be9620c2b484326f4acde0..a02cf40acab473d57b6854da0d29f7e72f0bf1dd 100644 (file)
@@ -1,8 +1,17 @@
+#include "_all.qh"
 #include "round_handler.qh"
 
 #include "bot/waypoints.qh"
 
 #include "weapons/throwing.qh"
+#include "command/common.qh"
+#include "cheats.qh"
+#include "bot/navigation.qh"
+#include "weapons/selection.qh"
+#include "weapons/tracing.qh"
+#include "weapons/weaponsystem.qh"
+#include "vehicles/vehicle.qh"
+#include "waypointsprites.qh"
 
 #include "../common/weapons/weapons.qh"
 
@@ -132,7 +141,7 @@ void ImpulseCommands (void)
                if(self.deadflag == DEAD_NO)
                {
                        // custom order weapon cycling
-                       i = imp % 10;
+                       int i = imp % 10;
                        m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
                        W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
                }
index 337342333c0b0230b6d2362d5c1a4119b79d350a..bbb730d3109ea9d14c1e8df01ea97a41a4603948 100644 (file)
@@ -1,3 +1,7 @@
+#include "_all.qh"
+#include "bot/bot.qh"
+#include "g_damage.qh"
+
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
@@ -659,32 +663,6 @@ void SpecialCommand()
 #endif
 }
 
-float speedaward_speed;
-string speedaward_holder;
-string speedaward_uid;
-void race_send_speedaward(float msg)
-{
-       // send the best speed of the round
-       WriteByte(msg, SVC_TEMPENTITY);
-       WriteByte(msg, TE_CSQC_RACE);
-       WriteByte(msg, RACE_NET_SPEED_AWARD);
-       WriteInt24_t(msg, floor(speedaward_speed+0.5));
-       WriteString(msg, speedaward_holder);
-}
-
-float speedaward_alltimebest;
-string speedaward_alltimebest_holder;
-string speedaward_alltimebest_uid;
-void race_send_speedaward_alltimebest(float msg)
-{
-       // send the best speed
-       WriteByte(msg, SVC_TEMPENTITY);
-       WriteByte(msg, TE_CSQC_RACE);
-       WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
-       WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
-       WriteString(msg, speedaward_alltimebest_holder);
-}
-
 string GetMapname(void);
 float speedaward_lastupdate;
 float speedaward_lastsent;
index afd52171e1d2f7e834d63bae8a320a6576780f6d..059d754bb7a7d9ba3f0e058aeda97e96ad65c08f 100644 (file)
@@ -1,7 +1,23 @@
 #include "cl_player.qh"
+#include "_all.qh"
+
+#include "bot/bot.qh"
+#include "cheats.qh"
+#include "g_damage.qh"
+#include "g_subs.qh"
 #include "g_triggers.qh"
 #include "g_violence.qh"
 #include "miscfunctions.qh"
+#include "portals.qh"
+#include "teamplay.qh"
+#include "waypointsprites.qh"
+#include "weapons/throwing.qh"
+#include "command/common.qh"
+#include "../common/animdecide.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../common/deathtypes.qh"
+#include "../common/playerstats.qh"
+#include "../csqcmodellib/sv_model.qh"
 
 #include "weapons/weaponstats.qh"
 
@@ -767,9 +783,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                                flood = 2;
                        }
 
-                       if(time >= source.flood_field)
+                       if (time >= source.(flood_field))
                        {
-                               source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + lines * flood_spl;
+                               source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + lines * flood_spl;
                        }
                        else
                        {
@@ -779,14 +795,14 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                }
                else
                {
-                       if(time >= source.flood_field)
-                               source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + flood_spl;
+                       if (time >= source.(flood_field))
+                               source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + flood_spl;
                        else
                                flood = 1;
                }
 
                if (timeout_status == TIMEOUT_ACTIVE) // when game is paused, no flood protection
-                       source.flood_field = flood = 0;
+                       source.(flood_field) = flood = 0;
        }
 
        if(flood == 2) // cannot happen for empty msgstr
@@ -831,9 +847,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        }
        else if(flood == 1)
        {
-               if(autocvar_g_chat_flood_notify_flooder)
+               if (autocvar_g_chat_flood_notify_flooder)
                {
-                       sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.flood_field - time), "^3 seconds\n"));
+                       sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.(flood_field) - time), "^3 seconds\n"));
                        ret = 0;
                }
                else
@@ -1003,9 +1019,9 @@ float LoadPlayerSounds(string f, float first)
                        field = GetVoiceMessageSampleField(argv(0));
                if(GetPlayerSoundSampleField_notFound)
                        continue;
-               if(self.field)
-                       strunzone(self.field);
-               self.field = strzone(strcat(argv(1), " ", argv(2)));
+               if (self.(field))
+                       strunzone(self.(field));
+               self.(field) = strzone(strcat(argv(1), " ", argv(2)));
        }
        fclose(fh);
        return 1;
@@ -1200,7 +1216,7 @@ void GlobalSound(string sample, float chan, float voicetype)
 
 void PlayerSound(.string samplefield, float chan, float voicetype)
 {
-       GlobalSound(self.samplefield, chan, voicetype);
+       GlobalSound(self.(samplefield), chan, voicetype);
 }
 
 void VoiceMessage(string type, string msg)
@@ -1221,10 +1237,10 @@ void VoiceMessage(string type, string msg)
 
        flood = Say(self, ownteam, world, msg, 1);
 
-       if(IS_SPEC(self) || IS_OBSERVER(self) || flood < 0)
-               FakeGlobalSound(self.sample, CH_VOICE, voicetype);
+       if (IS_SPEC(self) || IS_OBSERVER(self) || flood < 0)
+               FakeGlobalSound(self.(sample), CH_VOICE, voicetype);
        else if (flood > 0)
-               GlobalSound(self.sample, CH_VOICE, voicetype);
+               GlobalSound(self.(sample), CH_VOICE, voicetype);
 }
 
 void MoveToTeam(entity client, float team_colour, float type)
index 9091ae0b783b65953aa4abef156b4e3203ce8040..e3d3c67591f9888de119f0a3bc1f344156ae689f 100644 (file)
@@ -1,14 +1,14 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/util.qh"
-    #include "../../common/command/shared_defs.qh"
-    #include "../autocvars.qh"
-    #include "common.qh"
-    #include "banning.qh"
-    #include "../ipban.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "banning.qh"
+#include "../_all.qh"
+
+#include "common.qh"
+
+#include "../cl_player.qh"
+#include "../ipban.qh"
+
+#include "../../common/util.qh"
+
 // =====================================================
 //  Banning and kicking command code, written by Samual
 //  Last updated: December 29th, 2011
index 70daacc87ea98d6152b183dc6ea97b6fc0b30ef2..17eca95c738363e4c83c3fbe57d0762fd143111c 100644 (file)
@@ -16,4 +16,8 @@ float Ban_Delete(float i);
 
 // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
 void BanCommand_macro_write_aliases(float fh);
+
+void BanCommand_macro_help();
+float BanCommand_macro_usage(float argc);
+
 #endif
index 14e0f201c0f7bb029d4f4363a8ba50e7b7ea39c3..d9eeea19eb6c76a2262d7243e29452e1a616f5e9 100644 (file)
@@ -1,32 +1,40 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../warpzonelib/common.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/teams.qh"
-    #include "../../common/util.qh"
-    #include "../../common/command/shared_defs.qh"
-    #include "../../common/monsters/monsters.qh"
-    #include "../../common/monsters/sv_monsters.qh"
-    #include "../../common/monsters/spawn.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../../common/deathtypes.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../vehicles/vehicles_def.qh"
-    #include "../campaign.qh"
-    #include "../../common/mapinfo.qh"
-    #include "common.qh"
-    #include "vote.qh"
-    #include "cmd.qh"
-    #include "../cheats.qh"
-    #include "../scores.qh"
-    #include "../ipban.qh"
+#include "../../common/command/command.qh"
+#include "cmd.qh"
+#include "../_all.qh"
+
+#include "common.qh"
+#include "vote.qh"
+
+#include "../campaign.qh"
+#include "../cheats.qh"
+#include "../cl_player.qh"
+#include "../g_triggers.qh"
+#include "../ipban.qh"
+#include "../mapvoting.qh"
+#include "../scores.qh"
+#include "../teamplay.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#ifdef SVQC
+       #include "../vehicles/vehicle.qh"
 #endif
 
+#include "../../common/constants.qh"
+#include "../../common/deathtypes.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/monsters.qh"
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
+#include "../../warpzonelib/common.qh"
+
+void ClientKill_TeamChange (float targetteam); // 0 = don't change, -1 = auto, -2 = spec
+
 // =========================================================
 //  Server side networked commands code, reworked by Samual
 //  Last updated: December 28th, 2011
diff --git a/qcsrc/server/command/commands.qc b/qcsrc/server/command/commands.qc
new file mode 100644 (file)
index 0000000..1db4db1
--- /dev/null
@@ -0,0 +1,10 @@
+#include "../../common/command/commands.qc"
+
+#include "sv_cmd.qc"
+
+#include "banning.qc"
+#include "cmd.qc"
+#include "common.qc"
+#include "getreplies.qc"
+#include "radarmap.qc"
+#include "vote.qc"
diff --git a/qcsrc/server/command/commands.qh b/qcsrc/server/command/commands.qh
new file mode 100644 (file)
index 0000000..d26468d
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef SERVER_COMMANDS_H
+#define SERVER_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "sv_cmd.qh"
+
+#include "banning.qh"
+#include "cmd.qh"
+#include "common.qh"
+#include "getreplies.qh"
+#include "radarmap.qh"
+#include "vote.qh"
+
+#endif
index 5b7e761b7879077a18d841119ca0e0e2e4092c93..0bdc6672fbf550daa7d2d66b54bdb30cf69b99d3 100644 (file)
@@ -1,5 +1,10 @@
+#include "../../common/command/command.qh"
 #include "common.qh"
+#include "../_all.qh"
 
+#include "../scores.qh"
+
+#include "../../common/notifications.qh"
 #include "../../common/counting.qh"
 
 
index ac99e32dc46d2583a677e3d687d6a067dde510ee..0925d7137855c000e51017f720f057e2ded902c3 100644 (file)
@@ -4,7 +4,7 @@
 #include "vote.qh"
 
 #include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
+#include "../../common/command/command.qh"
 
 // ============================================================
 //  Shared declarations for server commands, written by Samual
index aa8efd6d69a15934416371d6066b76c419bfc212..12a31ca653c368a761b9d5f1df66195fa7c3a728 100644 (file)
@@ -1,17 +1,15 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/counting.qh"
-    #include "../../common/monsters/monsters.qh"
-    #include "../defs.qh"
-    #include "../../common/mapinfo.qh"
-    #include "getreplies.qh"
-    #include "../race.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "getreplies.qh"
+#include "../_all.qh"
+
+#include "../race.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/counting.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/monsters.qh"
 
 // =========================================================
 //  Reply messages for common commands, re-worked by Samual
index 73e5108795525bd072c60cc5bd86bcd58cc25da5..45a4cc7f270c09df18ff79e59aa11ce3d20efd77 100644 (file)
@@ -1,13 +1,13 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/util.qh"
-    #include "../defs.qh"
-    #include "radarmap.qh"
-    #include "../../csqcmodellib/sv_model.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "radarmap.qh"
+#include "../_all.qh"
+
+#include "../g_subs.qh"
+#include "../g_world.qh"
+
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/sv_model.qh"
 
 // ===============================================
 //     Generates radar map images for use in the HUD
@@ -167,7 +167,7 @@ void sharpen_set(int x, float v)
 {
        sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
 }
-float sharpen_getpixel(float x, float y)
+float sharpen_getpixel(int x, int y)
 {
        if(x < 0)
                return 0;
index c2b068c7d1a9f2a01e86f8dcf9b5531ab2fc702d..fea60ba9e1143238181d3f5a131ea7034edcb3f7 100644 (file)
@@ -14,4 +14,8 @@ float sharpen_buffer[RADAR_WIDTH_MAX * 3];
 string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
 // FF is contained twice, to map 256 to FF too
 // removes the need to bound()
+
+float RadarMap_Make(float argc);
+
+
 #endif
index 7166ab7cfd1156b9377724ac6f2586e591f24872..43c53792e5a755ea5e991625924974ac30b40f78 100644 (file)
@@ -1,25 +1,39 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../warpzonelib/mathlib.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/teams.qh"
-    #include "../../common/util.qh"
-    #include "../../common/command/shared_defs.qh"
-    #include "../../common/monsters/sv_monsters.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../../common/mapinfo.qh"
-    #include "common.qh"
-    #include "cmd.qh"
-    #include "sv_cmd.qh"
-    #include "../anticheat.qh"
-    #include "../playerdemo.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "sv_cmd.qh"
+#include "../_all.qh"
+
+#include "banning.qh"
+#include "cmd.qh"
+#include "common.qh"
+#include "getreplies.qh"
+#include "radarmap.qh"
+
+#include "../anticheat.qh"
+#include "../campaign.qh"
+#include "../cl_client.qh"
+#include "../cl_player.qh"
+#include "../g_world.qh"
+#include "../ipban.qh"
+#include "../playerdemo.qh"
+#include "../teamplay.qh"
+
+#include "../bot/bot.qh"
+#include "../bot/navigation.qh"
+#include "../bot/scripting.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/sv_monsters.qh"
+
+#include "../../warpzonelib/mathlib.qh"
+
+void PutObserverInServer (void);
 
 // =====================================================
 //  Server side game commands code, reworked by Samual
@@ -46,7 +60,7 @@ void make_mapinfo_Think()
 void changematchtime(float delta, float mi, float ma)
 {
        float cur;
-       float new;
+       float update;
        float lim;
 
        if(delta == 0)
@@ -67,21 +81,21 @@ void changematchtime(float delta, float mi, float ma)
                if(lim == 0)
                        return; // cannot increase any further
                else if(lim < ma)
-                       new = min(ma, lim + delta);
+                       update = min(ma, lim + delta);
                else // already above maximum: FAIL
                        return;
        }
        else
        {
                if(lim == 0) // infinite: try reducing to max, if we are allowed to
-                       new = max(mi, ma);
+                       update = max(mi, ma);
                else if(lim > mi) // above minimum: decrease
-                       new = max(mi, lim + delta);
+                       update = max(mi, lim + delta);
                else // already below minimum: FAIL
                        return;
        }
 
-       cvar_set("timelimit", ftos(new / 60));
+       cvar_set("timelimit", ftos(update / 60));
 }
 
 
@@ -1380,7 +1394,7 @@ void GameCommand_shuffleteams(float request)
                        {
                                entity tmp_player;
                                int i;
-                               float x, z, t_teams, t_players, team_color;
+                               float x, t_teams, t_players, team_color;
 
                                // count the total amount of players and total amount of teams
                                t_players = 0;
@@ -1417,7 +1431,7 @@ void GameCommand_shuffleteams(float request)
                                }
 
                                // finally, from the list made earlier, re-join the players in different order.
-                               for(i = 1; i <= t_teams; ++i)
+                               for (int i = 1; i <= t_teams; ++i)
                                {
                                        // find out how many players to assign to this team
                                        x = (t_players / t_teams);
@@ -1426,7 +1440,7 @@ void GameCommand_shuffleteams(float request)
                                        team_color = Team_NumberToTeam(i);
 
                                        // sort through the random list of players made earlier
-                                       for(z = 1; z <= maxclients; ++z)
+                                       for (int z = 1; z <= maxclients; ++z)
                                        {
                                                if (!(shuffleteams_teams[i] >= x))
                                                {
index 61fd2f3a2d44d423b8a2a1792aec5f635a7ae420..72263dc1e3051e913cb4c6b476add8d6bf6f3027 100644 (file)
@@ -1,24 +1,22 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/command/shared_defs.qh"
-    #include "../autocvars.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../../common/mapinfo.qh"
-    #include "common.qh"
-    #include "vote.qh"
-    #include "../../common/playerstats.qh"
-    #include "../scores.qh"
-    #include "../race.qh"
-    #include "../round_handler.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "vote.qh"
+#include "../_all.qh"
+
+#include "common.qh"
+
+#include "../g_damage.qh"
+#include "../g_world.qh"
+#include "../race.qh"
+#include "../round_handler.qh"
+#include "../scores.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/playerstats.qh"
+#include "../../common/util.qh"
 
 // =============================================
 //  Server side voting code, reworked by Samual
index ff33f5668cf635f2f00acf8929d338df7e6d05c7..3c2845451d49653dacded2e1fbb712b808ba7141 100644 (file)
@@ -52,4 +52,5 @@ float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was al
 .float ready; // flag for if a player is ready
 void reset_map(float dorespawn);
 void ReadyCount();
+void ReadyRestart_force();
 #endif
diff --git a/qcsrc/server/csqceffects.qh b/qcsrc/server/csqceffects.qh
new file mode 100644 (file)
index 0000000..9fd0c38
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef CSQCEFFECTS_H
+#define CSQCEFFECTS_H
+void te_csqc_lightningarc(vector from,vector to);
+#endif
index 54d1ed041f3afda186a7689a674ea572e3a0612b..49e340c4970edff02b39fe1d3c208e57dbee47bd 100644 (file)
@@ -250,7 +250,7 @@ float nJoinAllowed(entity ignore);
 
 .entity flagcarried;
 
-.float playerid;
+.int playerid;
 float playerid_last;
 .float noalign;                // if set to 1, the item or spawnpoint won't be dropped to the floor
 
@@ -285,7 +285,7 @@ float default_weapon_alpha;
 .float version_nagtime;
 
 const int NUM_JUMPPADSUSED = 3;
-.float jumppadcount;
+.int jumppadcount;
 .entity jumppadsused[NUM_JUMPPADSUSED];
 
 string gamemode_name;
index 98ec277683c5477912cc1415f234c284a80754b5..52b15b0953fabc047fcefb668db5c6143bb6221f 100644 (file)
@@ -1,13 +1,7 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/constants.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "mutators/mutators_include.qh"
-#endif
+#include "_all.qh"
+
+#include "defs.qh"
+#include "mutators/mutators_include.qh"
 
 /**
  * The point of these entities is to avoid the problems
index be6104f1fa6d2c653cc6acb25bc3f818cab46840..2a3252fef5b500c21273496cd6933833cbe55566 100644 (file)
@@ -1,3 +1,11 @@
+#include "_all.qh"
+
+#include "g_subs.qh"
+#include "waypointsprites.qh"
+#include "g_damage.qh"
+#include "bot/bot.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../csqcmodellib/sv_model.qh"
 #include "weapons/common.qh"
 
 .entity sprite;
index 82374c41b9cad824379f68c2880b906f98249ebe..b9ad94e3f3910ec90f254a9a4ded0b3f2e9646e7 100644 (file)
@@ -1,12 +1,6 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-#endif
+#include "_all.qh"
+
+#include "../common/util.qh"
 
 float Casing_SendEntity(entity to, int sf)
 {
index 788eb345fa3d81702103714db1e6295747301097..1e7e72a1254b071efed0698119456530ed5c9de0 100644 (file)
@@ -1,31 +1,26 @@
 #include "g_damage.qh"
-
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-    #include "../warpzonelib/common.qh"
-    #include "../common/constants.qh"
-    #include "../common/teams.qh"
-    #include "../common/util.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "weapons/accuracy.qh"
-    #include "weapons/csqcprojectile.qh"
-    #include "weapons/selection.qh"
-    #include "t_items.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
-    #include "tturrets/include/turrets_early.qh"
-    #include "vehicles/vehicles_def.qh"
-    #include "../csqcmodellib/sv_model.qh"
-    #include "../common/playerstats.qh"
-    #include "g_hook.qh"
-    #include "scores.qh"
-    #include "spawnpoints.qh"
-#endif
+#include "_all.qh"
+
+#include "g_hook.qh"
+#include "mutators/mutators_include.qh"
+#include "scores.qh"
+#include "waypointsprites.qh"
+#include "spawnpoints.qh"
+#include "tturrets/include/turrets_early.qh"
+#include "t_items.qh"
+#include "vehicles/vehicle.qh"
+#include "weapons/accuracy.qh"
+#include "weapons/csqcprojectile.qh"
+#include "weapons/selection.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/sv_model.qh"
+#include "../warpzonelib/common.qh"
 
 float Damage_DamageInfo_SendEntity(entity to, int sf)
 {
@@ -293,10 +288,10 @@ float Obituary_WeaponDeath(
        if(death_weapon)
        {
                w_deathtype = deathtype;
-               float death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
+               int death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
                w_deathtype = false;
 
-               if(death_message)
+               if (death_message)
                {
                        Send_Notification_WOCOVA(
                                NOTIF_ONE,
index b98693de6c9c5fa6b2652fbce1da9862ef52ab56..49f495bc4a86dd5ed4c8a8dc19ae042aaff5de64 100644 (file)
@@ -22,7 +22,7 @@
     #include "../common/deathtypes.qh"
     #include "mutators/mutators_include.qh"
     #include "tturrets/include/turrets_early.qh"
-    #include "vehicles/vehicles_def.qh"
+    #include "vehicles/vehicle.qh"
     #include "../csqcmodellib/sv_model.qh"
     #include "../common/playerstats.qh"
     #include "g_hook.qh"
index f0b9537046f3356153711dede0519357fe0dc62e..c101236f8974cbe84d497cf7f72d74eb30ea37c7 100644 (file)
@@ -1,21 +1,20 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/common.qh"
-    #include "../warpzonelib/server.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "vehicles/vehicles_def.qh"
-    #include "command/common.qh"
-    #include "g_hook.qh"
-    #include "round_handler.qh"
-#endif
+#include "g_hook.qh"
+#include "_all.qh"
+
+#include "weapons/common.qh"
+#include "weapons/weaponsystem.qh"
+#include "weapons/selection.qh"
+#include "weapons/tracing.qh"
+#include "cl_player.qh"
+#include "t_teleporters.qh"
+#include "command/common.qh"
+#include "round_handler.qh"
+#include "vehicles/vehicle.qh"
+#include "../common/constants.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/server.qh"
 
 /*============================================
 
@@ -133,7 +132,7 @@ float GrapplingHookSend(entity to, int sf)
 
 void GrapplingHookThink()
 {
-       float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch, s;
+       float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
        vector dir, org, end, v0, dv, v, myorg, vs;
        if(self.realowner.hook != self) // how did that happen?
        {
@@ -150,7 +149,7 @@ void GrapplingHookThink()
 
        self.nextthink = time;
 
-       s = self.realowner.cvar_cl_gunalign;
+       int s = self.realowner.cvar_cl_gunalign;
        if(s != 1 && s != 2 && s != 4)
                s = 3; // default value
        --s;
@@ -315,7 +314,6 @@ void FireGrapplingHook (void)
 {
        entity missile;
        vector org;
-       float s;
        vector vs;
 
        if(forbidWeaponUse()) return;
@@ -323,7 +321,7 @@ void FireGrapplingHook (void)
 
        makevectors(self.v_angle);
 
-       s = self.cvar_cl_gunalign;
+       int s = self.cvar_cl_gunalign;
        if(s != 1 && s != 2 && s != 4)
                s = 3; // default value
        --s;
index da53fbe64b2837689491d9b522780ac5999b9a27..f7382d1666b15b6c295903b3fa90260be3c720a2 100644 (file)
@@ -1,3 +1,7 @@
+#include "_all.qh"
+
+void train_next();
+
 const float LOOP = 1;
 
 const float DNOSHADOW = 2;
index 0214b9ed36b802156688eb1f98582e2b9c82b0af..e25ce66f3229a80c41ef44d19e702bc5579934d7 100644 (file)
@@ -1,14 +1,10 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/constants.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../csqcmodellib/sv_model.qh"
-#endif
+#include "_all.qh"
+
+#include "g_subs.qh"
+#include "g_triggers.qh"
+
+#include "../common/constants.qh"
+#include "../csqcmodellib/sv_model.qh"
 
 .float modelscale;
 
index 74a8cf7f96126135f1ec45074a86d9d0036e3201..e850b61b3e3b7535204cf1382fdcaaa0198645a1 100644 (file)
@@ -1,4 +1,9 @@
 #include "g_subs.qh"
+#include "_all.qh"
+
+#include "antilag.qh"
+#include "command/common.qh"
+#include "../warpzonelib/common.qh"
 
 void SUB_NullThink(void) { }
 
index 63e498bfc36075512a8d0f0581e44d8d0f9dd3c4..70a316386e83d89458bca578c84284acb725eb5c 100644 (file)
@@ -100,11 +100,11 @@ float GetXBlock(float x, string dat)
        return stof(substring(dat, x-1, 1));
 }
 
-string SetXBlock(float x, string dat, float new)
+string SetXBlock(float x, string dat, float val)
 {
        return strcat(
                substring(dat, 0, x-1),
-               ftos(new),
+               ftos(val),
                substring(dat, x, -1)
        );
 }
index d58d4105e5ca6c266f8ea302ccbdc3c56f5b7a31..872e597d12d2237e321f2b63bc53d85ca4582fb1 100644 (file)
@@ -1,4 +1,10 @@
 #include "g_triggers.qh"
+#include "_all.qh"
+
+#include "weapons/csqcprojectile.qh"
+#include "../common/deathtypes.qh"
+#include "../warpzonelib/util_server.qh"
+#include "g_subs.qh"
 #include "t_jumppads.qh"
 
 void SUB_DontUseTargets()
@@ -683,11 +689,11 @@ void target_speaker_use_activator()
                sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
                if(GetPlayerSoundSampleField_notFound)
                        snd = "misc/null.wav";
-               else if(activator.sample == "")
+               else if (activator.(sample) == "")
                        snd = "misc/null.wav";
                else
                {
-                       tokenize_console(activator.sample);
+                       tokenize_console(activator.(sample));
                        float n;
                        n = stof(argv(1));
                        if(n > 0)
@@ -710,11 +716,11 @@ void target_speaker_use_on()
                sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
                if(GetPlayerSoundSampleField_notFound)
                        snd = "misc/null.wav";
-               else if(activator.sample == "")
+               else if (activator.(sample) == "")
                        snd = "misc/null.wav";
                else
                {
-                       tokenize_console(activator.sample);
+                       tokenize_console(activator.(sample));
                        float n;
                        n = stof(argv(1));
                        if(n > 0)
index 4ef4f45ff23e1b1453ab33ec3a3d775c393385b9..5bc8aafd377202719e58dd38569a70afedb452c5 100644 (file)
@@ -1,4 +1,5 @@
 #include "g_violence.qh"
+#include "_all.qh"
 
 float Violence_GibSplash_SendEntity(entity to, int sf)
 {
index 345bc5bc13b53577ce2fab6e9ec9ad72bd47df7e..82a81776a366c5f5567c286e3ce9152c2ae6e2de 100644 (file)
@@ -1,39 +1,38 @@
 #include "g_world.qh"
-
+#include "_all.qh"
+
+#include "anticheat.qh"
+#include "antilag.qh"
+#include "bot/bot.qh"
+#include "campaign.qh"
+#include "cheats.qh"
+#include "cl_client.qh"
+#include "command/common.qh"
+#include "command/getreplies.qh"
+#include "command/sv_cmd.qh"
+#include "command/vote.qh"
+#include "g_hook.qh"
+#include "ipban.qh"
+#include "mapvoting.qh"
+#include "mutators/mutators_include.qh"
+#include "race.qh"
+#include "scores.qh"
+#include "secret.qh"
+#include "teamplay.qh"
+#include "waypointsprites.qh"
+#include "weapons/weaponstats.qh"
 #include "../common/buffs.qh"
-
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-    #include "../common/constants.qh"
-    #include "../common/stats.qh"
-    #include "../common/teams.qh"
-    #include "../common/util.qh"
-    #include "../common/monsters/sv_monsters.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "weapons/weaponstats.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "mutators/mutators_include.qh"
-    #include "campaign.qh"
-    #include "../common/mapinfo.qh"
-    #include "command/common.qh"
-    #include "command/vote.qh"
-    #include "command/getreplies.qh"
-    #include "command/sv_cmd.qh"
-    #include "anticheat.qh"
-    #include "cheats.qh"
-    #include "../common/playerstats.qh"
-    #include "g_hook.qh"
-    #include "scores.qh"
-    #include "mapvoting.qh"
-    #include "ipban.qh"
-    #include "race.qh"
-    #include "antilag.qh"
-    #include "secret.qh"
-#endif
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/monsters/monsters.qh"
+#include "../common/monsters/sv_monsters.qh"
+#include "../common/notifications.qh"
+#include "../common/playerstats.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
 
 const float LATENCY_THINKRATE = 10;
 .float latency_sum;
@@ -93,9 +92,7 @@ string redirection_target;
 float world_initialized;
 
 string GetGametype();
-void GotoNextMap(float reinit);
 void ShuffleMaplist();
-float(float reinit) DoNextMapOverride;
 
 void SetDefaultAlpha()
 {
@@ -576,7 +573,7 @@ void WeaponStats_Init();
 void WeaponStats_Shutdown();
 void spawnfunc_worldspawn (void)
 {
-       float fd, l, i, j, n;
+       float fd, l, j, n;
        string s;
 
        cvar = cvar_normal;
@@ -839,7 +836,7 @@ void spawnfunc_worldspawn (void)
        maplist_reply = strzone(getmaplist());
        lsmaps_reply = strzone(getlsmaps());
        monsterlist_reply = strzone(getmonsterlist());
-       for(i = 0; i < 10; ++i)
+       for(int i = 0; i < 10; ++i)
        {
                s = getrecords(i);
                if (s)
@@ -862,7 +859,7 @@ void spawnfunc_worldspawn (void)
        {
                s = "";
                n = tokenize_console(cvar_string("sv_curl_serverpackages"));
-               for(i = 0; i < n; ++i)
+               for(int i = 0; i < n; ++i)
                        if(substring(argv(i), -18, -1) != "-serverpackage.txt")
                        if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy
                                s = strcat(s, " ", argv(i));
@@ -870,7 +867,7 @@ void spawnfunc_worldspawn (void)
                if(fd >= 0)
                {
                        j = search_getsize(fd);
-                       for(i = 0; i < j; ++i)
+                       for(int i = 0; i < j; ++i)
                                s = strcat(s, " ", search_getfilename(fd, i));
                        search_end(fd);
                }
@@ -878,7 +875,7 @@ void spawnfunc_worldspawn (void)
                if(fd >= 0)
                {
                        j = search_getsize(fd);
-                       for(i = 0; i < j; ++i)
+                       for(int i = 0; i < j; ++i)
                                s = strcat(s, " ", search_getfilename(fd, i));
                        search_end(fd);
                }
@@ -1650,7 +1647,7 @@ void SetWinners(.float field, float value)
 {
        entity head;
        FOR_EACH_PLAYER(head)
-               head.winning = (head.field == value);
+               head.winning = (head.(field) == value);
 }
 
 // set the .winning flag for those players with a given field value
@@ -1658,7 +1655,7 @@ void AddWinners(.float field, float value)
 {
        entity head;
        FOR_EACH_PLAYER(head)
-               if(head.field == value)
+               if (head.(field) == value)
                        head.winning = 1;
 }
 
@@ -2036,7 +2033,6 @@ CheckRules_World
 Exit deathmatch games upon conditions
 ============
 */
-void ReadyRestart();
 void CheckRules_World()
 {
        float timelimit;
index 3a5e5d5ac76b4d805a6ca9bde51d0cb219436d46..920ef71e184c1cc71d5962d57cd9c639f140d8f4 100644 (file)
@@ -13,5 +13,16 @@ const float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeat
 
 void CheckRules_Player();
 void IntermissionThink();
+void GotoNextMap(float reinit);
+void ReadyRestart();
+
+void DumpStats(float final);
+float Map_IsRecent(string m);
+string GetNextMap();
+void ShuffleMaplist();
+void Map_Goto_SetStr(string nextmapname);
+void Map_Goto(float reinit);
+float DoNextMapOverride(float reinit);
+void CheckRules_World();
 
 #endif
index 9591ee8baa9d9b7620d5b5fbe32f430a8e0a22cb..db758a8e6d41bab7300654d865c6bef18b982eb7 100644 (file)
@@ -1,15 +1,13 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "defs.qh"
-    #include "command/banning.qh"
-    #include "ipban.qh"
-#endif
+#include "ipban.qh"
+#include "_all.qh"
+
+#include "autocvars.qh"
+#include "command/banning.qh"
+#include "defs.qh"
+#include "../common/constants.qh"
+#include "../common/util.qh"
+#include "../dpdefs/dpextensions.qh"
+#include "../dpdefs/progsdefs.qh"
 
 /*
  * Protocol of online ban list:
index f4893094efb533c429902e0defbd2ad2ad82b1df..e0f79f1144fbc1862256e3ffdd7391fab573c1d0 100644 (file)
@@ -1,15 +1,10 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../common/util.qh"
-    #include "../common/monsters/monsters.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "item_key.qh"
-#endif
+#include "item_key.qh"
+#include "_all.qh"
+
+#include "../common/monsters/monsters.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/util_server.qh"
 
 /*
 TODO:
@@ -38,9 +33,6 @@ bool item_keys_usekey(entity l, entity p) {
 }
 
 string item_keys_keylist(float keylist) {
-       float base, l;
-       string n;
-
        // no keys
        if (!keylist)
                return "";
@@ -49,10 +41,10 @@ string item_keys_keylist(float keylist) {
        if ((keylist & (keylist-1)) != 0)
                return strcat("the ", item_keys_names[lowestbit(keylist)]);
 
-       n = "";
-       base = 0;
+       string n = "";
+       int base = 0;
        while (keylist) {
-               l = lowestbit(keylist);
+               int l = lowestbit(keylist);
                if (n)
                        n = strcat(n, ", the ", item_keys_names[base + l]);
                else
index 178dfe7ba5986769ed8e567b35c86401a0c0e206..cf5df9da36a3c3fe91dfb1e5fd0bdce1aa40ae21 100644 (file)
@@ -1,19 +1,13 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/mapinfo.qh"
-    #include "command/getreplies.qh"
-    #include "command/cmd.qh"
-    #include "../common/playerstats.qh"
-    #include "mapvoting.qh"
-#endif
+#include "mapvoting.qh"
+#include "_all.qh"
+
+#include "g_world.qh"
+#include "command/cmd.qh"
+#include "command/getreplies.qh"
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/playerstats.qh"
+#include "../common/util.qh"
 
 float GameTypeVote_AvailabilityStatus(string gtname)
 {
index d2eff1cf08ec0422fef2292e25326ee96244ac65..18194b7b6b08362a942bef1b0514b9a211ff805f 100644 (file)
@@ -1,10 +1,13 @@
 #ifndef MAPVOTING_H
 #define MAPVOTING_H
 
+#include "../common/constants.qh"
+
 // definitions for functions used outside mapvoting.qc
 void MapVote_Start();
 void MapVote_Spawn();
 void MapVote_Think();
+void MapVote_SendPicture(float id);
 float GameTypeVote_Start();
 float GameTypeVote_Finished(float pos);
 string GameTypeVote_MapInfo_FixName(string m);
index 7660b7e03dae09a975b737c23ae48372640205d5..41f388ed53c15bd5c21b03836b88ea711e588e6f 100644 (file)
@@ -1,34 +1,30 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "miscfunctions.qh"
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/playerstats.qh"
-    #include "../warpzonelib/anglestransform.qh"
-    #include "../warpzonelib/server.qh"
-    #include "../common/constants.qh"
-    #include "../common/teams.qh"
-    #include "../common/util.qh"
-    #include "../common/urllib.qh"
-    #include "../common/command/generic.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "weapons/accuracy.qh"
-    #include "weapons/csqcprojectile.qh"
-    #include "weapons/selection.qh"
-    #include "t_items.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
-    #include "tturrets/include/turrets_early.qh"
-    #include "../common/mapinfo.qh"
-    #include "command/common.qh"
-    #include "../csqcmodellib/sv_model.qh"
-    #include "ipban.qh"
-#endif
+#include "miscfunctions.qh"
+#include "_all.qh"
+
+#include "antilag.qh"
+#include "command/common.qh"
+#include "constants.qh"
+#include "g_hook.qh"
+#include "ipban.qh"
+#include "mutators/mutators_include.qh"
+#include "tturrets/include/turrets_early.qh"
+#include "t_items.qh"
+#include "weapons/accuracy.qh"
+#include "weapons/csqcprojectile.qh"
+#include "weapons/selection.qh"
+#include "../common/command/generic.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/notifications.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
+#include "../common/urllib.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/sv_model.qh"
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/server.qh"
 
 void crosshair_trace(entity pl)
 {
@@ -357,17 +353,17 @@ void GetCvars_handleString(string thisname, float f, .string field, string name)
 {
        if (f < 0)
        {
-               if (self.field)
-                       strunzone(self.field);
-               self.field = string_null;
+               if (self.(field))
+                       strunzone(self.(field));
+               self.(field) = string_null;
        }
        else if (f > 0)
        {
                if (thisname == name)
                {
-                       if (self.field)
-                               strunzone(self.field);
-                       self.field = strzone(argv(f + 1));
+                       if (self.(field))
+                               strunzone(self.(field));
+                       self.(field) = strzone(argv(f + 1));
                }
        }
        else
@@ -379,12 +375,11 @@ void GetCvars_handleString_Fixup(string thisname, float f, .string field, string
        if (f >= 0) // also initialize to the fitting value for "" when sending cvars out
                if (thisname == name)
                {
-                       string s;
-                       s = func(strcat1(self.field));
-                       if (s != self.field)
+                       string s = func(strcat1(self.(field)));
+                       if (s != self.(field))
                        {
-                               strunzone(self.field);
-                               self.field = strzone(s);
+                               strunzone(self.(field));
+                               self.(field) = strzone(s);
                        }
                }
 }
@@ -396,7 +391,7 @@ void GetCvars_handleFloat(string thisname, float f, .float field, string name)
        else if (f > 0)
        {
                if (thisname == name)
-                       self.field = stof(argv(f + 1));
+                       self.(field) = stof(argv(f + 1));
        }
        else
                stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
@@ -410,17 +405,17 @@ void GetCvars_handleFloatOnce(string thisname, float f, .float field, string nam
        {
                if (thisname == name)
                {
-                       if(!self.field)
+                       if (!self.(field))
                        {
-                               self.field = stof(argv(f + 1));
-                               if(!self.field)
-                                       self.field = -1;
+                               self.(field) = stof(argv(f + 1));
+                               if (!self.(field))
+                                       self.(field) = -1;
                        }
                }
        }
        else
        {
-               if(!self.field)
+               if (!self.(field))
                        stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
        }
 }
@@ -1304,7 +1299,6 @@ void Net_LinkEntity(entity e, float docull, float dt, bool(entity, int) sendfunc
 }
 
 
-entity eliminatedPlayers;
 .float(entity) isEliminated;
 float EliminatedPlayers_SendEntity(entity to, float sendflags)
 {
@@ -1468,7 +1462,6 @@ float SUB_NoImpactCheck()
 
 #define SUB_OwnerCheck() (other && (other == self.owner))
 
-void RemoveGrapplingHook(entity pl);
 void W_Crylink_Dequeue(entity e);
 float WarpZone_Projectile_Touch_ImpactFilter_Callback()
 {
index f19f53fd0b3010d021308c2a29235f195097d1d1..a8a9117d59e07307cc6677af1086fb776b0af8e9 100644 (file)
@@ -32,6 +32,46 @@ float cvar_normal(string n)
 .float uncustomizeentityforclient_set;
 .float nottargeted;
 
+entity eliminatedPlayers;
+void EliminatedPlayers_Init(float(entity) isEliminated_func);
+
+string admin_name(void);
+
+void write_recordmarker(entity pl, float tstart, float dt);
+
+void play2all(string samp);
+
+void DistributeEvenly_Init(float amount, float totalweight);
+float DistributeEvenly_Get(float weight);
+
+void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2);
+
+void shockwave_spawn(string m, vector org, float sz, float t1, float t2);
+
+vector randompos(vector m1, vector m2);
+
+void play2team(float t, string filename);
+
+void GetCvars_handleFloat(string thisname, float f, .float field, string name);
+
+float spamsound(entity e, float chan, string samp, float vol, float _atten);
+
+void GetCvars_handleString(string thisname, float f, .string field, string name);
+
+void precache_all_playermodels(string pattern);
+
+void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
+
+void defer(float fdelay, void() func);
+
+void UncustomizeEntitiesRun();
+void InitializeEntitiesRun();
+
+void stopsoundto(float _dest, entity e, float chan);
+void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten);
+float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d);
+
+vector shotorg_adjust(vector vecs, float y_is_right, float visual);
 
 float DistributeEvenly_amount;
 float DistributeEvenly_totalweight;
@@ -68,6 +108,8 @@ float isPushable(entity e);
 
 float LostMovetypeFollow(entity ent);
 
+string uid2name(string myuid);
+
 float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance);
 
 string NearestLocation(vector p);
index e13919a23b174b5372f301b06070bfe31c0182df..f642a3bdf925474734ac814ac4b091cd6d5937a5 100644 (file)
@@ -1,3 +1,6 @@
+#include "base.qh"
+#include "../_all.qh"
+
 .float() cbc_func;
 .entity cbc_next;
 .float cbc_order;
@@ -95,7 +98,7 @@ const float MAX_MUTATORS = 15;
 string loaded_mutators[MAX_MUTATORS];
 float Mutator_Add(mutatorfunc_t func, string name)
 {
-       float i, j;
+       int i, j;
        j = -1;
        for(i = 0; i < MAX_MUTATORS; ++i)
        {
@@ -128,7 +131,7 @@ float Mutator_Add(mutatorfunc_t func, string name)
 }
 void Mutator_Remove(float(float) func, string name)
 {
-       float i;
+       int i;
        for(i = 0; i < MAX_MUTATORS; ++i)
                if(name == loaded_mutators[i])
                        break;
diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh
new file mode 100644 (file)
index 0000000..38e9ad8
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef GAMEMODE_H
+#define GAMEMODE_H
+
+#include "mutator_nades.qh"
+
+#include "../cl_client.qh"
+#include "../cl_player.qh"
+#include "../cl_impulse.qh"
+#include "../cheats.qh"
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../t_teleporters.qh"
+#include "../round_handler.qh"
+#include "../scores.qh"
+#include "../scores_rules.qh"
+#include "../waypointsprites.qh"
+
+#include "../bot/bot.qh"
+#include "../bot/navigation.qh"
+#include "../bot/waypoints.qh"
+#include "../bot/havocbot/roles.qh"
+#include "../bot/havocbot/role_keyhunt.qh"
+
+#include "../bot/havocbot/havocbot.qh"
+
+#include "../command/vote.qh"
+
+#include "../../common/monsters/monsters.qh"
+
+#include "../command/common.qh"
+
+#include "../weapons/tracing.qh"
+#include "../weapons/weaponsystem.qh"
+
+#include "../../common/deathtypes.qh"
+#include "../../common/notifications.qh"
+#include "../../common/stats.qh"
+#include "../../common/teams.qh"
+
+#include "../../warpzonelib/mathlib.qh"
+#include "../../warpzonelib/server.qh"
+#include "../../warpzonelib/util_server.qh"
+
+.float lastground;
+float total_players;
+float redalive, bluealive, yellowalive, pinkalive;
+.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
+
+#endif
index 49deac0e8f350c1f73cfea58694a21ac7927af5b..b8a2ab1a59178d57543cef1bbd85bc19e34e7e8e 100644 (file)
@@ -1,3 +1,10 @@
+#include "gamemode_assault.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+.entity sprite;
+
 // random functions
 void assault_objective_use()
 {
index a0f238358455a271a80a45d996ecf9c07fe16f36..9ad532e909e4dcfd2b56d3d187308db93a999b15 100644 (file)
@@ -1,6 +1,8 @@
-float total_players;
-float redalive, bluealive, yellowalive, pinkalive;
-.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
+#include "gamemode_ca.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 float ca_teams;
 float allowed_to_spawn;
 
index 0cbcf714c906f956c979c47257a496634ebf894e..d8a4e357bbde7ea69a37477d28e710bcb6956a6e 100644 (file)
@@ -1,3 +1,15 @@
+#include "gamemode_ctf.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#ifdef SVQC
+#include "../vehicles/vehicle.qh"
+#endif
+
+#include "../../warpzonelib/common.qh"
+#include "../../warpzonelib/mathlib.qh"
+
 // ================================================================
 //  Official capture the flag game mode coding, reworked by Samual
 //  Last updated: September, 2012
index 0e5930db2cbe83c95b439e8f75461cdce64eda7f..302f6ce104b305054a8f3dd36830a5a3b8200025 100644 (file)
@@ -93,6 +93,8 @@ const float RETURN_DAMAGE = 3;
 const float RETURN_SPEEDRUN = 4;
 const float RETURN_NEEDKILL = 5;
 
+void ctf_Handle_Throw(entity player, entity receiver, float droptype);
+
 // flag properties
 #define ctf_spawnorigin dropped_origin
 float ctf_stalemate; // indicates that a stalemate is active
index 0886a9ce59921cf205bc71dba4a89bc9897b3846..50aa5e1fc51d48b87c7112c719a6924e2becb01b 100644 (file)
@@ -1,3 +1,10 @@
+#include "gamemode_cts.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../race.qh"
+
 // legacy bot roles
 .float race_checkpoint;
 void havocbot_role_cts()
index dd6e8b2109be3b97ceab791a5874a8ec94edf880..c365eddd300a9cb4a32fddc34c9760d8abe50e23 100644 (file)
@@ -1,3 +1,8 @@
+#include "gamemode_domination.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
 {
        if(autocvar_sv_eventlog)
index d6285cdafd112509b99e8c9ffcacd6b0430e3abe..3b251e73bd48b28487750a36cf2510b60375761c 100644 (file)
@@ -1,8 +1,7 @@
-.float freezetag_frozen_time;
-.float freezetag_frozen_timeout;
-const float ICE_MAX_ALPHA = 1;
-const float ICE_MIN_ALPHA = 0.1;
-float freezetag_teams;
+#include "gamemode_freezetag.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
 
 const float SP_FREEZETAG_REVIVALS = 4;
 void freezetag_ScoreRules(float teams)
@@ -425,7 +424,6 @@ MUTATOR_HOOKFUNCTION(freezetag_GiveFragsForKill)
        return 1;
 }
 
-.float reviving; // temp var
 MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
 {
        float n;
diff --git a/qcsrc/server/mutators/gamemode_freezetag.qh b/qcsrc/server/mutators/gamemode_freezetag.qh
new file mode 100644 (file)
index 0000000..19489fc
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef GAMEMODE_FREEZETAG_H
+#define GAMEMODE_FREEZETAG_H
+.float freezetag_frozen_time;
+.float freezetag_frozen_timeout;
+const float ICE_MAX_ALPHA = 1;
+const float ICE_MIN_ALPHA = 0.1;
+float freezetag_teams;
+
+.float reviving; // temp var
+
+#endif
index fe0d0a7ecc4094048a9a7b878e2428a0ad258523..c5f71ea1f376ed60487ec1e841b41b4c51a33fe0 100644 (file)
@@ -1,3 +1,11 @@
+#include "gamemode_invasion.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
 void spawnfunc_invasion_spawnpoint()
 {
        if(!g_invasion) { remove(self); return; }
index 095857e14325ebf83550b5feee918024d9bb07e4..6b62e7da1b65d7bda40c0e618cb12bbddd7d3c17 100644 (file)
@@ -1,3 +1,8 @@
+#include "gamemode_keepaway.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 // ===========================================================
 //  Keepaway game mode coding, written by Samual and Diabolik
 //  Last updated: September, 2012
index fd9ed4f2f0e98b9b2c5a29ce9b0736dd99df4187..250f2fbc9f45979a0e48c05c454e0ec6f4a5f000 100644 (file)
@@ -11,4 +11,7 @@ const float SP_KEEPAWAY_BCTIME = 6;
 
 void() havocbot_role_ka_carrier;
 void() havocbot_role_ka_collector;
+
+void ka_DropEvent(entity plyr);
+
 #endif
index d0103d80ef17248ca2e365e92d2f91fdfb6b1b7f..e7f3289982d12411ab0b7f9910b2eb2515f1eeac 100644 (file)
@@ -1,4 +1,8 @@
-#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext )
+#include "gamemode_keyhunt.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 
 // #define KH_PLAYER_USE_ATTACHMENT
 // #define KH_PLAYER_USE_CARRIEDMODEL
index 6b27431c2207cc81f39319b3d6c580477451d2cc..4d1645d02c0201ecebe82485e1f771f025e69b82 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef GAMEMODE_KEYHUNT_H
 #define GAMEMODE_KEYHUNT_H
 
+#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext )
+
 // ALL OF THESE should be removed in the future, as other code should not have to care
 
 // used by bots:
@@ -11,4 +13,7 @@ float kh_Key_AllOwnedByWhichTeam();
 typedef void(void) kh_Think_t;
 void kh_StartRound();
 void kh_Controller_SetThink(float t, kh_Think_t func);
+
+void kh_Key_DropAll(entity player, float suicide);
+
 #endif
index 13b77305a25429c78dd95768701167057b7a699e..61e51451fbaf9d354407568d20706a92b857fa5a 100644 (file)
@@ -1,3 +1,11 @@
+#include "gamemode_lms.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../campaign.qh"
+#include "../command/cmd.qh"
+
 // main functions
 float LMS_NewPlayerLives()
 {
index afdb769cf6b0c4025bc6e31f7f175f1557520982..4c081ab445f0c3abab6bc944c12c3a73edafc54e 100644 (file)
@@ -1,3 +1,10 @@
+#include "gamemode_nexball.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../t_jumppads.qh"
+
 float autocvar_g_nexball_safepass_turnrate;
 float autocvar_g_nexball_safepass_maxdist;
 float autocvar_g_nexball_safepass_holdtime;
index 7d02e6ff91da634f5197e81521e9e6ba37d27716..c99643169ba598907d83c97e22a4dc58e7f6f89b 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 float autocvar_g_onslaught_spawn_at_controlpoints;
 float autocvar_g_onslaught_spawn_at_generator;
 float autocvar_g_onslaught_cp_proxydecap;
index 7ba8328469765b40513ba9160aceb139b2bf3873..3cefc86692f6d6e8fbc9d6a094f424bdc5e4b01c 100644 (file)
@@ -1,3 +1,10 @@
+#include "gamemode_race.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../race.qh"
+
 // legacy bot roles
 .float race_checkpoint;
 void havocbot_role_race()
index de172873e29255af8f14c0c8ae972758519f5c60..afff8bdb2583dc8a187b0814c56e8d75ead365e7 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
 /*QUAKED spawnfunc_tdm_team (0 .5 .8) (-16 -16 -24) (16 16 32)
 Team declaration for TDM gameplay, this allows you to decide what team names and control point models are used in your map.
 Note: If you use spawnfunc_tdm_team entities you must define at least 2!  However, unlike domination, you don't need to make a blank one too.
diff --git a/qcsrc/server/mutators/mutator.qh b/qcsrc/server/mutators/mutator.qh
new file mode 100644 (file)
index 0000000..6cded53
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef MUTATOR_H
+#define MUTATOR_H
+
+#include "base.qh"
+#include "mutator_nades.qh"
+
+#include "../cl_client.qh"
+#include "../cl_player.qh"
+#include "../cl_impulse.qh"
+#include "../cheats.qh"
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../t_teleporters.qh"
+#include "../round_handler.qh"
+#include "../scores.qh"
+#include "../scores_rules.qh"
+#include "../waypointsprites.qh"
+
+#include "../bot/bot.qh"
+#include "../bot/navigation.qh"
+#include "../bot/waypoints.qh"
+
+#include "../bot/havocbot/havocbot.qh"
+#include "../bot/havocbot/roles.qh"
+#include "../bot/havocbot/role_keyhunt.qh"
+
+#include "../command/vote.qh"
+#include "../command/common.qh"
+
+#include "../weapons/common.qh"
+#include "../weapons/tracing.qh"
+#include "../weapons/throwing.qh"
+#include "../weapons/weaponsystem.qh"
+
+#include "../../common/deathtypes.qh"
+#include "../../common/notifications.qh"
+#include "../../common/stats.qh"
+#include "../../common/teams.qh"
+
+#include "../../common/monsters/monsters.qh"
+
+#include "../../warpzonelib/anglestransform.qh"
+#include "../../warpzonelib/mathlib.qh"
+#include "../../warpzonelib/server.qh"
+#include "../../warpzonelib/util_server.qh"
+
+#endif
index 08e14199ee3f4d460044f02f056cc2750b2692a0..eb179a0c8c8499b73dba3c150a985d21b26280d8 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 .float bloodloss_timer;
 
 MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink)
index b2f800a27e06c1228d541cbabc47ef221c04ae9d..4e8d1d6e3dfc2ee2f3f9f31cb4e5e6a925d4e539 100644 (file)
@@ -1,3 +1,12 @@
+#include "mutator_buffs.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../../common/buffs.qh"
+
+.float lifetime;
+
 float buffs_BuffModel_Customize()
 {
        entity player, myowner;
index 21dd71f98b5dfc74302c10c01510b37073ee2fb3..bacc590b78d731f3d639ae99cbf7cbbc3ef554f8 100644 (file)
@@ -1,3 +1,9 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../campaign.qh"
+
 .float campcheck_nextcheck;
 .float campcheck_traveled_distance;
 
index 58d24a4d820c526376026c84bfa1c774e1506545..4537d047610b1c904cb5b505494036ef94715c0a 100644 (file)
@@ -1,3 +1,9 @@
+#include "mutator_dodging.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../../common/animdecide.qh"
 
 .float cvar_cl_dodging_timeout;
 
index b3502b0f783573c6467ec9752dc13d4d13326f0b..2e6b195809da44ad840071cc7bebe7df1ef54eef 100644 (file)
@@ -1,3 +1,10 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../cl_client.qh"
+#include "../../common/buffs.qh"
+
 void spawnfunc_item_minst_cells (void)
 {
        if (!g_instagib) { remove(self); return; }
index d1ab520001d4580b25bbd1d07470401a8b843fd0..e7c066afc3030117e399628344e43f45acc74c96 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile)
 {
        if(other.health)
index b4f9c37716c39c70426d05b5039a4735f84c37e8..ed7cd2074620616546212f546090a41c7d1fd685 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 MUTATOR_HOOKFUNCTION(melee_SetStartItems)
 {
        start_ammo_shells = warmup_start_ammo_shells = 0;
index d582c05ce7d39b3150eed52452e49cb99f1e1d78..686df9a567ad123316f2200c08e1e9d0c1efc4a9 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 .float midair_shieldtime;
 
 MUTATOR_HOOKFUNCTION(midair_PlayerDamage)
index d36f3ecbe82e566a030968198c11564cbefb7a2c..235845184cf13b73bb66b0d9da1dbed2f6d210bb 100644 (file)
@@ -1,3 +1,9 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../antilag.qh"
+
 .float multijump_count;
 .float multijump_ready;
 
index 8f7857b166846d58df78307e02a7eea8f444dd60..292bba261aad86083993bc4b699209d9e7f04db5 100644 (file)
@@ -1,3 +1,16 @@
+#include "mutator_nades.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "gamemode_keyhunt.qh"
+#include "gamemode_freezetag.qh"
+#include "../../common/nades.qh"
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
+.float lifetime;
+
 .entity nade_spawnloc;
 
 void nade_timer_think()
index 5aa94b1875d8d070ac6c76250874f586d31fdfcd..d52bd09ee32c68ddd70a332ca62bd139f4b287c7 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 /*
 
 CORE    laser   vortex     lg      rl      cry     gl      elec    hagar   fireb   hook
index a0ec6adaa020ca3d2273ee988886fe1e642d14d0..42a490b00e8befbf5bc4542200ecc86358155ec1 100644 (file)
@@ -1,6 +1,10 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 float g_nix_with_blaster;
 // WEAPONTODO
-float nix_weapon;
+int nix_weapon;
 float nix_nextchange;
 float nix_nextweapon;
 .float nix_lastchange_id;
index 78a61510602787209533b227e909982e2d63d304..39b244a724ef97116cf988d0d186730cd72ae497 100644 (file)
@@ -1,4 +1,13 @@
-void ok_DecreaseCharge(entity ent, float wep)
+#include "mutator_overkill.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+void W_Blaster_Attack(float, float, float, float, float, float, float, float, float, float);
+void spawnfunc_weapon_hmg();
+void spawnfunc_weapon_rpc();
+
+void ok_DecreaseCharge(entity ent, int wep)
 {
        if(!ent.ok_use_ammocharge) return;
 
@@ -10,7 +19,7 @@ void ok_DecreaseCharge(entity ent, float wep)
        ent.ammo_charge[wep] -= max(0, cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname)));
 }
 
-void ok_IncreaseCharge(entity ent, float wep)
+void ok_IncreaseCharge(entity ent, int wep)
 {
        entity wepent = get_weaponinfo(wep);
 
@@ -22,7 +31,7 @@ void ok_IncreaseCharge(entity ent, float wep)
                ent.ammo_charge[wep] = min(autocvar_g_overkill_ammo_charge_limit, ent.ammo_charge[wep] + cvar(sprintf("g_overkill_ammo_charge_rate_%s", wepent.netname)) * frametime / W_TICSPERFRAME);
 }
 
-float ok_CheckWeaponCharge(entity ent, float wep)
+float ok_CheckWeaponCharge(entity ent, int wep)
 {
        if(!ent.ok_use_ammocharge) return true;
 
@@ -183,9 +192,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerSpawn)
 {
        if(autocvar_g_overkill_ammo_charge)
        {
-               float i;
-
-               for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+               for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
                        self.ammo_charge[i] = autocvar_g_overkill_ammo_charge_limit;
 
                self.ok_use_ammocharge = 1;
index 4963b3c8fe3cbee6a47b33e210e124eba3744ad7..d82bec99fecdaa24f5dea3b7eb0a28fc4e84f4e4 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 .vector spawn_origin, spawn_angles;
 
 void physical_item_think()
index 7cf405ef7679cc0331c5d89fb622d42cf1d97f5c..5dd6aa92e46e90b02aae2e1277f70460b9243db7 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
 {
        float j;
index f70ee4ba32c9d01d312a81a81e67ebfc9c34f5e2..b48deddcfa95c00f8bea029072efd283c2ca72a9 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 // Random Gravity
 //
 // Mutator by Mario
index 03a5bde619683445ac5929017ca51ade53936b71..5f684b353191f84bc45a150fb34b3609974b24e1 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile)
 {
        if(other.classname == "rocket" || other.classname == "mine")
index 8dc3bbc6c0ad049c50ed1702825221901a56b635..c3ab07a72635271dec43b04e0a87e1982361d8a6 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 .entity msnt_lookat;
 
 .float msnt_timer;
index 1fd1022e72d2131d57edacd22c8ed8e2df2f6c6e..3570e220431d531d437b60aff61de4aab2899c3e 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 #define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
 #define _ISLOCAL ((edict_num(1) == self) ? true : false)
 
index fb58b3955cbbbcae1913b3628bce8e354a521dff..a45c64f5c5b03fa42513b3f342ed3cd056510e76 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 .float touchexplode_time;
 
 void PlayerTouchExplode(entity p1, entity p2)
index aa45fc1acfb777fea7c1ea078f38767fded15f42..6b2859f440b17ec46b042e8d850c51f0fb231eb1 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 MUTATOR_HOOKFUNCTION(vampire_PlayerDamage)
 {
        if(time >= frag_target.spawnshieldtime)
index a0170e4803f04ae82fad8c363f97f3fa5f27d454..4c591446b734ab70a252f4bf16f5a799cbdd438f 100644 (file)
@@ -20,7 +20,7 @@
     #include "../../common/command/markup.qh"
     #include "../../common/command/rpn.qh"
     #include "../../common/command/generic.qh"
-    #include "../../common/command/shared_defs.qh"
+    #include "../../common/command/command.qh"
     #include "../../common/net_notice.qh"
     #include "../../common/animdecide.qh"
     #include "../../common/monsters/monsters.qh"
@@ -46,7 +46,7 @@
     #include "../../common/deathtypes.qh"
     #include "mutators_include.qh"
     #include "../tturrets/include/turrets_early.qh"
-    #include "../vehicles/vehicles_def.qh"
+    #include "../vehicles/vehicle.qh"
     #include "../campaign.qh"
     #include "../../common/campaign_common.qh"
     #include "../../common/mapinfo.qh"
@@ -77,7 +77,7 @@
     #include "../secret.qh"
     #include "../pathlib/pathlib.qh"
     #include "../tturrets/include/turrets.qh"
-    #include "../vehicles/vehicles.qh"
+    #include "../vehicles/all.qh"
 #endif
 
 #include "base.qc"
index f66b5019a603b06402290bd58adaf82d12d87563..3593c57b9e35be773c712378458bef3044bf3cf7 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 const float MAX_STORAGE_ATTACHMENTS = 16;
 float object_count;
 .float object_flood;
index 2f66441f7a00111eaca7ab8b4795ca06c15a65f1..cbc43240de75421a01cd7beddb37e7d31bc873fd 100644 (file)
@@ -1,54 +1,11 @@
-//#define PATHLIB_RDFIELDS
-#ifdef PATHLIB_RDFIELDS
-    #define path_next swampslug
-    #define path_prev lasertarget
-#else
-    .entity path_next;
-    .entity path_prev;
-#endif
+#include "pathlib.qh"
+#include "_all.qh"
+
+#include "g_subs.qh"
 
 #define medium spawnshieldtime
 
 //#define DEBUGPATHING
-
-entity openlist;
-entity closedlist;
-entity scraplist;
-
-.float pathlib_node_g;
-.float pathlib_node_h;
-.float pathlib_node_f;
-
-float pathlib_open_cnt;
-float pathlib_closed_cnt;
-float pathlib_made_cnt;
-float pathlib_merge_cnt;
-float pathlib_recycle_cnt;
-float pathlib_searched_cnt;
-
-#ifdef DEBUGPATHING
-
-#endif
-
-float pathlib_bestopen_seached;
-float pathlib_bestcash_hits;
-float pathlib_bestcash_saved;
-
-float pathlib_gridsize;
-
-float pathlib_movecost;
-float pathlib_movecost_diag;
-float pathlib_movecost_waterfactor;
-
-float pathlib_edge_check_size;
-
-float pathlib_foundgoal;
-entity goal_node;
-
-entity best_open_node;
-.float is_path_node;
-
-
 #ifdef DEBUGPATHING
 float edge_show(vector point,float fsize);
 void mark_error(vector where,float lifetime);
@@ -161,16 +118,6 @@ float floor_ok(vector point)
     return 0;
 }
 
-#define inwater(point) (pointcontents(point) == CONTENT_WATER)
-/*
-float inwater(vector point)
-{
-    if(pointcontents(point) == CONTENT_WATER)
-        return 1;
-    return 0;
-}
-*/
-
 #define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if (!floor_ok(trace_endpos)) return 1
 float edge_check(vector point,float fsize)
 {
@@ -259,7 +206,7 @@ vector pathlib_swimnode(vector start,vector end,float doedge)
     end.y = fsnap(end.y, pathlib_gridsize);
 
     if(pointcontents(end) == CONTENT_EMPTY)
-        return pathlib_wateroutnode( start, end);
+        return pathlib_wateroutnode( start, end, doedge);
 
     tracebox(start, walknode_boxmin,walknode_boxmax, end, MOVE_WORLDONLY, self);
     if(trace_fraction == 1)
@@ -519,7 +466,6 @@ float pathlib_h_diagonal3(vector a,vector b)
     return h;
 }
 
-//#define PATHLIB_USE_NODESCRAP
 const float PATHLIB_NODEEXPIRE = 0.05;
 float pathlib_scraplist_cnt;
 entity newnode()
@@ -541,7 +487,6 @@ entity newnode()
 #endif
     ++pathlib_made_cnt;
     n = spawn();
-#ifdef PATHLIB_NODEEXPIRE
     n.think      = SUB_Remove;
     n.nextthink  = time + PATHLIB_NODEEXPIRE;
     return n;
@@ -736,7 +681,7 @@ float pathlib_expandnode_star(entity node, vector start, vector goal)
 {
     vector point;
     vector where;
-    float nodecnt;
+    float nodecnt = 0;
 
     where = node.origin;
 
@@ -1044,6 +989,3 @@ entity pathlib_astar(vector from,vector to)
 
     return world;
 }
-
-
-
diff --git a/qcsrc/server/pathlib.qh b/qcsrc/server/pathlib.qh
new file mode 100644 (file)
index 0000000..da4ae0c
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef PATHLIB_H
+#define PATHLIB_H
+
+//#define PATHLIB_RDFIELDS
+#ifdef PATHLIB_RDFIELDS
+    #define path_next swampslug
+    #define path_prev lasertarget
+#else
+    .entity path_next;
+    .entity path_prev;
+#endif
+
+entity openlist;
+entity closedlist;
+entity scraplist;
+
+.float pathlib_node_g;
+.float pathlib_node_h;
+.float pathlib_node_f;
+
+float pathlib_open_cnt;
+float pathlib_closed_cnt;
+float pathlib_made_cnt;
+float pathlib_merge_cnt;
+float pathlib_recycle_cnt;
+float pathlib_searched_cnt;
+
+float pathlib_bestopen_seached;
+float pathlib_bestcash_hits;
+float pathlib_bestcash_saved;
+
+float pathlib_gridsize;
+
+float pathlib_movecost;
+float pathlib_movecost_diag;
+float pathlib_movecost_waterfactor;
+
+float pathlib_edge_check_size;
+
+float pathlib_foundgoal;
+entity goal_node;
+
+entity best_open_node;
+.float is_path_node;
+
+#define inwater(point) (pointcontents(point) == CONTENT_WATER)
+
+#endif
index 0b2ee4559995671b324050c7664cf0dc2455a5e5..878e8fd5b113fda6f8e03a6fb6f2b04521999d85 100644 (file)
@@ -1,3 +1,5 @@
+#include "../pathlib.qh"
+
 float pathlib_g_static(entity parent,vector to, float static_cost)
 {
     return parent.pathlib_node_g + static_cost;
index 4f73b24733bcbf75714a07a33db840cb4e9bc8b6..5c97cf7ac41575adba77f604d88399f000597d95 100644 (file)
@@ -1,3 +1,4 @@
+#include "../pathlib.qh"
 
 #ifdef TURRET_DEBUG
 void mark_error(vector where,float lifetime);
@@ -65,6 +66,8 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align)
     }
 }
 
+void SUB_Remove();
+
 void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 {
     entity s;
index 4427f9b7fd03f432fc23a6c9d370ebb36629d672..9d49be9ecea3c9a5eb8a5cb75188d56bdfc6ee5a 100644 (file)
@@ -1,3 +1,6 @@
+#include "pathlib.qh"
+#include "utility.qh"
+
 vector plib_points2[8];
 vector plib_points[8];
 float  plib_fvals[8];
@@ -5,7 +8,7 @@ float  plib_fvals[8];
 float pathlib_expandnode_starf(entity node, vector start, vector goal)
 {
     vector where,f,r,t;
-    float i,fc,fc2,c;
+    float fc,c;
     entity nap;
 
     where = node.origin;
@@ -37,7 +40,7 @@ float pathlib_expandnode_starf(entity node, vector start, vector goal)
     // Back-left
     plib_points[7] = where - f - r;
 
-    for(i=0;i < 8; ++i)
+    for(int i=0;i < 8; ++i)
     {
         t = plib_points[i];
         fc  = pathlib_heuristic(t,goal) + pathlib_cost(node, t, pathlib_gridsize);
@@ -49,8 +52,8 @@ float pathlib_expandnode_starf(entity node, vector start, vector goal)
     plib_points2[0] = plib_points[0];
     vector bp;
     bp = plib_points[0];
-    fc2 = 0;
-    for(i = 0; i < 8; ++i)
+    int fc2 = 0;
+    for(int i = 0; i < 8; ++i)
     {
         c = 0;
         nap = pathlib_nodeatpoint(plib_points[i]);
@@ -80,7 +83,7 @@ float pathlib_expandnode_starf(entity node, vector start, vector goal)
 
     pathlib_makenode(node, start, bp, goal, pathlib_gridsize);
 
-    for(i = 0; i < 3; ++i)
+    for(int i = 0; i < 3; ++i)
     {
         pathlib_makenode(node, start, plib_points2[i], goal, pathlib_gridsize);
     }
index 5fef3251f64b568680f124c442a85572d2ee35c0..cf000801a855afd15481a24ce1480aa77a7521e4 100644 (file)
@@ -1,3 +1,9 @@
+#include "../_all.qh"
+
+#include "pathlib.qh"
+#include "utility.qh"
+#include "../command/common.qh"
+
 void pathlib_deletepath(entity start)
 {
     entity e;
diff --git a/qcsrc/server/pathlib/main.qh b/qcsrc/server/pathlib/main.qh
new file mode 100644 (file)
index 0000000..177c432
--- /dev/null
@@ -0,0 +1,5 @@
+#ifndef PATHLIB_MAIN_H
+#define PATHLIB_MAIN_H
+float buildpath_nodefilter_none(vector n,vector c,vector p);
+entity path_build(entity next, vector where, entity prev, entity start);
+#endif
index 1da6fe16718065a64a0f69ef81767a496399bbaa..f1e596d798dab61eaabca0f54309209a499b181a 100644 (file)
@@ -1,3 +1,8 @@
+#include "../_all.qh"
+
+#include "pathlib.qh"
+#include "utility.qh"
+
 vector pathlib_wateroutnode(vector start,vector end, float doedge)
 {
     vector surface;
index 231c14f21bbbf6b6c8464a62d857ba593394116d..1bc115dc0e49323e033963aa227c9ed4402635bc 100644 (file)
@@ -1,3 +1,8 @@
+#include "../bot/waypoints.qh"
+
+#include "pathlib.qh"
+#include "main.qh"
+
 var float pathlib_wpp_open(entity wp, entity child, float cost);
 
 void pathlib_wpp_close(entity wp)
index d0029bfc4809be08e2d93195781100a082c755ad..dbf785266ae67a266a1b9d9c4f66ebac245fc60c 100644 (file)
@@ -113,10 +113,4 @@ var float  pathlib_wpp_waypointcallback(entity wp, entity wp_prev);
        #include "debug.qc"
 #endif
 
-#include "utility.qc"
-#include "movenode.qc"
-#include "costs.qc"
-#include "expandnode.qc"
-#include "main.qc"
-#include "path_waypoint.qc"
 #endif
index 7bdc70877420a38d60bd7ce7b3da04e99abe4c28..4851dbcc0c52db8a957bf80d2ab85f2762fe80f8 100644 (file)
@@ -1,3 +1,7 @@
+#include "utility.qh"
+
+#include "pathlib.qh"
+
 float fsnap(float val,float fsize)
 {
     return rint(val / fsize) * fsize;
diff --git a/qcsrc/server/pathlib/utility.qh b/qcsrc/server/pathlib/utility.qh
new file mode 100644 (file)
index 0000000..bf72549
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef PATHLIB_UTILITY
+#define PATHLIB_UTILITY
+float fsnap(float val,float fsize);
+entity pathlib_nodeatpoint(vector where);
+float tile_check_plus2(vector where);
+#endif
index 4d58a95f6ff0bc82da280d6f60bc22628d389f4b..c2e812c2c10e6463e49ec2cee4185c23fce5d8b3 100644 (file)
@@ -71,27 +71,27 @@ void playerdemo_open_write(string f)
 
 void playerdemo_write_originvector(.vector f, string name)
 {
-       fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+       fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
 }
 void playerdemo_write_sizevector(.vector f, string name)
 {
-       fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+       fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
 }
 void playerdemo_write_vector(.vector f, string name)
 {
-       fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+       fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
 }
 void playerdemo_write_string(.string f, string name)
 {
-       fputs(self.playerdemo_fh, strcat(self.f, "\n"));
+       fputs(self.playerdemo_fh, strcat(self.(f), "\n"));
 }
 void playerdemo_write_modelstring(.string f, string name)
 {
-       fputs(self.playerdemo_fh, strcat(self.f, "\n"));
+       fputs(self.playerdemo_fh, strcat(self.(f), "\n"));
 }
 void playerdemo_write_float(.float f, string name)
 {
-       fputs(self.playerdemo_fh, strcat(ftos(self.f), "\n"));
+       fputs(self.playerdemo_fh, strcat(ftos(self.(f)), "\n"));
 }
 void playerdemo_write()
 {
@@ -106,36 +106,34 @@ void playerdemo_read_originvector(.vector f, string name)
 }
 void playerdemo_read_sizevector(.vector f, string name)
 {
-       self.f = stov(fgets(self.playerdemo_fh));
+       self.(f) = stov(fgets(self.playerdemo_fh));
        setsize(self, self.mins, self.maxs);
 }
 void playerdemo_read_vector(.vector f, string name)
 {
-       self.f = stov(fgets(self.playerdemo_fh));
+       self.(f) = stov(fgets(self.playerdemo_fh));
 }
 void playerdemo_read_string(.string f, string name)
 {
-       string s;
-       s = fgets(self.playerdemo_fh);
-       if(s != self.f)
+       string s = fgets(self.playerdemo_fh);
+       if (s != self.(f))
        {
                /*
                if(self.f)
                        strunzone(self.f);
                */
-               self.f = strzone(s);
+               self.(f) = strzone(s);
        }
 }
 void playerdemo_read_modelstring(.string f, string name)
 {
-       string s;
-       s = fgets(self.playerdemo_fh);
-       if(s != self.f)
+       string s = fgets(self.playerdemo_fh);
+       if (s != self.(f))
                setmodel(self, s);
 }
 void playerdemo_read_float(.float f, string name)
 {
-       self.f = stof(fgets(self.playerdemo_fh));
+       self.(f) = stof(fgets(self.playerdemo_fh));
 }
 float playerdemo_read()
 {
index 8d061cdb882b8c43521bdc5863beff1ba03eac90..b9d32e106dc61106412390ec048fcb1fd375b646 100644 (file)
@@ -1,22 +1,18 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/anglestransform.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "autocvars.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
-    #include "../csqcmodellib/sv_model.qh"
-    #include "portals.qh"
-    #include "g_hook.qh"
-#endif
+#include "portals.qh"
+#include "_all.qh"
+
+#include "g_hook.qh"
+#include "g_subs.qh"
+#include "mutators/mutators_include.qh"
+#include "t_teleporters.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/sv_model.qh"
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/util_server.qh"
 
 #define PORTALS_ARE_NOT_SOLID
 
index 85e75cda9e2fce18b2f2715b0bd1c10e8452b7bb..20b28a410ddc9183295357042b5edb34de04b038 100644 (file)
@@ -8,7 +8,6 @@ sys-post.qh
 
 anticheat.qc
 antilag.qc
-// assault.qc
 campaign.qc
 cheats.qc
 cl_client.qc
@@ -16,13 +15,12 @@ cl_impulse.qc
 cl_physics.qc
 cl_player.qc
 csqceffects.qc
-// ctf.qc
-// domination.qc
 ent_cs.qc
 func_breakable.qc
 g_casings.qc
 g_damage.qc
 g_hook.qc
+// g_lights.qc // TODO: was never used
 g_models.qc
 g_subs.qc
 g_tetris.qc
@@ -33,14 +31,12 @@ ipban.qc
 item_key.qc
 mapvoting.qc
 miscfunctions.qc
-// mode_onslaught.qc
 movelib.qc
-// nexball.qc
+// pathlib.qc // TODO: was never used. Seems to duplicate `pathlib/`
 playerdemo.qc
 portals.qc
 race.qc
 round_handler.qc
-// runematch.qc
 scores.qc
 scores_rules.qc
 secret.qc
@@ -54,25 +50,37 @@ t_halflife.qc
 t_items.qc
 t_jumppads.qc
 t_plats.qc
-t_quake3.qc
 t_quake.qc
+t_quake3.qc
 t_swamp.qc
 t_teleporters.qc
 waypointsprites.qc
 
+bot/aim.qc
 bot/bot.qc
+bot/navigation.qc
+bot/scripting.qc
+bot/waypoints.qc
+
+bot/havocbot/havocbot.qc
+bot/havocbot/role_keyhunt.qc
+bot/havocbot/role_onslaught.qc
+bot/havocbot/roles.qc
 
-command/banning.qc
-command/cmd.qc
-command/common.qc
-command/getreplies.qc
-command/radarmap.qc
-command/sv_cmd.qc
-command/vote.qc
+command/commands.qc
 
 mutators/mutators_include.qc
 mutators/mutators.qc
 
+pathlib/costs.qc
+pathlib/expandnode.qc
+pathlib/main.qc
+pathlib/movenode.qc
+pathlib/path_waypoint.qc
+pathlib/utility.qc
+
+vehicles/all.qc
+
 weapons/accuracy.qc
 weapons/common.qc
 weapons/csqcprojectile.qc // TODO
@@ -88,9 +96,6 @@ weapons/weaponsystem.qc
 ../common/buffs.qc
 ../common/campaign_file.qc
 ../common/campaign_setup.qc
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
 ../common/mapinfo.qc
 ../common/monsters/monsters.qc
 ../common/monsters/spawn.qc
index bb7f0eccc2297ad547b06181fa225d3957ad318d..4482fe327901b7e42a4e91da460fc596f6f3d525 100644 (file)
@@ -1,4 +1,18 @@
 #include "race.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "portals.qh"
+#include "scores.qh"
+#include "spawnpoints.qh"
+#include "waypointsprites.qh"
+#include "bot/waypoints.qh"
+#include "bot/navigation.qh"
+#include "command/getreplies.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/mapinfo.qh"
+#include "../warpzonelib/util_server.qh"
 
 void W_Porto_Fail(float failhard);
 
@@ -79,7 +93,6 @@ void spawnfunc_target_checkpoint();
 .float race_penalty_accumulator;
 .string race_penalty_reason;
 .float race_checkpoint; // player: next checkpoint that has to be reached
-.float race_laptime;
 .entity race_lastpenalty;
 
 .entity sprite;
@@ -176,6 +189,27 @@ void race_send_recordtime(float msg)
        WriteInt24_t(msg, race_readTime(GetMapname(), 1));
 }
 
+
+void race_send_speedaward(float msg)
+{
+       // send the best speed of the round
+       WriteByte(msg, SVC_TEMPENTITY);
+       WriteByte(msg, TE_CSQC_RACE);
+       WriteByte(msg, RACE_NET_SPEED_AWARD);
+       WriteInt24_t(msg, floor(speedaward_speed+0.5));
+       WriteString(msg, speedaward_holder);
+}
+
+void race_send_speedaward_alltimebest(float msg)
+{
+       // send the best speed
+       WriteByte(msg, SVC_TEMPENTITY);
+       WriteByte(msg, TE_CSQC_RACE);
+       WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
+       WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
+       WriteString(msg, speedaward_alltimebest_holder);
+}
+
 void race_SendRankings(float pos, float prevpos, float del, float msg)
 {
        WriteByte(msg, SVC_TEMPENTITY);
index bfdc9be4305b80f27265d4c526694a51cfd6ee1e..47c1db4a3860176672e7e9ad486be8cf06a1f181 100644 (file)
@@ -10,6 +10,7 @@ float race_timelimit;
 .float race_place;
 .float race_started;
 .float race_completed;
+.float race_laptime;
 float race_completing;
 
 .float race_movetime; // for reading
@@ -29,4 +30,26 @@ float race_GetFractionalLapCount(entity e);
 float race_readTime(string map, float pos);
 string race_readUID(string map, float pos);
 string race_readName(string map, float pos);
+void race_ClearRecords();
+void race_SendNextCheckpoint(entity e, float spec);
+void race_PreparePlayer();
+void race_send_recordtime(float msg);
+void race_send_speedaward(float msg);
+
+float speedaward_speed;
+string speedaward_holder;
+string speedaward_uid;
+
+float speedaward_alltimebest;
+string speedaward_alltimebest_holder;
+string speedaward_alltimebest_uid;
+
+void race_send_speedaward(float msg);
+
+void race_send_speedaward_alltimebest(float msg);
+
+void race_SendRankings(float pos, float prevpos, float del, float msg);
+
+void race_RetractPlayer();
+
 #endif
index 70d2d144d984c5c3220c0d8da9cc7a9c25f159dc..d5b0281338ac22f1999db48338432feb482f0af2 100644 (file)
@@ -1,12 +1,8 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/util.qh"
-    #include "defs.qh"
-    #include "round_handler.qh"
-#endif
+#include "round_handler.qh"
+#include "_all.qh"
+
+#include "command/vote.qh"
+#include "../common/util.qh"
 
 void round_handler_Think()
 {
index f196220f524ae16e9a1ada8cc1d201efe6329fb5..57f5e95f8fd6878951ac9d42e5ce79c7ba1dcbd2 100644 (file)
@@ -1,4 +1,10 @@
 #include "scores.qh"
+#include "_all.qh"
+
+#include "command/common.qh"
+#include "mutators/mutators_include.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
 
 .entity scorekeeper;
 entity teamscorekeepers[16];
@@ -18,29 +24,29 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags,
                return previous;
        if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y)
                return previous;
-       if(t1.field == t2.field)
+       if (t1.(field) == t2.(field))
                return previous;
 
        previous.y = fieldflags & SFL_SORT_PRIO_MASK;
 
        if(fieldflags & SFL_ZERO_IS_WORST)
        {
-               if(t1.field == 0)
+               if (t1.(field) == 0)
                {
                        previous.x = -1;
                        return previous;
                }
-               else if(t2.field == 0)
+               else if (t2.(field) == 0)
                {
                        previous.x = +1;
                        return previous;
                }
        }
 
-       if(fieldflags & SFL_LOWER_IS_BETTER)
-               previous.x = (t2.field - t1.field);
+       if (fieldflags & SFL_LOWER_IS_BETTER)
+               previous.x = (t2.(field) - t1.(field));
        else
-               previous.x = (t1.field - t2.field);
+               previous.x = (t1.(field) - t2.(field));
 
        return previous;
 }
@@ -699,7 +705,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat
        plist = world;
 
        FOR_EACH_CLIENT(p)
-               p.field = 0;
+               p.(field) = 0;
 
        FOR_EACH_CLIENT(p) if(p.scorekeeper)
        {
@@ -739,7 +745,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat
                if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
                        j = i;
 
-               pbest.field = j;
+               pbest.(field) = j;
 
                if (!pfirst)
                        pfirst = pbest;
index ff0555cad6cf4d24a27dc9089a327d45dc9bed97..8c9af4534fa1158106727abaf7b52716f4ad0908 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef SCORES_H
 #define SCORES_H
 
+#include "../common/constants.qh"
+
 entity scores_initialized; // non-world when scores labels/rules have been set
 .float scores[MAX_SCORE];
 .float teamscores[MAX_TEAMSCORE];
index 4d5296c81603503cafd812c5b5d59c29e1e7786e..aefb1754b5ceaab137e2e4d1bb13fa4fa2a3374f 100644 (file)
@@ -1,14 +1,9 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../common/constants.qh"
-    #include "autocvars.qh"
-    #include "defs.qh"
-    #include "scores.qh"
-#endif
-
-//float c1, c2, c3, c4;
+#include "scores_rules.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "scores.qh"
+
 void CheckAllowedTeams (entity for_whom);
 
 // NOTE: SP_ constants may not be >= MAX_SCORE; ST_constants may not be >= MAX_TEAMSCORE
diff --git a/qcsrc/server/scores_rules.qh b/qcsrc/server/scores_rules.qh
new file mode 100644 (file)
index 0000000..b307eeb
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef SCORES_RULES_H
+#define SCORES_RULES_H
+
+void ScoreRules_basics(float teams, float sprio, float stprio, float score_enabled);
+void ScoreRules_basics_end();
+void ScoreRules_generic();
+
+#endif
index 30fbedc4948a27187949b09a43348ed7fe5c9040..f83026f699c4e306c536256e5822a3814b78da8c 100644 (file)
@@ -1,11 +1,8 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../common/util.qh"
-    #include "defs.qh"
-    #include "secret.qh"
-#endif
+#include "secret.qh"
+#include "_all.qh"
+
+#include "g_triggers.qh"
+#include "../common/util.qh"
 
 void secrets_setstatus() {
        self.stat_secrets_total = secrets_total;
index 91add1a405b8517a7c61bd05133cdbc085ac25d3..e8e70402a3968f340f5c2ac68021c9836193abea 100644 (file)
@@ -1,19 +1,13 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../common/constants.qh"
-    #include "../common/teams.qh"
-    #include "../common/util.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "mutators/mutators_include.qh"
-    #include "spawnpoints.qh"
-    #include "race.qh"
-#endif
+#include "spawnpoints.qh"
+#include "_all.qh"
+
+#include "mutators/mutators_include.qh"
+#include "g_world.qh"
+#include "race.qh"
+#include "../common/constants.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/util_server.qh"
 
 float SpawnPoint_Send(entity to, int sf)
 {
index ec76dfef2cda72354df3d1557fdd30e71f19dd7b..f102017b5fc79ce58ae10a4117db276acfe33bc5 100644 (file)
@@ -5,8 +5,6 @@
     #include "../dpdefs/dpextensions.qh"
 #endif
 
-.vector steerto;
-
 /**
     Uniform pull towards a point
 **/
diff --git a/qcsrc/server/steerlib.qh b/qcsrc/server/steerlib.qh
new file mode 100644 (file)
index 0000000..fcd35ba
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef STEERLIB_H
+#define STEERLIB_H
+
+.vector steerto;
+
+vector steerlib_arrive(vector point,float maximal_distance);
+vector steerlib_attract2(vector point, float min_influense,float max_distance,float max_influense);
+vector steerlib_pull(vector point);
+
+#endif
index c2d3dc7dd855c3eb3f84e6f0dd0efde296a30e09..5982d20284532a23020c7dc76e95ce96523a04b8 100644 (file)
@@ -1,26 +1,31 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/common.qh"
-    #include "../warpzonelib/server.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "weapons/csqcprojectile.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
-    #include "vehicles/vehicles_def.qh"
-    #include "../common/mapinfo.qh"
-    #include "command/common.qh"
-    #include "../csqcmodellib/sv_model.qh"
-    #include "anticheat.qh"
-    #include "g_hook.qh"
-#endif
+#include "_all.qh"
+
+#include "anticheat.qh"
+#include "g_hook.qh"
+#include "g_world.qh"
+
+#include "bot/bot.qh"
+#include "bot/waypoints.qh"
+
+#include "command/common.qh"
+
+#include "mutators/mutators_include.qh"
+#include "vehicles/vehicle.qh"
+#include "weapons/csqcprojectile.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/server.qh"
+
+.float lastground;
 
 void CreatureFrame (void)
 {
index 681c5dc7d3f0998788b485baf38bd495d49a9682..32d597937cc2a422b35176da195cd697ed6b1c90 100644 (file)
@@ -1,11 +1,10 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "defs.qh"
-    #include "vehicles/vehicles_def.qh"
-#endif
+#include "_all.qh"
+
+#include "../warpzonelib/util_server.qh"
+#include "vehicles/vehicle.qh"
+
+.float  ladder_time;
+.entity ladder_entity;
 
 .float  roomtype;
 .float  radius;
index 72e3b09618538e218547b8d76a3dfbd4b5e53ce8..6839091f4a4b4f5a97af1578dc94a7da832f487c 100644 (file)
@@ -1,31 +1,30 @@
-#if defined(CSQC)
-    #include "../dpdefs/csprogsdefs.qh"
-    #include "../common/util.qh"
-    #include "../common/buffs.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "../client/autocvars.qh"
-    #include "../client/movetypes.qh"
-    #include "../client/main.qh"
-    #include "../csqcmodellib/common.qh"
-    #include "../csqcmodellib/cl_model.qh"
-    #include "t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-    #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/util_server.qh"
+#include "t_items.qh"
+
+#if defined(SVQC)
+    #include "_all.qh"
+
+    #include "g_subs.qh"
+    #include "waypointsprites.qh"
+
+    #include "bot/bot.qh"
+    #include "bot/waypoints.qh"
+
+    #include "mutators/mutators_include.qh"
+
+    #include "weapons/common.qh"
+    #include "weapons/selection.qh"
+    #include "weapons/weaponsystem.qh"
+
     #include "../common/constants.qh"
+    #include "../common/deathtypes.qh"
+    #include "../common/notifications.qh"
     #include "../common/util.qh"
+
     #include "../common/monsters/monsters.qh"
+
     #include "../common/weapons/weapons.qh"
-    #include "weapons/weaponsystem.qh"
-    #include "t_items.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
-    #include "mutators/mutators_include.qh"
+
+    #include "../warpzonelib/util_server.qh"
 #endif
 
 #ifdef CSQC
@@ -537,23 +536,23 @@ void Item_ScheduleInitialRespawn(entity e)
 
 float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
 {
-       if (!item.ammotype)
+       if (!item.(ammotype))
                return false;
 
        if (item.spawnshieldtime)
        {
-               if ((player.ammotype < ammomax) || item.pickup_anyway)
+               if ((player.(ammotype) < ammomax) || item.pickup_anyway)
                {
-                       player.ammotype = bound(player.ammotype, ammomax, player.ammotype + item.ammotype);
+                       player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype));
                        goto YEAH;
                }
        }
        else if(g_weapon_stay == 2)
        {
-               float mi = min(item.ammotype, ammomax);
-               if (player.ammotype < mi)
+               float mi = min(item.(ammotype), ammomax);
+               if (player.(ammotype) < mi)
                {
-                       player.ammotype = mi;
+                       player.(ammotype) = mi;
                        goto YEAH;
                }
        }
@@ -811,7 +810,7 @@ float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickup
 
 float weapon_pickupevalfunc(entity player, entity item)
 {
-       float c, j, position;
+       float c;
 
        // See if I have it already
        if(item.weapons & ~player.weapons)
@@ -834,8 +833,8 @@ float weapon_pickupevalfunc(entity player, entity item)
        if( bot_custom_weapon && c )
        {
                // Find the highest position on any range
-               position = -1;
-               for(j = 0; j < WEP_LAST ; ++j){
+               int position = -1;
+               for (int j = 0; j < WEP_LAST ; ++j){
                        if(
                                        bot_weapons_far[j] == item.weapon ||
                                        bot_weapons_mid[j] == item.weapon ||
@@ -1160,7 +1159,6 @@ void spawnfunc_item_rockets (void) {
        StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000);
 }
 
-void spawnfunc_item_shells (void);
 void spawnfunc_item_bullets (void) {
        if(!weaponswapping)
        if(autocvar_sv_q3acompat_machineshotgunswap)
@@ -1530,56 +1528,56 @@ float GiveWeapon(entity e, float wpn, float op, float val)
 float GiveBit(entity e, .float fld, float bit, float op, float val)
 {
        float v0, v1;
-       v0 = (e.fld & bit);
+       v0 = (e.(fld) & bit);
        switch(op)
        {
                case OP_SET:
                        if(val > 0)
-                               e.fld |= bit;
+                               e.(fld) |= bit;
                        else
-                               e.fld &= ~bit;
+                               e.(fld) &= ~bit;
                        break;
                case OP_MIN:
                case OP_PLUS:
                        if(val > 0)
-                               e.fld |= bit;
+                               e.(fld) |= bit;
                        break;
                case OP_MAX:
                        if(val <= 0)
-                               e.fld &= ~bit;
+                               e.(fld) &= ~bit;
                        break;
                case OP_MINUS:
                        if(val > 0)
-                               e.fld &= ~bit;
+                               e.(fld) &= ~bit;
                        break;
        }
-       v1 = (e.fld & bit);
+       v1 = (e.(fld) & bit);
        return (v0 != v1);
 }
 
 float GiveValue(entity e, .float fld, float op, float val)
 {
        float v0, v1;
-       v0 = e.fld;
+       v0 = e.(fld);
        switch(op)
        {
                case OP_SET:
-                       e.fld = val;
+                       e.(fld) = val;
                        break;
                case OP_MIN:
-                       e.fld = max(e.fld, val); // min 100 cells = at least 100 cells
+                       e.(fld) = max(e.(fld), val); // min 100 cells = at least 100 cells
                        break;
                case OP_MAX:
-                       e.fld = min(e.fld, val);
+                       e.(fld) = min(e.(fld), val);
                        break;
                case OP_PLUS:
-                       e.fld += val;
+                       e.(fld) += val;
                        break;
                case OP_MINUS:
-                       e.fld -= val;
+                       e.(fld) -= val;
                        break;
        }
-       v1 = e.fld;
+       v1 = e.(fld);
        return (v0 != v1);
 }
 
@@ -1602,9 +1600,9 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn
 void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .float regenfield, float regentime)
 {
        if(v0 < v1)
-               e.rotfield = max(e.rotfield, time + rottime);
+               e.(rotfield) = max(e.(rotfield), time + rottime);
        else if(v0 > v1)
-               e.regenfield = max(e.regenfield, time + regentime);
+               e.(regenfield) = max(e.(regenfield), time + regentime);
 }
 float GiveItems(entity e, float beginarg, float endarg)
 {
index ae4ecdb769375b17065136d95373c6411a9f7296..7470d2f05b70feedf6a15e1a6e06095ec6c2b4c6 100644 (file)
@@ -10,10 +10,14 @@ const int IT_JETPACK                        =      16; // actual item
 const int IT_FUEL_REGEN                        =      32; // fuel regeneration trigger
 // where is 64... ?
 const int IT_FUEL                                      =     128;
-const int IT_SHELLS                                    =     256;
-const int IT_NAILS                                     =     512;
-const int IT_ROCKETS                                   =    1024;
-const int IT_CELLS                                     =    2048;
+// -Wdouble-declaration
+// const int IT_SHELLS                                 =     256;
+// -Wdouble-declaration
+// const int IT_NAILS                                  =     512;
+// -Wdouble-declaration
+// const int IT_ROCKETS                                =    1024;
+// -Wdouble-declaration
+// const int IT_CELLS                                  =    2048;
 const int IT_SUPERWEAPON                               =    4096;
 const int IT_STRENGTH                                  =    8192;
 const int IT_INVINCIBLE                                =   16384;
@@ -22,8 +26,10 @@ const int IT_PLASMA                                  =   65536;
 
 // shared value space (union):
        // for items:
-       const int IT_KEY1                                       =  131072;
-       const int IT_KEY2                                       =  262144;
+       // -Wdouble-declaration
+       #define IT_KEY1                                                 131072
+       // -Wdouble-declaration
+       #define IT_KEY2                                                 262144
        // for players:
        const int IT_RED_FLAG_TAKEN             =   32768;
        const int IT_RED_FLAG_LOST              =   65536;
@@ -84,6 +90,13 @@ void ItemRead(float _IsNew);
 
 #endif
 #ifdef SVQC
+void spawnfunc_item_strength();
+void spawnfunc_item_invincible();
+void spawnfunc_item_armor_small();
+void spawnfunc_item_shells();
+void spawnfunc_item_bullets();
+void spawnfunc_item_rockets();
+
 float autocvar_sv_simple_items;
 bool ItemSend(entity to, int sf);
 
index 92af1cdd093b0733fe922e4423d96da706693457..4cafb85b003a7c259b09849b32bd4cee942e6f4a 100644 (file)
@@ -1,4 +1,16 @@
 #include "t_jumppads.qh"
+#include "_all.qh"
+
+#include "g_subs.qh"
+
+#include "bot/navigation.qh"
+#include "bot/waypoints.qh"
+
+#include "weapons/csqcprojectile.qh"
+
+#include "../common/animdecide.qh"
+
+#include "../warpzonelib/util_server.qh"
 
 void trigger_push_use()
 {
index ebe1676c777d2136074b831d13c4b159d6ad7c58..cec1a7f6bcc79765122095452bbc3d14ea6ce383 100644 (file)
@@ -1,21 +1,27 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/mathlib.qh"
-    #include "../warpzonelib/common.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "../common/weapons/weapons.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
-    #include "command/common.qh"
-    #include "../csqcmodellib/sv_model.qh"
-#endif
+#include "_all.qh"
+
+#include "bot/bot.qh"
+
+#include "command/common.qh"
+
+#include "g_damage.qh"
+#include "g_subs.qh"
+#include "item_key.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
+#include "../warpzonelib/util_server.qh"
+
+.float height;
 
 .float dmgtime2;
 void generic_plat_blocked()
index 9b25c8860905440b3b724ec09c261a6fcfbbc14a..9e68ac8124f2d56a4743939125f9d31370166c06 100644 (file)
@@ -1,4 +1,15 @@
-#include "../common/weapons/weapons.qc"
+#include "_all.qh"
+
+#include "../common/weapons/weapons.qh"
+
+void spawnfunc_weapon_electro();
+void spawnfunc_weapon_hagar();
+void spawnfunc_weapon_machinegun();
+void spawnfunc_item_bullets();
+void spawnfunc_item_armor_large();
+void spawnfunc_item_armor_large();
+void spawnfunc_item_health_mega();
+void spawnfunc_item_health_medium();
 
 //***********************
 //QUAKE 1 ENTITIES - So people can play quake1 maps with the xonotic weapons
index ed90bf054c0c1aeeed5668afd43c3b3e0eb09d26..2c5bd894ea54bd4c78c28f6ca3e33ef4d21074b2 100644 (file)
@@ -1,4 +1,29 @@
-#include "../common/weapons/weapons.qc"
+#include "_all.qh"
+
+#include "../common/weapons/weapons.qh"
+#include "../common/buffs.qh"
+
+void spawnfunc_weapon_crylink();
+void spawnfunc_weapon_electro();
+void spawnfunc_weapon_hagar();
+void spawnfunc_weapon_machinegun();
+void spawnfunc_weapon_vortex();
+
+void spawnfunc_target_items();
+
+void spawnfunc_item_bullets();
+void spawnfunc_item_cells();
+void spawnfunc_item_rockets();
+void spawnfunc_item_shells();
+
+void spawnfunc_item_jetpack();
+
+void spawnfunc_item_armor_big();
+void spawnfunc_item_armor_large();
+void spawnfunc_item_armor_small();
+
+void spawnfunc_item_health_medium();
+void spawnfunc_item_health_mega();
 
 //***********************
 //QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons
index b63e7ffe31ee332ffc61c2f3eb5b789dbdf5ff97..1c80c3ac04c2ebcc4224b9fdae521c4dc187e62c 100644 (file)
@@ -1,10 +1,10 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
+       #include "_all.qh"
+
     #include "../warpzonelib/util_server.qh"
     #include "../common/weapons/weapons.qh"
-    #include "defs.qh"
     #include "../common/deathtypes.qh"
 #endif
 
index 46df0eb78636d45f82d5cab7e64ff1f2cdfa412f..4ea5f3b45d98311b409c4a7d6cba4ec4c02ababc 100644 (file)
@@ -1,23 +1,22 @@
 #include "t_teleporters.qh"
-
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-    #include "../warpzonelib/common.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../warpzonelib/server.qh"
-    #include "../common/constants.qh"
-    #include "../common/util.qh"
-    #include "weapons/csqcprojectile.qh"
-    #include "autocvars.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-    #include "../common/deathtypes.qh"
-    #include "tturrets/include/turrets_early.qh"
-    #include "vehicles/vehicles_def.qh"
-    #include "../common/mapinfo.qh"
-    #include "anticheat.qh"
-#endif
+#include "_all.qh"
+
+#include "anticheat.qh"
+#include "cl_player.qh"
+#include "g_hook.qh"
+#include "bot/waypoints.qh"
+#include "tturrets/include/turrets_early.qh"
+#include "vehicles/vehicle.qh"
+#include "weapons/csqcprojectile.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/server.qh"
+#include "../warpzonelib/util_server.qh"
+
+.float lastteleporttime;
 
 void trigger_teleport_use()
 {
index be476d758fec7c264d94a43c996885483ab78e36..681a4ca6d194bb1586447743c4ef8f70b8e48d01 100644 (file)
@@ -1,13 +1,6 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/constants.qh"
-    #include "constants.qh"
-    #include "defs.qh"
-#endif
+#include "_all.qh"
 
+.float volume;
 .float lifetime;
 // values:
 //   volume
index b4b9b1830509f846efa7aa64f3d701600a07974b..6ebb837b5f9ed32e88787e2662af4a49729d6b2b 100644 (file)
@@ -1,11 +1,7 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../common/util.qh"
-    #include "defs.qh"
-#endif
+#include "_all.qh"
+
+.entity pusher;
+.float pushltime;
 
 // spawner entity
 // "classname" "target_spawn"
@@ -315,7 +311,7 @@ void initialize_field_db()
        {
                float n, i;
                string fn;
-               vector prev, new;
+               vector prev, next;
                float ft;
 
                n = numentityfields();
@@ -323,11 +319,11 @@ void initialize_field_db()
                {
                        fn = entityfieldname(i);
                        ft = entityfieldtype(i);
-                       new = i * '1 0 0' + ft * '0 1 0' + '0 0 1';
+                       next = i * '1 0 0' + ft * '0 1 0' + '0 0 1';
                        prev = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", fn)));
                        if(prev.y == 0)
                        {
-                               db_put(TemporaryDB, strcat("/target_spawn/field/", fn), vtos(new));
+                               db_put(TemporaryDB, strcat("/target_spawn/field/", fn), vtos(next));
                                if(fn == "target_spawn_spawnfunc")
                                        target_spawn_spawnfunc_field = i;
                        }
index ba1b4e6eedacb91412044bd0529c472ac3ffb977..7bd44fec82401c29a41533a9b50f85b224406db1 100644 (file)
@@ -1,4 +1,19 @@
 #include "teamplay.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "race.qh"
+#include "scores.qh"
+#include "scores_rules.qh"
+
+#include "bot/bot.qh"
+
+#include "command/vote.qh"
+
+#include "mutators/mutators_include.qh"
+
+#include "../common/deathtypes.qh"
+#include "../common/teams.qh"
 
 void TeamchangeFrags(entity e)
 {
index ad0b68521bb4c03f46991e3cc331e37ea7740cd5..694ff5d45c7d7ed26166c95f94238cf3c24c0f55 100644 (file)
@@ -1,3 +1,8 @@
+#include "../../_all.qh"
+
+#include "../../g_damage.qh"
+#include "../../bot/bot.qh"
+
 #define cvar_base "g_turrets_unit_"
 .float clientframe;
 void turrets_setframe(float _frame, float client_only)
index 7eb1622baf102b80fd1aba8407559613c6b10bf5..4133ae97df5043fd277ede7d07fe17c5472a9e1f 100644 (file)
@@ -1,3 +1,5 @@
+#include "../../bot/navigation.qh"
+
 const float ewheel_amin_stop = 0;
 const float ewheel_amin_fwd_slow = 1;
 const float ewheel_amin_fwd_fast = 2;
index d235dfb32787124cdaf946b6bd59ff5178549db4..21c6acfccef7d55e25928e2a8111dc0717fda136 100644 (file)
@@ -1,3 +1,5 @@
+void W_MachineGun_MuzzleFlash(void);
+
 void spawnfunc_turret_machinegun();
 void turret_machinegun_std_init();
 void turret_machinegun_attack();
index a5aafda8f84d0589c112ff0d68950801f4a7ddec..dfda7a91341741fd3021320667b0acc619b8f6ea 100644 (file)
@@ -1,3 +1,5 @@
+#include "../../_all.qh"
+
 void spawnfunc_turret_phaser();
 void turret_phaser_dinit();
 void turret_phaser_attack();
index 0f2de3c869ab1a96fe43328c54f7f4627d018248..205cd0b5311eb8c15bc82e9d149cdc3ee507283e 100644 (file)
@@ -1,3 +1,5 @@
+#include "../../g_subs.qh"
+
 void spawnfunc_turret_targettrigger();
 void turret_targettrigger_touch();
 
index 4989b2445efc99808dab32b75b29935cdd46e95a..c95de1373ab7317ba979800ce6c58e03fb38b52d 100644 (file)
@@ -1,3 +1,5 @@
+#include "../../csqceffects.qh"
+
 void spawnfunc_turret_tesla();
 void turret_tesla_dinit();
 void turret_tesla_fire();
index f76d119230514283fad3d59447ca2c3488a94b0d..812fb22456628dc8c8e3b558c8cf0d7bdfbd1c6a 100644 (file)
@@ -1,3 +1,9 @@
+#include "../../_all.qh"
+
+#include "../../movelib.qh"
+#include "../../steerlib.qh"
+#include "../../t_teleporters.qh"
+
 const float ANIM_NO         = 0;
 const float ANIM_TURN       = 1;
 const float ANIM_WALK       = 2;
diff --git a/qcsrc/server/vehicles/all.qc b/qcsrc/server/vehicles/all.qc
new file mode 100644 (file)
index 0000000..33e0c71
--- /dev/null
@@ -0,0 +1,11 @@
+#if VEHICLES_ENABLED
+#   include "vehicle.qc"
+
+#   include "racer.qc"
+#   include "raptor.qc"
+#   include "spiderbot.qc"
+
+#   ifndef VEHICLES_NO_UNSTABLE
+#       include "bumblebee.qc"
+#   endif
+#endif
diff --git a/qcsrc/server/vehicles/all.qh b/qcsrc/server/vehicles/all.qh
new file mode 100644 (file)
index 0000000..c675c9c
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef VEHICLES_H
+#define VEHICLES_H
+
+#if VEHICLES_ENABLED
+#   include "racer.qh"
+#   include "raptor.qh"
+#   include "spiderbot.qh"
+
+#   ifndef VEHICLES_NO_UNSTABLE
+#       include "bumblebee.qh"
+#   endif
+#endif
+
+#endif
index c9edecf56cbecc190c20963695f47ae6c5f56ffb..79eac74bb393c8d38c839ac1c1d0f136c1405396 100644 (file)
@@ -1,6 +1,7 @@
 #include "bumblebee.qh"
 
 #ifdef SVQC
+#include "vehicle.qh"
 void bumb_fire_cannon(entity _gun, string _tagname, entity _owner)
 {
        vector v = gettaginfo(_gun, gettagindex(_gun, _tagname));
@@ -323,6 +324,7 @@ void bumb_regen()
 
 }
 
+.vector hook_start, hook_end;
 float bumb_pilot_frame()
 {
        entity pilot, vehic;
index dce126c0e986148bc86daecd99fd4ab25ff8cb31..545e309e4fecc1720b76df3e8a13b317602e563c 100644 (file)
@@ -1,5 +1,5 @@
-const vector RACER_MIN = '-120 -120 -40';
-const vector RACER_MAX = '120 120 40';
+#include "vehicle.qh"
+#include "racer.qh"
 
 #ifdef SVQC
 void racer_exit(float eject);
@@ -448,6 +448,8 @@ float racer_frame()
     return 1;
 }
 
+.float lastpushtime;
+
 void racer_think()
 {
     self.nextthink = time;
@@ -680,4 +682,4 @@ void spawnfunc_vehicle_racer()
         return;
     }
 }
-#endif // SVQC
\ No newline at end of file
+#endif // SVQC
diff --git a/qcsrc/server/vehicles/racer.qh b/qcsrc/server/vehicles/racer.qh
new file mode 100644 (file)
index 0000000..0051b77
--- /dev/null
@@ -0,0 +1,5 @@
+#ifndef RACER_H
+#define RACER_H
+const vector RACER_MIN = '-120 -120 -40';
+const vector RACER_MAX = '120 120 40';
+#endif
index 4bd28369342b27bf629d165d7b476c203d2833bb..5c14fb7935d02f87fc9febfb287d1583f259a0f5 100644 (file)
@@ -1,10 +1,5 @@
-const float RSM_FIRST = 0;
-const float RSM_BOMB = 0;
-const float RSM_FLARE = 1;
-const float RSM_LAST = 1;
-
-const vector RAPTOR_MIN = '-80 -80 0';
-const vector RAPTOR_MAX = '80 80 70';
+#include "vehicle.qh"
+#include "raptor.qh"
 
 #ifdef SVQC
 float autocvar_g_vehicle_raptor;
diff --git a/qcsrc/server/vehicles/raptor.qh b/qcsrc/server/vehicles/raptor.qh
new file mode 100644 (file)
index 0000000..0043789
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef RAPTOR_H
+#define RAPTOR_H
+const float RSM_FIRST = 0;
+const float RSM_BOMB = 0;
+const float RSM_FLARE = 1;
+const float RSM_LAST = 1;
+
+const vector RAPTOR_MIN = '-80 -80 0';
+const vector RAPTOR_MAX = '80 80 70';
+
+#endif
index c969e225ebc3bc21a3d504dfa7c80c9f465c6700..c2a59fd18363c36d8aebb01d7ed3f920ce759016 100644 (file)
@@ -1,5 +1,5 @@
-const vector SPIDERBOT_MIN = '-75 -75 10';
-const vector SPIDERBOT_MAX  = '75 75 125';
+#include "vehicle.qh"
+#include "spiderbot.qh"
 
 #ifdef SVQC
 float autocvar_g_vehicle_spiderbot;
diff --git a/qcsrc/server/vehicles/spiderbot.qh b/qcsrc/server/vehicles/spiderbot.qh
new file mode 100644 (file)
index 0000000..ce96858
--- /dev/null
@@ -0,0 +1,5 @@
+#ifndef SPIDERBOT_H
+#define SPIDERBOT_H
+const vector SPIDERBOT_MIN = '-75 -75 10';
+const vector SPIDERBOT_MAX  = '75 75 125';
+#endif
diff --git a/qcsrc/server/vehicles/vehicle.qc b/qcsrc/server/vehicles/vehicle.qc
new file mode 100644 (file)
index 0000000..2622b52
--- /dev/null
@@ -0,0 +1,1434 @@
+#include "vehicle.qh"
+
+#include "../_all.qh"
+#include "../cl_player.qh"
+#include "../../common/constants.qh"
+#include "../waypointsprites.qh"
+
+#include "../bot/waypoints.qh"
+
+float autocvar_g_vehicles_crush_dmg;
+float autocvar_g_vehicles_crush_force;
+float autocvar_g_vehicles_delayspawn;
+float autocvar_g_vehicles_delayspawn_jitter;
+
+float autocvar_g_vehicles_vortex_damagerate = 0.5;
+float autocvar_g_vehicles_machinegun_damagerate = 0.5;
+float autocvar_g_vehicles_rifle_damagerate = 0.75;
+float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
+float autocvar_g_vehicles_tag_damagerate = 5;
+
+float autocvar_g_vehicles;
+
+void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
+void vehicles_return();
+void vehicles_enter();
+void vehicles_reset_colors();
+void vehicles_clearreturn();
+void vehicles_setreturn();
+
+
+/** AuxiliaryXhair*
+    Send additional points of interest to be drawn, to vehicle owner
+**/
+const float MAX_AXH = 4;
+.entity AuxiliaryXhairs[MAX_AXH];
+
+float SendAuxiliaryXhair(entity to, int sf)
+{
+
+       WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
+
+       WriteByte(MSG_ENTITY, self.cnt);
+
+       WriteCoord(MSG_ENTITY, self.origin.x);
+       WriteCoord(MSG_ENTITY, self.origin.y);
+       WriteCoord(MSG_ENTITY, self.origin.z);
+
+    WriteByte(MSG_ENTITY, rint(self.colormod.x * 255));
+    WriteByte(MSG_ENTITY, rint(self.colormod.y * 255));
+    WriteByte(MSG_ENTITY, rint(self.colormod.z * 255));
+
+    return true;
+}
+
+void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id)
+{
+    if (!IS_REAL_CLIENT(own))
+        return;
+
+    entity axh;
+
+    axh_id = bound(0, axh_id, MAX_AXH);
+    axh = own.(AuxiliaryXhairs[axh_id]);
+
+    if(axh == world || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+    {
+        axh                     = spawn();
+        axh.cnt                 = axh_id;
+        axh.drawonlytoclient    = own;
+        axh.owner               = own;
+        Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
+    }
+
+    setorigin(axh, loc);
+    axh.colormod            = clr;
+    axh.SendFlags           = 0x01;
+    own.(AuxiliaryXhairs[axh_id]) = axh;
+}
+
+/*
+// SVC_TEMPENTITY based, horrible with even 50 ping. hm.
+// WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
+void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
+{
+       msgexntity = own;
+
+       WriteByte(MSG_ONE, SVC_TEMPENTITY);
+       WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
+
+       WriteByte(MSG_ONE, axh_id);
+
+       WriteCoord(MSG_ONE, loc_x);
+       WriteCoord(MSG_ONE, loc_y);
+       WriteCoord(MSG_ONE, loc_z);
+
+    WriteByte(MSG_ONE, rint(clr_x * 255));
+    WriteByte(MSG_ONE, rint(clr_y * 255));
+    WriteByte(MSG_ONE, rint(clr_z * 255));
+
+}
+*/
+// End AuxiliaryXhair
+
+/**
+    Notifies the client that he enterd a vehicle, and sends
+    realavent data.
+
+    only sends vehicle_id atm (wich is a HUD_* constant, ex. HUD_SPIDERBOT)
+**/
+void CSQCVehicleSetup(entity own, float vehicle_id)
+{
+    if (!IS_REAL_CLIENT(own))
+        return;
+
+       msg_entity = own;
+
+       WriteByte(MSG_ONE, SVC_TEMPENTITY);
+       WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
+       if(vehicle_id != 0)
+           WriteByte(MSG_ONE, vehicle_id);
+       else
+        WriteByte(MSG_ONE, 1 + own.vehicle.vehicle_weapon2mode + HUD_VEHICLE_LAST);
+}
+
+
+const float    DAMAGE_TARGETDRONE = 10;
+
+vector targetdrone_getnewspot()
+{
+
+       vector spot;
+       float i;
+       for(i = 0; i < 100; ++i)
+       {
+               spot = self.origin + randomvec() * 1024;
+               tracebox(spot, self.mins, self.maxs, spot, MOVE_NORMAL, self);
+               if(trace_fraction == 1.0 && trace_startsolid == 0 && trace_allsolid == 0)
+                       return spot;
+       }
+       return self.origin;
+}
+
+#if 0
+void targetdrone_think();
+void targetdrone_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
+void targetdrone_renwe()
+{
+       self.think = targetdrone_think;
+       self.nextthink = time + 0.1;
+       setorigin(self, targetdrone_getnewspot());
+       self.health = 200;
+       self.takedamage = DAMAGE_TARGETDRONE;
+       self.event_damage = targetdrone_damage;
+       self.solid = SOLID_BBOX;
+       setmodel(self, "models/runematch/rune.mdl");
+       self.effects = EF_LOWPRECISION;
+       self.scale = 10;
+       self.movetype = MOVETYPE_BOUNCEMISSILE;
+       setsize(self, '-100 -100 -100', '100 100 100');
+
+}
+void targetdrone_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+       self.health -= damage;
+       if(self.health <= 0)
+       {
+               pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
+
+               if(!self.cnt)
+                       remove(self);
+               else
+               {
+                       self.think = targetdrone_renwe;
+                       self.nextthink = time + 1 + random() * 2;
+                       self.solid = SOLID_NOT;
+                       setmodel(self, "");
+               }
+       }
+}
+entity targetdrone_getfear()
+{
+       entity fear;
+       float i;
+
+       for(i = 64; i <= 1024; i += 64)
+       {
+               fear = findradius(self.origin, i);
+               while(fear)
+               {
+                       if(fear.bot_dodge)
+                               return fear;
+
+                       fear = fear.chain;
+               }
+       }
+
+       return world;
+}
+void targetdrone_think()
+{
+       self.nextthink = time + 0.1;
+
+       if(self.wp00)
+       if(self.wp00.deadflag != DEAD_NO)
+               self.wp00 = targetdrone_getfear();
+
+       if(!self.wp00)
+               self.wp00 = targetdrone_getfear();
+
+       vector newdir;
+
+       if(self.wp00)
+               newdir = steerlib_push(self.wp00.origin) + randomvec() * 0.75;
+       else
+               newdir = randomvec() * 0.75;
+
+       newdir = newdir * 0.5 + normalize(self.velocity) * 0.5;
+
+       if(self.wp00)
+               self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.wp00.origin - self.origin), 1024)) * 700);
+       else
+               self.velocity = normalize(newdir) * 750;
+
+       tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 2, MOVE_NORMAL, self);
+       if(trace_fraction != 1.0)
+               self.velocity = self.velocity * -1;
+
+       //normalize((normalize(self.velocity) * 0.5 + newdir * 0.5)) * 750;
+}
+
+void targetdrone_spawn(vector _where, float _autorenew)
+{
+       entity drone = spawn();
+       setorigin(drone, _where);
+       drone.think = targetdrone_renwe;
+       drone.nextthink = time + 0.1;
+       drone.cnt = _autorenew;
+}
+#endif
+
+void vehicles_locktarget(float incr, float decr, float _lock_time)
+{
+    if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
+    {
+        self.lock_target    = world;
+        self.lock_strength  = 0;
+        self.lock_time      = 0;
+    }
+
+    if(self.lock_time > time)
+    {
+        if(self.lock_target)
+        if(self.lock_soundtime < time)
+        {
+            self.lock_soundtime = time + 0.5;
+            play2(self.owner, "vehicles/locked.wav");
+        }
+
+        return;
+    }
+
+    if(trace_ent != world)
+    {
+        if(teamplay && trace_ent.team == self.team)
+            trace_ent = world;
+
+        if(trace_ent.deadflag != DEAD_NO)
+            trace_ent = world;
+        if(!(
+            (trace_ent.vehicle_flags & VHF_ISVEHICLE) || 
+            (trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || 
+            (trace_ent.takedamage == DAMAGE_TARGETDRONE)
+            )) { trace_ent = world; }
+    }
+
+    if(self.lock_target == world && trace_ent != world)
+        self.lock_target = trace_ent;
+
+    if(self.lock_target && trace_ent == self.lock_target)
+    {
+        if(self.lock_strength != 1 && self.lock_strength + incr >= 1)
+        {
+            play2(self.owner, "vehicles/lock.wav");
+            self.lock_soundtime = time + 0.8;
+        }
+        else if (self.lock_strength != 1 && self.lock_soundtime < time)
+        {
+            play2(self.owner, "vehicles/locking.wav");
+            self.lock_soundtime = time + 0.3;
+        }
+
+    }
+
+    // Have a locking target
+    // Trace hit current target
+    if(trace_ent == self.lock_target && trace_ent != world)
+    {
+        self.lock_strength = min(self.lock_strength + incr, 1);
+        if(self.lock_strength == 1)
+            self.lock_time = time + _lock_time;
+    }
+    else
+    {
+        if(trace_ent)
+            self.lock_strength = max(self.lock_strength - decr * 2, 0);
+        else
+            self.lock_strength = max(self.lock_strength - decr, 0);
+
+        if(self.lock_strength == 0)
+            self.lock_target = world;
+    }
+}
+
+
+#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
+traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
+if(trace_fraction != 1) \
+    acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
+
+// Hover movement support
+float  force_fromtag_power;
+vector force_fromtag_origin;
+vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power)
+{
+    force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
+    v_forward  = normalize(v_forward) * -1;
+    traceline(force_fromtag_origin, force_fromtag_origin - (v_forward  * spring_length), MOVE_NORMAL, self);
+
+    force_fromtag_power = (1 - trace_fraction) * max_power;
+    force_fromtag_normpower = force_fromtag_power / max_power;
+
+    return v_forward  * force_fromtag_power;
+}
+
+// Experimental hovermode wich uses attraction/repulstion from surface insted of gravity/repulsion
+// Can possibly be use to move abt any surface (inclusing walls/celings)
+vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
+{
+
+    force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
+    v_forward  = normalize(v_forward) * -1;
+    traceline(force_fromtag_origin, force_fromtag_origin - (v_forward  * spring_length), MOVE_NORMAL, self);
+
+    // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
+    if(trace_fraction == 1.0)
+    {
+        force_fromtag_normpower = -0.25;
+        return '0 0 -200';
+    }
+
+    force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
+    force_fromtag_normpower = force_fromtag_power / max_power;
+
+    return v_forward  * force_fromtag_power;
+}
+
+// Generic vehile projectile system
+void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+    // Ignore damage from oterh projectiles from my owner (dont mess up volly's)
+    if(inflictor.owner == self.owner)
+        return;
+
+    self.health -= damage;
+    self.velocity += force;
+    if(self.health < 1)
+    {
+        self.takedamage = DAMAGE_NO;
+        self.event_damage = func_null;
+        self.think = self.use;
+        self.nextthink = time;
+    }
+}
+
+void vehicles_projectile_explode()
+{
+    if(self.owner && other != world)
+    {
+        if(other == self.owner.vehicle)
+            return;
+
+        if(other == self.owner.vehicle.tur_head)
+            return;
+    }
+
+       PROJECTILE_TOUCH;
+
+       self.event_damage = func_null;
+    RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other);
+
+    remove (self);
+}
+
+entity vehicles_projectile(string _mzlfx, string _mzlsound,
+                           vector _org, vector _vel,
+                           float _dmg, float _radi, float _force,  float _size,
+                           float _deahtype, float _projtype, float _health,
+                           float _cull, float _clianim, entity _owner)
+{
+    entity proj;
+
+    proj = spawn();
+
+    PROJECTILE_MAKETRIGGER(proj);
+    setorigin(proj, _org);
+
+    proj.shot_dmg         = _dmg;
+    proj.shot_radius      = _radi;
+    proj.shot_force       = _force;
+    proj.totalfrags       = _deahtype;
+    proj.solid            = SOLID_BBOX;
+    proj.movetype         = MOVETYPE_FLYMISSILE;
+    proj.flags            = FL_PROJECTILE;
+    proj.bot_dodge        = true;
+    proj.bot_dodgerating  = _dmg;
+    proj.velocity         = _vel;
+    proj.touch            = vehicles_projectile_explode;
+    proj.use              = vehicles_projectile_explode;
+    proj.owner            = self;
+    proj.realowner        = _owner;
+    proj.think            = SUB_Remove;
+    proj.nextthink        = time + 30;
+
+    if(_health)
+    {
+        proj.takedamage       = DAMAGE_AIM;
+        proj.event_damage     = vehicles_projectile_damage;
+        proj.health           = _health;
+    }
+    else
+        proj.flags           = FL_PROJECTILE | FL_NOTARGET;
+
+    if(_mzlsound)
+        sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
+
+    if(_mzlfx)
+        pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
+
+
+    setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
+
+    CSQCProjectile(proj, _clianim, _projtype, _cull);
+
+    return proj;
+}
+// End generic vehile projectile system
+
+void vehicles_reset()
+{
+       if(self.owner)
+       {
+               entity oldself = self;
+               self = self.owner;
+               vehicles_exit(VHEF_RELESE);
+               self = oldself;
+       }
+       self.alpha      = -1;
+       self.movetype   = MOVETYPE_NONE;
+       self.effects    = EF_NODRAW;
+       self.colormod  = '0 0 0';
+       self.avelocity = '0 0 0';
+       self.velocity  = '0 0 0';
+       self.event_damage = func_null;
+       self.solid = SOLID_NOT;
+       self.deadflag = DEAD_NO;
+
+       self.touch = func_null;
+       self.nextthink = 0;
+       vehicles_setreturn();
+}
+
+/** vehicles_spawn
+    Exetuted for all vehicles on (re)spawn.
+    Sets defaults for newly spawned units.
+**/
+void vehicles_spawn()
+{
+    dprint("Spawning vehicle: ", self.netname, "\n");
+
+    // De-own & reset
+    self.vehicle_hudmodel.viewmodelforclient = self;
+
+    self.owner              = world;
+    self.touch              = vehicles_touch;
+    self.event_damage       = vehicles_damage;
+    self.reset              = vehicles_reset;
+    self.iscreature         = true;
+    self.teleportable       = false; // no teleporting for vehicles, too buggy
+    self.damagedbycontents     = true;
+    self.movetype           = MOVETYPE_WALK;
+    self.solid              = SOLID_SLIDEBOX;
+    self.takedamage         = DAMAGE_AIM;
+       self.deadflag           = DEAD_NO;
+    self.bot_attack         = true;
+    self.flags              = FL_NOTARGET;
+    self.avelocity          = '0 0 0';
+    self.velocity           = '0 0 0';
+
+    // Reset locking
+    self.lock_strength      = 0;
+    self.lock_target        = world;
+    self.misc_bulletcounter = 0;
+
+    // Return to spawn
+    self.angles             = self.pos2;
+    setorigin(self, self.pos1 + '0 0 0');
+    // Show it
+    pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+
+    if(self.vehicle_controller)
+        self.team = self.vehicle_controller.team;
+
+    vehicles_reset_colors();
+    self.vehicle_spawn(VHSF_NORMAL);
+}
+
+// Better way of determening whats crushable needed! (fl_crushable?)
+float vehicles_crushable(entity e)
+{
+    if(IS_PLAYER(e))
+        return true;
+
+    if(e.flags & FL_MONSTER)
+        return true;
+
+    return false;
+}
+
+void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
+{
+    if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
+        return;
+
+    if(self.play_time < time)
+    {
+        float wc = vlen(self.velocity - self.oldvelocity);
+        //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
+        //dprint("vel: ", vtos(self.velocity), "\n");
+        if(_minspeed < wc)
+        {
+            float take = min(_speedfac * wc, _maxpain);
+            Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+            self.play_time = time + 0.25;
+
+            //dprint("wc: ", ftos(wc), "\n");
+            //dprint("take: ", ftos(take), "\n");
+        }
+    }
+}
+
+void vehicles_touch()
+{
+       if(MUTATOR_CALLHOOK(VehicleTouch))
+               return;
+
+    // Vehicle currently in use
+    if(self.owner)
+    {
+        if(other != world)
+        if(vehicles_crushable(other))
+        {
+            if(vlen(self.velocity) != 0)
+                Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+
+            return; // Dont do selfdamage when hitting "soft targets".
+        }
+
+        if(self.play_time < time)
+        if(self.vehicle_impact)
+            self.vehicle_impact();
+
+        return;
+    }
+
+    if (!IS_PLAYER(other))
+        return;
+
+    if(other.deadflag != DEAD_NO)
+        return;
+
+    if(other.vehicle != world)
+        return;
+
+    vehicles_enter();
+}
+.float monster_attack;
+void vehicles_enter()
+{
+   // Remove this when bots know how to use vehicles
+
+    if (IS_BOT_CLIENT(other))
+        if (autocvar_g_vehicles_allow_bots)
+            dprint("Bot enters vehicle\n"); // This is where we need to disconnect (some, all?) normal bot AI and hand over to vehicle's _aiframe()
+        else
+            return;
+
+    if(self.phase > time)
+        return;
+    if(other.frozen)
+        return;
+    if(other.vehicle)
+        return;
+    if(other.deadflag != DEAD_NO)
+        return;
+
+    if(teamplay)
+    if(self.team)
+    if(self.team != other.team)
+        return;
+
+    RemoveGrapplingHook(other);
+
+    self.vehicle_ammo1   = 0;
+    self.vehicle_ammo2   = 0;
+    self.vehicle_reload1 = 0;
+    self.vehicle_reload2 = 0;
+    self.vehicle_energy  = 0;
+
+    self.owner          = other;
+    self.switchweapon   = other.switchweapon;
+
+    // .viewmodelforclient works better.
+    //self.vehicle_hudmodel.drawonlytoclient = self.owner;
+
+    self.vehicle_hudmodel.viewmodelforclient = self.owner;
+
+    self.event_damage         = vehicles_damage;
+    self.nextthink            = 0;
+    self.owner.angles         = self.angles;
+    self.owner.takedamage     = DAMAGE_NO;
+    self.owner.solid          = SOLID_NOT;
+    self.owner.movetype       = MOVETYPE_NOCLIP;
+    self.owner.alpha          = -1;
+    self.owner.vehicle        = self;
+    self.owner.event_damage   = func_null;
+    self.owner.view_ofs       = '0 0 0';
+    self.colormap             = self.owner.colormap;
+    if(self.tur_head)
+        self.tur_head.colormap    = self.owner.colormap;
+
+    self.owner.hud            = self.hud;
+    self.owner.PlayerPhysplug = self.PlayerPhysplug;
+
+    self.owner.vehicle_ammo1    = self.vehicle_ammo1;
+    self.owner.vehicle_ammo2    = self.vehicle_ammo2;
+    self.owner.vehicle_reload1  = self.vehicle_reload1;
+    self.owner.vehicle_reload2  = self.vehicle_reload2;
+
+    // Cant do this, hides attached objects too.
+    //self.exteriormodeltoclient = self.owner;
+    //self.tur_head.exteriormodeltoclient = self.owner;
+
+    other.flags &= ~FL_ONGROUND;
+    self.flags  &= ~FL_ONGROUND;
+
+    self.team                 = self.owner.team;
+    self.flags               -= FL_NOTARGET;
+    self.monster_attack       = true;
+
+    if (IS_REAL_CLIENT(other))
+    {
+        msg_entity = other;
+        WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+        WriteEntity(MSG_ONE, self.vehicle_viewport);
+
+        WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+        if(self.tur_head)
+        {
+            WriteAngle(MSG_ONE, self.tur_head.angles.x + self.angles.x); // tilt
+            WriteAngle(MSG_ONE, self.tur_head.angles.y + self.angles.y); // yaw
+            WriteAngle(MSG_ONE, 0);                                      // roll
+        }
+        else
+        {
+            WriteAngle(MSG_ONE,  self.angles.x * -1); // tilt
+            WriteAngle(MSG_ONE,  self.angles.y);      // yaw
+            WriteAngle(MSG_ONE,  0);                  // roll
+        }
+    }
+
+    vehicles_clearreturn();
+
+    CSQCVehicleSetup(self.owner, self.hud);
+
+    vh_player = other;
+    vh_vehicle = self;
+    MUTATOR_CALLHOOK(VehicleEnter);
+    other = vh_player;
+    self = vh_vehicle;
+
+    self.vehicle_enter();
+    antilag_clear(other);
+}
+
+/** vehicles_findgoodexit
+    Locates a valid location for the player to exit the vehicle.
+    Will first try prefer_spot, then up 100 random spots arround the vehicle
+    wich are in direct line of sight and empty enougth to hold a players bbox
+**/
+vector vehicles_findgoodexit(vector prefer_spot)
+{
+    //vector exitspot;
+    float mysize;
+
+    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
+    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+        return prefer_spot;
+
+    mysize = 1.5 * vlen(self.maxs - self.mins);
+    float i;
+    vector v, v2;
+    v2 = 0.5 * (self.absmin + self.absmax);
+    for(i = 0; i < 100; ++i)
+    {
+        v = randomvec();
+        v.z = 0;
+        v = v2 + normalize(v) * mysize;
+        tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
+        if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+            return v;
+    }
+
+    /*
+    exitspot = (self.origin + '0 0 48') + v_forward * mysize;
+    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+        return exitspot;
+
+    exitspot = (self.origin + '0 0 48') - v_forward * mysize;
+    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+        return exitspot;
+
+    exitspot = (self.origin + '0 0 48') + v_right * mysize;
+    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+        return exitspot;
+
+    exitspot = (self.origin + '0 0 48') - v_right * mysize;
+    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+        return exitspot;
+    */
+
+    return self.origin;
+}
+
+/** vehicles_exit
+    Standarrd vehicle release fucntion.
+    custom code goes in self.vehicle_exit
+**/
+float vehicles_exit_running;
+void vehicles_exit(float eject)
+{
+    entity _vehicle;
+    entity _player;
+    entity _oldself = self;
+
+    if(vehicles_exit_running)
+    {
+        dprint("^1vehicles_exit allready running! this is not good..\n");
+        return;
+    }
+
+    vehicles_exit_running = true;
+    if(IS_CLIENT(self))
+    {
+        _vehicle = self.vehicle;
+
+        if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
+        {
+            _vehicle.vehicle_exit(eject);
+            self = _oldself;
+            vehicles_exit_running = false;
+            return;
+        }
+    }
+    else
+        _vehicle = self;
+
+    _player = _vehicle.owner;
+
+    self = _vehicle;
+
+    if (_player)
+    {
+        if (IS_REAL_CLIENT(_player))
+        {
+            msg_entity = _player;
+            WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+            WriteEntity( MSG_ONE, _player);
+
+            WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+            WriteAngle(MSG_ONE, 0);
+            WriteAngle(MSG_ONE, _vehicle.angles.y);
+            WriteAngle(MSG_ONE, 0);
+        }
+
+        setsize(_player, PL_MIN,PL_MAX);
+
+        _player.takedamage     = DAMAGE_AIM;
+        _player.solid          = SOLID_SLIDEBOX;
+        _player.movetype       = MOVETYPE_WALK;
+        _player.effects        &= ~EF_NODRAW;
+        _player.alpha          = 1;
+        _player.PlayerPhysplug = func_null;
+        _player.vehicle        = world;
+        _player.view_ofs       = PL_VIEW_OFS;
+        _player.event_damage   = PlayerDamage;
+        _player.hud            = HUD_NORMAL;
+        _player.switchweapon   = _vehicle.switchweapon;
+
+        CSQCVehicleSetup(_player, HUD_NORMAL);
+    }
+    _vehicle.flags |= FL_NOTARGET;
+
+    if(_vehicle.deadflag == DEAD_NO)
+        _vehicle.avelocity          = '0 0 0';
+
+    _vehicle.tur_head.nodrawtoclient             = world;
+
+    if(!teamplay)
+        _vehicle.team = 0;
+
+    vh_player = _player;
+    vh_vehicle = _vehicle;
+    MUTATOR_CALLHOOK(VehicleExit);
+    _player = vh_player;
+    _vehicle = vh_vehicle;
+
+    _vehicle.team = _vehicle.tur_head.team;
+
+    sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
+    _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
+    _vehicle.phase = time + 1;
+    _vehicle.monster_attack = false;
+
+    _vehicle.vehicle_exit(eject);
+
+    vehicles_setreturn();
+    vehicles_reset_colors();
+    _vehicle.owner = world;
+    self = _oldself;
+
+    vehicles_exit_running = false;
+}
+
+
+void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
+{
+    if (self.(regen_field) < field_max)
+    if (timer + rpause < time)
+    {
+        if (_healthscale)
+            regen = regen * (self.vehicle_health / self.tur_health);
+
+        self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max);
+
+        if (self.owner)
+            self.owner.(regen_field) = (self.(regen_field) / field_max) * 100;
+    }
+}
+
+void shieldhit_think()
+{
+    self.alpha -= 0.1;
+    if (self.alpha <= 0)
+    {
+        //setmodel(self, "");
+        self.alpha = -1;
+        self.effects |= EF_NODRAW;
+    }
+    else
+    {
+        self.nextthink = time + 0.1;
+    }
+}
+
+void vehicles_painframe()
+{
+    if(self.owner.vehicle_health <= 50)
+    if(self.pain_frame < time)
+    {
+        float _ftmp;
+        _ftmp = self.owner.vehicle_health / 50;
+        self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
+        pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+
+        if(self.vehicle_flags & VHF_DMGSHAKE)
+            self.velocity += randomvec() * 30;
+
+        if(self.vehicle_flags & VHF_DMGROLL)
+            if(self.vehicle_flags & VHF_DMGHEADROLL)
+                self.tur_head.angles += randomvec();
+            else
+                self.angles += randomvec();
+
+    }
+}
+
+void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+    self.dmg_time = time;
+
+       // WEAPONTODO
+    if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
+        damage *= autocvar_g_vehicles_vortex_damagerate;
+
+    if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
+        damage *= autocvar_g_vehicles_machinegun_damagerate;
+
+    if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
+        damage *= autocvar_g_vehicles_rifle_damagerate;
+
+    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+        damage *= autocvar_g_vehicles_vaporizer_damagerate;
+
+    if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
+        damage *= autocvar_g_vehicles_tag_damagerate;
+
+    self.enemy = attacker;
+
+    if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
+    {
+        if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
+        {
+            self.vehicle_shieldent = spawn();
+            self.vehicle_shieldent.effects = EF_LOWPRECISION;
+
+            setmodel(self.vehicle_shieldent, "models/vhshield.md3");
+            setattachment(self.vehicle_shieldent, self, "");
+            setorigin(self.vehicle_shieldent, real_origin(self) - self.origin);
+            self.vehicle_shieldent.scale       = 256 / vlen(self.maxs - self.mins);
+            self.vehicle_shieldent.think       = shieldhit_think;
+        }
+
+        self.vehicle_shieldent.colormod    = '1 1 1';
+        self.vehicle_shieldent.alpha       = 0.45;
+        self.vehicle_shieldent.angles      = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
+        self.vehicle_shieldent.nextthink   = time;
+        self.vehicle_shieldent.effects &= ~EF_NODRAW;
+
+        self.vehicle_shield -= damage;
+
+        if(self.vehicle_shield < 0)
+        {
+            self.vehicle_health            -= fabs(self.vehicle_shield);
+            self.vehicle_shieldent.colormod = '2 0 0';
+            self.vehicle_shield             = 0;
+            self.vehicle_shieldent.alpha    = 0.75;
+
+               if(sound_allowed(MSG_BROADCAST, attacker))
+                spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);   // FIXME: PLACEHOLDER
+        }
+        else
+               if(sound_allowed(MSG_BROADCAST, attacker))
+                spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
+
+    }
+    else
+    {
+        self.vehicle_health -= damage;
+
+        if(sound_allowed(MSG_BROADCAST, attacker))
+            spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
+    }
+
+       if(self.damageforcescale < 1 && self.damageforcescale > 0)
+               self.velocity += force * self.damageforcescale;
+       else
+               self.velocity += force;
+
+    if(self.vehicle_health <= 0)
+    {
+        if(self.owner)
+            if(self.vehicle_flags & VHF_DEATHEJECT)
+                vehicles_exit(VHEF_EJECT);
+            else
+                vehicles_exit(VHEF_RELESE);
+
+
+        antilag_clear(self);
+
+        self.vehicle_die();
+        vehicles_setreturn();
+    }
+}
+
+void vehicles_clearreturn()
+{
+    entity ret;
+    // Remove "return helper", if any.
+    ret = findchain(classname, "vehicle_return");
+    while(ret)
+    {
+        if(ret.wp00 == self)
+        {
+            ret.classname   = "";
+            ret.think       = SUB_Remove;
+            ret.nextthink   = time + 0.1;
+
+            if(ret.waypointsprite_attached)
+                WaypointSprite_Kill(ret.waypointsprite_attached);
+
+            return;
+        }
+        ret = ret.chain;
+    }
+}
+
+void vehicles_return()
+{
+    pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
+
+    self.wp00.think     = vehicles_spawn;
+    self.wp00.nextthink = time;
+
+    if(self.waypointsprite_attached)
+        WaypointSprite_Kill(self.waypointsprite_attached);
+
+    remove(self);
+}
+
+void vehicles_showwp_goaway()
+{
+    if(self.waypointsprite_attached)
+        WaypointSprite_Kill(self.waypointsprite_attached);
+
+    remove(self);
+
+}
+
+void vehicles_showwp()
+{
+    entity oldself = world;
+    vector rgb;
+
+    if(self.cnt)
+    {
+        self.think      = vehicles_return;
+        self.nextthink  = self.cnt;
+    }
+    else
+    {
+        self.think      = vehicles_return;
+        self.nextthink  = time +1;
+
+        oldself = self;
+        self = spawn();
+        setmodel(self, "null");
+        self.team = oldself.wp00.team;
+        self.wp00 = oldself.wp00;
+        setorigin(self, oldself.wp00.pos1);
+
+        self.nextthink = time + 5;
+        self.think = vehicles_showwp_goaway;
+    }
+
+    if(teamplay && self.team)
+           rgb = Team_ColorRGB(self.team);
+    else
+           rgb = '1 1 1';
+    WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
+    if(self.waypointsprite_attached)
+    {
+        WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
+        if(oldself == world)
+            WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
+        WaypointSprite_Ping(self.waypointsprite_attached);
+    }
+
+    if(oldself != world)
+        self = oldself;
+}
+
+void vehicles_setreturn()
+{
+    entity ret;
+
+    vehicles_clearreturn();
+
+    ret = spawn();
+    ret.classname   = "vehicle_return";
+    ret.wp00       = self;
+    ret.team        = self.team;
+    ret.think       = vehicles_showwp;
+
+       if(self.deadflag != DEAD_NO)
+       {
+               ret.cnt = max(game_starttime, time) + self.vehicle_respawntime;
+               ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 5);
+       }
+       else
+               ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 1);
+
+    setmodel(ret, "null");
+    setorigin(ret, self.pos1 + '0 0 96');
+}
+
+void vehicles_reset_colors()
+{
+    entity e;
+    float _effects = 0, _colormap;
+    vector _glowmod, _colormod;
+
+    if(autocvar_g_nodepthtestplayers)
+        _effects |= EF_NODEPTHTEST;
+
+    if(autocvar_g_fullbrightplayers)
+        _effects |= EF_FULLBRIGHT;
+
+    if(self.team)
+        _colormap = 1024 + (self.team - 1) * 17;
+    else
+        _colormap = 1024;
+
+    _glowmod  = '0 0 0';
+    _colormod = '0 0 0';
+
+    // Find all ents attacked to main model and setup effects, colormod etc.
+    e = findchainentity(tag_entity, self);
+    while(e)
+    {
+        if(e != self.vehicle_shieldent)
+        {
+            e.effects   = _effects; //  | EF_LOWPRECISION;
+            e.colormod  = _colormod;
+            e.colormap  = _colormap;
+            e.alpha     = 1;
+        }
+        e = e.chain;
+    }
+
+    self.vehicle_hudmodel.effects  = self.effects  = _effects; // | EF_LOWPRECISION;
+    self.vehicle_hudmodel.colormod = self.colormod = _colormod;
+    self.vehicle_hudmodel.colormap = self.colormap = _colormap;
+    self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
+
+    self.alpha     = 1;
+    self.avelocity = '0 0 0';
+    self.velocity  = '0 0 0';
+    self.effects   = _effects;
+}
+
+void vehicle_use()
+{
+    dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
+
+    self.tur_head.team = activator.team;
+
+    if(self.tur_head.team == 0)
+        self.active = ACTIVE_NOT;
+    else
+        self.active = ACTIVE_ACTIVE;
+
+    if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO)
+    {
+        dprint("^3Eat shit yall!\n");
+        vehicles_setreturn();
+        vehicles_reset_colors();
+    }
+    else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO)
+    {
+
+    }
+}
+
+float vehicle_addplayerslot(    entity _owner,
+                                entity _slot,
+                                float _hud,
+                                string _hud_model,
+                                float() _framefunc,
+                                void(float) _exitfunc)
+{
+    if (!(_owner.vehicle_flags & VHF_MULTISLOT))
+        _owner.vehicle_flags |= VHF_MULTISLOT;
+
+    _slot.PlayerPhysplug = _framefunc;
+    _slot.vehicle_exit = _exitfunc;
+    _slot.hud = _hud;
+    _slot.vehicle_flags = VHF_PLAYERSLOT;
+    _slot.vehicle_viewport = spawn();
+    _slot.vehicle_hudmodel = spawn();
+    _slot.vehicle_hudmodel.viewmodelforclient = _slot;
+    _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
+
+    setmodel(_slot.vehicle_hudmodel, _hud_model);
+    setmodel(_slot.vehicle_viewport, "null");
+
+    setattachment(_slot.vehicle_hudmodel, _slot, "");
+    setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
+
+    return true;
+}
+
+float vehicle_initialize(string  net_name,
+                         string  bodymodel,
+                         string  topmodel,
+                         string  hudmodel,
+                         string  toptag,
+                         string  hudtag,
+                         string  viewtag,
+                         float   vhud,
+                         vector  min_s,
+                         vector  max_s,
+                         float   nodrop,
+                         void(float _spawnflag)  spawnproc,
+                         float   _respawntime,
+                         float() physproc,
+                         void()  enterproc,
+                         void(float extflag) exitfunc,
+                         void() dieproc,
+                         void() thinkproc,
+                         float  use_csqc,
+                         float _max_health,
+                         float _max_shield)
+{
+       if(!autocvar_g_vehicles)
+               return false;
+
+    if(self.targetname)
+    {
+        self.vehicle_controller = find(world, target, self.targetname);
+        if(!self.vehicle_controller)
+        {
+            bprint("^1WARNING: ^7Vehicle with invalid .targetname\n");
+        }
+        else
+        {
+            self.team = self.vehicle_controller.team;
+            self.use = vehicle_use;
+
+            if(teamplay)
+            {
+                if(self.vehicle_controller.team == 0)
+                    self.active = ACTIVE_NOT;
+                else
+                    self.active = ACTIVE_ACTIVE;
+            }
+        }
+    }
+
+    precache_sound("onslaught/ons_hit2.wav");
+    precache_sound("onslaught/electricity_explode.wav");
+
+
+    addstat(STAT_HUD, AS_INT,  hud);
+       addstat(STAT_VEHICLESTAT_HEALTH,  AS_INT, vehicle_health);
+       addstat(STAT_VEHICLESTAT_SHIELD,  AS_INT, vehicle_shield);
+       addstat(STAT_VEHICLESTAT_ENERGY,  AS_INT, vehicle_energy);
+
+       addstat(STAT_VEHICLESTAT_AMMO1,   AS_INT, vehicle_ammo1);
+       addstat(STAT_VEHICLESTAT_RELOAD1, AS_INT, vehicle_reload1);
+
+       addstat(STAT_VEHICLESTAT_AMMO2,   AS_INT, vehicle_ammo2);
+       addstat(STAT_VEHICLESTAT_RELOAD2, AS_INT, vehicle_reload2);
+
+    if(bodymodel == "")
+        error("vehicles: missing bodymodel!");
+
+    if(hudmodel == "")
+        error("vehicles: missing hudmodel!");
+
+    if(net_name == "")
+        self.netname = self.classname;
+    else
+        self.netname = net_name;
+
+    if(self.team && !teamplay)
+        self.team = 0;
+
+    self.vehicle_flags |= VHF_ISVEHICLE;
+
+    setmodel(self, bodymodel);
+
+    self.vehicle_viewport   = spawn();
+    self.vehicle_hudmodel   = spawn();
+    self.tur_head           = spawn();
+    self.tur_head.owner     = self;
+    self.takedamage         = DAMAGE_AIM;
+    self.bot_attack         = true;
+    self.iscreature         = true;
+    self.teleportable       = false; // no teleporting for vehicles, too buggy
+    self.damagedbycontents     = true;
+    self.hud                = vhud;
+    self.tur_health          = _max_health;
+    self.tur_head.tur_health = _max_shield;
+    self.vehicle_die         = dieproc;
+    self.vehicle_exit        = exitfunc;
+    self.vehicle_enter       = enterproc;
+    self.PlayerPhysplug      = physproc;
+    self.event_damage        = func_null;
+    self.touch               = vehicles_touch;
+    self.think               = vehicles_spawn;
+    self.vehicle_spawn       = spawnproc;
+       self.vehicle_respawntime = max(0, _respawntime);
+    self.effects             = EF_NODRAW;
+       self.dphitcontentsmask   = DPCONTENTS_BODY | DPCONTENTS_SOLID;
+       if(!autocvar_g_vehicles_delayspawn || !self.vehicle_respawntime)
+               self.nextthink = time;
+       else
+               self.nextthink = max(time, game_starttime) + max(0, self.vehicle_respawntime + ((random() * 2 - 1) * autocvar_g_vehicles_delayspawn_jitter));
+
+       if(autocvar_g_playerclip_collisions)
+               self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
+
+    if(autocvar_g_nodepthtestplayers)
+        self.effects = self.effects | EF_NODEPTHTEST;
+
+    if(autocvar_g_fullbrightplayers)
+        self.effects = self.effects | EF_FULLBRIGHT;
+
+    setmodel(self.vehicle_hudmodel, hudmodel);
+    setmodel(self.vehicle_viewport, "null");
+
+    if(topmodel != "")
+    {
+        setmodel(self.tur_head, topmodel);
+        setattachment(self.tur_head, self, toptag);
+        setattachment(self.vehicle_hudmodel, self.tur_head, hudtag);
+        setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
+    }
+    else
+    {
+        setattachment(self.tur_head, self, "");
+        setattachment(self.vehicle_hudmodel, self, hudtag);
+        setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
+    }
+
+    setsize(self, min_s, max_s);
+    if (!nodrop)
+    {
+        setorigin(self, self.origin);
+        tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
+        setorigin(self, trace_endpos);
+    }
+
+    self.pos1 = self.origin;
+    self.pos2 = self.angles;
+    self.tur_head.team = self.team;
+
+       if(MUTATOR_CALLHOOK(VehicleSpawn))
+               return false;
+
+    return true;
+}
+
+vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
+                         float _pichlimit_min, float _pichlimit_max,
+                         float _rotlimit_min, float _rotlimit_max, float _aimspeed)
+{
+    vector vtmp, vtag;
+    float ftmp;
+    vtag = gettaginfo(_turrret, gettagindex(_turrret, _tagname));
+    vtmp = vectoangles(normalize(_target - vtag));
+    vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles;
+    vtmp = AnglesTransform_Normalize(vtmp, true);
+    ftmp = _aimspeed * frametime;
+    vtmp.y = bound(-ftmp, vtmp.y, ftmp);
+    vtmp.x = bound(-ftmp, vtmp.x, ftmp);
+    _turrret.angles_y = bound(_rotlimit_min, _turrret.angles.y + vtmp.y, _rotlimit_max);
+    _turrret.angles_x = bound(_pichlimit_min, _turrret.angles.x + vtmp.x, _pichlimit_max);
+    return vtag;
+}
+
+void vehicles_gib_explode()
+{
+       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+       pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+       remove(self);
+}
+
+void vehicles_gib_think()
+{
+       self.alpha -= 0.1;
+       if(self.cnt >= time)
+               remove(self);
+       else
+               self.nextthink = time + 0.1;
+}
+
+entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot)
+{
+       entity _gib = spawn();
+       setmodel(_gib, _template.model);
+       setorigin(_gib, gettaginfo(self, gettagindex(self, _tag)));
+       _gib.velocity = _vel;
+       _gib.movetype = MOVETYPE_TOSS;
+       _gib.solid = SOLID_CORPSE;
+       _gib.colormod = '-0.5 -0.5 -0.5';
+       _gib.effects = EF_LOWPRECISION;
+       _gib.avelocity = _rot;
+
+       if(_burn)
+               _gib.effects |= EF_FLAME;
+
+       if(_explode)
+       {
+               _gib.think = vehicles_gib_explode;
+               _gib.nextthink = time + random() * _explode;
+               _gib.touch = vehicles_gib_explode;
+       }
+       else
+       {
+               _gib.cnt = time + _maxtime;
+               _gib.think = vehicles_gib_think;
+               _gib.nextthink = time + _maxtime - 1;
+               _gib.alpha = 1;
+       }
+       return _gib;
+}
+
+/*
+vector predict_target(entity _targ, vector _from, float _shot_speed)
+{
+    float i;                // loop
+    float _distance;        // How far to target
+    float _impact_time;     // How long untill projectile impacts
+    vector _predict_pos;    // Predicted enemy location
+    vector _original_origin;// Where target is before predicted
+
+     _original_origin = real_origin(_targ); // Typicaly center of target BBOX
+
+    _predict_pos = _original_origin;
+    for(i = 0; i < 4; ++i)  // Loop a few times to increase prediction accuracy (increase loop count if accuracy is to low)
+    {
+        _distance = vlen(_predict_pos - _from); // Get distance to previos predicted location
+        _impact_time = _distance / _shot_speed; // Calculate impact time
+        _predict_pos = _original_origin + _targ.velocity * _impact_time; // Calculate new predicted location
+    }
+
+    return _predict_pos;
+}
+*/
diff --git a/qcsrc/server/vehicles/vehicle.qh b/qcsrc/server/vehicles/vehicle.qh
new file mode 100644 (file)
index 0000000..696ea1a
--- /dev/null
@@ -0,0 +1,197 @@
+#ifndef VEHICLE_H
+#define VEHICLE_H
+
+#include "../_all.qh"
+
+#include "../antilag.qh"
+#include "../cl_player.qh"
+#include "../g_damage.qh"
+#include "../g_hook.qh"
+#include "../g_subs.qh"
+#include "../movelib.qh"
+
+#include "../bot/bot.qh"
+
+#include "../command/common.qh"
+
+#include "../tturrets/include/turrets_early.qh"
+
+#include "../weapons/tracing.qh"
+
+#include "../../common/deathtypes.qh"
+#include "../../common/stats.qh"
+
+#include "../../warpzonelib/anglestransform.qh"
+#include "../../warpzonelib/server.qh"
+
+entity vehicles_projectile(string _mzlfx, string _mzlsound,
+                           vector _org, vector _vel,
+                           float _dmg, float _radi, float _force,  float _size,
+                           float _deahtype, float _projtype, float _health,
+                           float _cull, float _clianim, entity _owner);
+
+vector vehicles_findgoodexit(vector prefer_spot);
+
+
+
+/** vehicles_locktarget
+
+    Generic target locking.
+
+    Figure out if what target is "locked" (if any), for missile tracking as such.
+
+    after calling, "if(self.lock_target != world && self.lock_strength == 1)" mean
+    you have a locked in target.
+
+    Exspects a crosshair_trace() or equivalent to be
+    dont before calling.
+
+**/
+.entity lock_target;
+.float  lock_strength;
+.float  lock_time;
+.float  lock_soundtime;
+
+void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id);
+
+vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
+                         float _pichlimit_min, float _pichlimit_max,
+                         float _rotlimit_min, float _rotlimit_max, float _aimspeed);
+
+#define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
+ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
+
+void CSQCVehicleSetup(entity own, float vehicle_id);
+
+.float() PlayerPhysplug;
+
+float autocvar_g_vehicles_allow_bots = 0;
+
+void vehicles_touch();
+
+void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale);
+
+float shortangle_f(float ang1, float ang2);
+float anglemods(float v);
+
+entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot);
+
+void vehicles_impact(float _minspeed, float _speedfac, float _maxpain);
+
+void shieldhit_think();
+
+float vehicle_addplayerslot(    entity _owner,
+                                entity _slot,
+                                float _hud,
+                                string _hud_model,
+                                float() _framefunc,
+                                void(float) _exitfunc);
+
+.void() vehicle_impact;
+
+float vehicle_initialize(string  net_name,
+                         string  bodymodel,
+                         string  topmodel,
+                         string  hudmodel,
+                         string  toptag,
+                         string  hudtag,
+                         string  viewtag,
+                         float   vhud,
+                         vector  min_s,
+                         vector  max_s,
+                         float   nodrop,
+                         void(float _spawnflag)  spawnproc,
+                         float   _respawntime,
+                         float() physproc,
+                         void()  enterproc,
+                         void(float extflag) exitfunc,
+                         void() dieproc,
+                         void() thinkproc,
+                         float  use_csqc,
+                         float _max_health,
+                         float _max_shield);
+
+float  force_fromtag_normpower;
+
+void vehicles_painframe();
+
+void vehicles_locktarget(float incr, float decr, float _lock_time);
+
+vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power);
+
+vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power);
+
+void vehicles_projectile_explode();
+
+#if VEHICLES_ENABLED
+
+.int vehicle_flags;
+const int VHF_ISVEHICLE     = 2;    /// Indicates vehicle
+const int VHF_HASSHIELD     = 4;    /// Vehicle has shileding
+const int VHF_SHIELDREGEN   = 8;    /// Vehicles shield regenerates
+const int VHF_HEALTHREGEN   = 16;   /// Vehicles health regenerates
+const int VHF_ENERGYREGEN   = 32;   /// Vehicles energy regenerates
+const int VHF_DEATHEJECT    = 64;   /// Vehicle ejects pilot upon fatal damage
+const int VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
+const int VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound
+const int VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
+const int VHF_DMGSHAKE      = 1024; /// Add random velocity each frame if health < 50%
+const int VHF_DMGROLL       = 2048; /// Add random angles each frame if health < 50%
+const int VHF_DMGHEADROLL   = 4096; /// Add random head angles each frame if health < 50%
+const int VHF_MULTISLOT     = 8192; /// Vehicle has multiple player slots
+const int VHF_PLAYERSLOT    = 16384;    /// This ent is a player slot on a multi-person vehicle
+
+.entity gun1;
+.entity gun2;
+.entity gun3;
+.entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
+.entity vehicle;
+.entity vehicle_viewport;
+.entity vehicle_hudmodel;
+.entity vehicle_controller;
+
+.entity gunner1;
+.entity gunner2;
+
+.float vehicle_health;      /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
+.float vehicle_energy;      /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
+.float vehicle_shield;      /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
+
+.float vehicle_ammo1;   /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
+.float vehicle_reload1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload1 value.
+.float vehicle_ammo2;   /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo2 value.
+.float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
+
+.float sound_nexttime;
+const float VOL_VEHICLEENGINE = 1;
+
+.float hud;
+.float dmg_time;
+.float  vehicle_respawntime;
+//.void() vehicle_spawn;
+
+void vehicles_exit(float eject);
+.void(float exit_flags) vehicle_exit;
+const float VHEF_NORMAL = 0;  /// User pressed exit key
+const float VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
+const float VHEF_RELESE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
+
+const float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
+const float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
+const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
+
+.void() vehicle_enter;  /// Vehicles custom funciton to be executed when owner exit it
+.void() vehicle_die;    /// Vehicles custom function to be executed when vehile die
+const float VHSF_NORMAL = 0;
+const float VHSF_FACTORY = 2;
+.void(float _spawnflag) vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
+.float(float _imp) vehicles_impulse;
+.float vehicle_weapon2mode;
+
+#if VEHICLES_USE_ODE
+void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
+void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
+void(entity e, vector torque) physics_addtorque = #542; // add relative torque
+#endif  // VEHICLES_USE_ODE
+#endif  // VEHICLES_ENABLED
+#endif
diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc
deleted file mode 100644 (file)
index e29c235..0000000
+++ /dev/null
@@ -1,1446 +0,0 @@
-float autocvar_g_vehicles_crush_dmg;
-float autocvar_g_vehicles_crush_force;
-float autocvar_g_vehicles_delayspawn;
-float autocvar_g_vehicles_delayspawn_jitter;
-
-float autocvar_g_vehicles_vortex_damagerate = 0.5;
-float autocvar_g_vehicles_machinegun_damagerate = 0.5;
-float autocvar_g_vehicles_rifle_damagerate = 0.75;
-float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
-float autocvar_g_vehicles_tag_damagerate = 5;
-
-float autocvar_g_vehicles;
-
-void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
-void vehicles_return();
-void vehicles_enter();
-void vehicles_touch();
-void vehicles_reset_colors();
-void vehicles_clearreturn();
-void vehicles_setreturn();
-
-
-/** AuxiliaryXhair*
-    Send additional points of interest to be drawn, to vehicle owner
-**/
-const float MAX_AXH = 4;
-.entity AuxiliaryXhair[MAX_AXH];
-
-float SendAuxiliaryXhair(entity to, int sf)
-{
-
-       WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
-
-       WriteByte(MSG_ENTITY, self.cnt);
-
-       WriteCoord(MSG_ENTITY, self.origin.x);
-       WriteCoord(MSG_ENTITY, self.origin.y);
-       WriteCoord(MSG_ENTITY, self.origin.z);
-
-    WriteByte(MSG_ENTITY, rint(self.colormod.x * 255));
-    WriteByte(MSG_ENTITY, rint(self.colormod.y * 255));
-    WriteByte(MSG_ENTITY, rint(self.colormod.z * 255));
-
-    return true;
-}
-
-void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
-{
-    if (!IS_REAL_CLIENT(own))
-        return;
-
-    entity axh;
-
-    axh_id = bound(0, axh_id, MAX_AXH);
-    axh = own.(AuxiliaryXhair[axh_id]);
-
-    if(axh == world || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
-    {
-        axh                     = spawn();
-        axh.cnt                 = axh_id;
-        axh.drawonlytoclient    = own;
-        axh.owner               = own;
-        Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
-    }
-
-    setorigin(axh, loc);
-    axh.colormod            = clr;
-    axh.SendFlags           = 0x01;
-    own.(AuxiliaryXhair[axh_id]) = axh;
-}
-
-/*
-// SVC_TEMPENTITY based, horrible with even 50 ping. hm.
-// WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
-void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
-{
-       msgexntity = own;
-
-       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-       WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
-
-       WriteByte(MSG_ONE, axh_id);
-
-       WriteCoord(MSG_ONE, loc_x);
-       WriteCoord(MSG_ONE, loc_y);
-       WriteCoord(MSG_ONE, loc_z);
-
-    WriteByte(MSG_ONE, rint(clr_x * 255));
-    WriteByte(MSG_ONE, rint(clr_y * 255));
-    WriteByte(MSG_ONE, rint(clr_z * 255));
-
-}
-*/
-// End AuxiliaryXhair
-
-/**
-    Notifies the client that he enterd a vehicle, and sends
-    realavent data.
-
-    only sends vehicle_id atm (wich is a HUD_* constant, ex. HUD_SPIDERBOT)
-**/
-void CSQCVehicleSetup(entity own, float vehicle_id)
-{
-    if (!IS_REAL_CLIENT(own))
-        return;
-
-       msg_entity = own;
-
-       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-       WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
-       if(vehicle_id != 0)
-           WriteByte(MSG_ONE, vehicle_id);
-       else
-        WriteByte(MSG_ONE, 1 + own.vehicle.vehicle_weapon2mode + HUD_VEHICLE_LAST);
-}
-
-/** vehicles_locktarget
-
-    Generic target locking.
-
-    Figure out if what target is "locked" (if any), for missile tracking as such.
-
-    after calling, "if(self.lock_target != world && self.lock_strength == 1)" mean
-    you have a locked in target.
-
-    Exspects a crosshair_trace() or equivalent to be
-    dont before calling.
-
-**/
-.entity lock_target;
-.float  lock_strength;
-.float  lock_time;
-.float  lock_soundtime;
-const float    DAMAGE_TARGETDRONE = 10;
-
-vector targetdrone_getnewspot()
-{
-
-       vector spot;
-       float i;
-       for(i = 0; i < 100; ++i)
-       {
-               spot = self.origin + randomvec() * 1024;
-               tracebox(spot, self.mins, self.maxs, spot, MOVE_NORMAL, self);
-               if(trace_fraction == 1.0 && trace_startsolid == 0 && trace_allsolid == 0)
-                       return spot;
-       }
-       return self.origin;
-}
-
-#if 0
-void targetdrone_think();
-void targetdrone_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
-void targetdrone_renwe()
-{
-       self.think = targetdrone_think;
-       self.nextthink = time + 0.1;
-       setorigin(self, targetdrone_getnewspot());
-       self.health = 200;
-       self.takedamage = DAMAGE_TARGETDRONE;
-       self.event_damage = targetdrone_damage;
-       self.solid = SOLID_BBOX;
-       setmodel(self, "models/runematch/rune.mdl");
-       self.effects = EF_LOWPRECISION;
-       self.scale = 10;
-       self.movetype = MOVETYPE_BOUNCEMISSILE;
-       setsize(self, '-100 -100 -100', '100 100 100');
-
-}
-void targetdrone_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{
-       self.health -= damage;
-       if(self.health <= 0)
-       {
-               pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
-
-               if(!self.cnt)
-                       remove(self);
-               else
-               {
-                       self.think = targetdrone_renwe;
-                       self.nextthink = time + 1 + random() * 2;
-                       self.solid = SOLID_NOT;
-                       setmodel(self, "");
-               }
-       }
-}
-entity targetdrone_getfear()
-{
-       entity fear;
-       float i;
-
-       for(i = 64; i <= 1024; i += 64)
-       {
-               fear = findradius(self.origin, i);
-               while(fear)
-               {
-                       if(fear.bot_dodge)
-                               return fear;
-
-                       fear = fear.chain;
-               }
-       }
-
-       return world;
-}
-void targetdrone_think()
-{
-       self.nextthink = time + 0.1;
-
-       if(self.wp00)
-       if(self.wp00.deadflag != DEAD_NO)
-               self.wp00 = targetdrone_getfear();
-
-       if(!self.wp00)
-               self.wp00 = targetdrone_getfear();
-
-       vector newdir;
-
-       if(self.wp00)
-               newdir = steerlib_push(self.wp00.origin) + randomvec() * 0.75;
-       else
-               newdir = randomvec() * 0.75;
-
-       newdir = newdir * 0.5 + normalize(self.velocity) * 0.5;
-
-       if(self.wp00)
-               self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.wp00.origin - self.origin), 1024)) * 700);
-       else
-               self.velocity = normalize(newdir) * 750;
-
-       tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 2, MOVE_NORMAL, self);
-       if(trace_fraction != 1.0)
-               self.velocity = self.velocity * -1;
-
-       //normalize((normalize(self.velocity) * 0.5 + newdir * 0.5)) * 750;
-}
-
-void targetdrone_spawn(vector _where, float _autorenew)
-{
-       entity drone = spawn();
-       setorigin(drone, _where);
-       drone.think = targetdrone_renwe;
-       drone.nextthink = time + 0.1;
-       drone.cnt = _autorenew;
-}
-#endif
-
-void vehicles_locktarget(float incr, float decr, float _lock_time)
-{
-    if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
-    {
-        self.lock_target    = world;
-        self.lock_strength  = 0;
-        self.lock_time      = 0;
-    }
-
-    if(self.lock_time > time)
-    {
-        if(self.lock_target)
-        if(self.lock_soundtime < time)
-        {
-            self.lock_soundtime = time + 0.5;
-            play2(self.owner, "vehicles/locked.wav");
-        }
-
-        return;
-    }
-
-    if(trace_ent != world)
-    {
-        if(teamplay && trace_ent.team == self.team)
-            trace_ent = world;
-
-        if(trace_ent.deadflag != DEAD_NO)
-            trace_ent = world;
-        if(!(
-            (trace_ent.vehicle_flags & VHF_ISVEHICLE) || 
-            (trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || 
-            (trace_ent.takedamage == DAMAGE_TARGETDRONE)
-            )) { trace_ent = world; }
-    }
-
-    if(self.lock_target == world && trace_ent != world)
-        self.lock_target = trace_ent;
-
-    if(self.lock_target && trace_ent == self.lock_target)
-    {
-        if(self.lock_strength != 1 && self.lock_strength + incr >= 1)
-        {
-            play2(self.owner, "vehicles/lock.wav");
-            self.lock_soundtime = time + 0.8;
-        }
-        else if (self.lock_strength != 1 && self.lock_soundtime < time)
-        {
-            play2(self.owner, "vehicles/locking.wav");
-            self.lock_soundtime = time + 0.3;
-        }
-
-    }
-
-    // Have a locking target
-    // Trace hit current target
-    if(trace_ent == self.lock_target && trace_ent != world)
-    {
-        self.lock_strength = min(self.lock_strength + incr, 1);
-        if(self.lock_strength == 1)
-            self.lock_time = time + _lock_time;
-    }
-    else
-    {
-        if(trace_ent)
-            self.lock_strength = max(self.lock_strength - decr * 2, 0);
-        else
-            self.lock_strength = max(self.lock_strength - decr, 0);
-
-        if(self.lock_strength == 0)
-            self.lock_target = world;
-    }
-}
-
-#define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
-ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
-
-#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
-traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
-if(trace_fraction != 1) \
-    acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
-
-// Hover movement support
-float  force_fromtag_power;
-float  force_fromtag_normpower;
-vector force_fromtag_origin;
-vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power)
-{
-    force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
-    v_forward  = normalize(v_forward) * -1;
-    traceline(force_fromtag_origin, force_fromtag_origin - (v_forward  * spring_length), MOVE_NORMAL, self);
-
-    force_fromtag_power = (1 - trace_fraction) * max_power;
-    force_fromtag_normpower = force_fromtag_power / max_power;
-
-    return v_forward  * force_fromtag_power;
-}
-
-// Experimental hovermode wich uses attraction/repulstion from surface insted of gravity/repulsion
-// Can possibly be use to move abt any surface (inclusing walls/celings)
-vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
-{
-
-    force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
-    v_forward  = normalize(v_forward) * -1;
-    traceline(force_fromtag_origin, force_fromtag_origin - (v_forward  * spring_length), MOVE_NORMAL, self);
-
-    // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
-    if(trace_fraction == 1.0)
-    {
-        force_fromtag_normpower = -0.25;
-        return '0 0 -200';
-    }
-
-    force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
-    force_fromtag_normpower = force_fromtag_power / max_power;
-
-    return v_forward  * force_fromtag_power;
-}
-
-// Generic vehile projectile system
-void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{
-    // Ignore damage from oterh projectiles from my owner (dont mess up volly's)
-    if(inflictor.owner == self.owner)
-        return;
-
-    self.health -= damage;
-    self.velocity += force;
-    if(self.health < 1)
-    {
-        self.takedamage = DAMAGE_NO;
-        self.event_damage = func_null;
-        self.think = self.use;
-        self.nextthink = time;
-    }
-}
-
-void vehicles_projectile_explode()
-{
-    if(self.owner && other != world)
-    {
-        if(other == self.owner.vehicle)
-            return;
-
-        if(other == self.owner.vehicle.tur_head)
-            return;
-    }
-
-       PROJECTILE_TOUCH;
-
-       self.event_damage = func_null;
-    RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other);
-
-    remove (self);
-}
-
-entity vehicles_projectile(string _mzlfx, string _mzlsound,
-                           vector _org, vector _vel,
-                           float _dmg, float _radi, float _force,  float _size,
-                           float _deahtype, float _projtype, float _health,
-                           float _cull, float _clianim, entity _owner)
-{
-    entity proj;
-
-    proj = spawn();
-
-    PROJECTILE_MAKETRIGGER(proj);
-    setorigin(proj, _org);
-
-    proj.shot_dmg         = _dmg;
-    proj.shot_radius      = _radi;
-    proj.shot_force       = _force;
-    proj.totalfrags       = _deahtype;
-    proj.solid            = SOLID_BBOX;
-    proj.movetype         = MOVETYPE_FLYMISSILE;
-    proj.flags            = FL_PROJECTILE;
-    proj.bot_dodge        = true;
-    proj.bot_dodgerating  = _dmg;
-    proj.velocity         = _vel;
-    proj.touch            = vehicles_projectile_explode;
-    proj.use              = vehicles_projectile_explode;
-    proj.owner            = self;
-    proj.realowner        = _owner;
-    proj.think            = SUB_Remove;
-    proj.nextthink        = time + 30;
-
-    if(_health)
-    {
-        proj.takedamage       = DAMAGE_AIM;
-        proj.event_damage     = vehicles_projectile_damage;
-        proj.health           = _health;
-    }
-    else
-        proj.flags           = FL_PROJECTILE | FL_NOTARGET;
-
-    if(_mzlsound)
-        sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
-
-    if(_mzlfx)
-        pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
-
-
-    setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
-
-    CSQCProjectile(proj, _clianim, _projtype, _cull);
-
-    return proj;
-}
-// End generic vehile projectile system
-
-void vehicles_reset()
-{
-       if(self.owner)
-       {
-               entity oldself = self;
-               self = self.owner;
-               vehicles_exit(VHEF_RELESE);
-               self = oldself;
-       }
-       self.alpha      = -1;
-       self.movetype   = MOVETYPE_NONE;
-       self.effects    = EF_NODRAW;
-       self.colormod  = '0 0 0';
-       self.avelocity = '0 0 0';
-       self.velocity  = '0 0 0';
-       self.event_damage = func_null;
-       self.solid = SOLID_NOT;
-       self.deadflag = DEAD_NO;
-
-       self.touch = func_null;
-       self.nextthink = 0;
-       vehicles_setreturn();
-}
-
-/** vehicles_spawn
-    Exetuted for all vehicles on (re)spawn.
-    Sets defaults for newly spawned units.
-**/
-void vehicles_spawn()
-{
-    dprint("Spawning vehicle: ", self.netname, "\n");
-
-    // De-own & reset
-    self.vehicle_hudmodel.viewmodelforclient = self;
-
-    self.owner              = world;
-    self.touch              = vehicles_touch;
-    self.event_damage       = vehicles_damage;
-    self.reset              = vehicles_reset;
-    self.iscreature         = true;
-    self.teleportable       = false; // no teleporting for vehicles, too buggy
-    self.damagedbycontents     = true;
-    self.movetype           = MOVETYPE_WALK;
-    self.solid              = SOLID_SLIDEBOX;
-    self.takedamage         = DAMAGE_AIM;
-       self.deadflag           = DEAD_NO;
-    self.bot_attack         = true;
-    self.flags              = FL_NOTARGET;
-    self.avelocity          = '0 0 0';
-    self.velocity           = '0 0 0';
-
-    // Reset locking
-    self.lock_strength      = 0;
-    self.lock_target        = world;
-    self.misc_bulletcounter = 0;
-
-    // Return to spawn
-    self.angles             = self.pos2;
-    setorigin(self, self.pos1 + '0 0 0');
-    // Show it
-    pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
-
-    if(self.vehicle_controller)
-        self.team = self.vehicle_controller.team;
-
-    vehicles_reset_colors();
-    self.vehicle_spawn(VHSF_NORMAL);
-}
-
-// Better way of determening whats crushable needed! (fl_crushable?)
-float vehicles_crushable(entity e)
-{
-    if(IS_PLAYER(e))
-        return true;
-
-    if(e.flags & FL_MONSTER)
-        return true;
-
-    return false;
-}
-
-void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
-{
-    if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
-        return;
-
-    if(self.play_time < time)
-    {
-        float wc = vlen(self.velocity - self.oldvelocity);
-        //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
-        //dprint("vel: ", vtos(self.velocity), "\n");
-        if(_minspeed < wc)
-        {
-            float take = min(_speedfac * wc, _maxpain);
-            Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
-            self.play_time = time + 0.25;
-
-            //dprint("wc: ", ftos(wc), "\n");
-            //dprint("take: ", ftos(take), "\n");
-        }
-    }
-}
-
-.void() vehicle_impact;
-void vehicles_touch()
-{
-       if(MUTATOR_CALLHOOK(VehicleTouch))
-               return;
-
-    // Vehicle currently in use
-    if(self.owner)
-    {
-        if(other != world)
-        if(vehicles_crushable(other))
-        {
-            if(vlen(self.velocity) != 0)
-                Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
-
-            return; // Dont do selfdamage when hitting "soft targets".
-        }
-
-        if(self.play_time < time)
-        if(self.vehicle_impact)
-            self.vehicle_impact();
-
-        return;
-    }
-
-    if (!IS_PLAYER(other))
-        return;
-
-    if(other.deadflag != DEAD_NO)
-        return;
-
-    if(other.vehicle != world)
-        return;
-
-    vehicles_enter();
-}
-float autocvar_g_vehicles_allow_bots = 0;
-void vehicles_enter()
-{
-   // Remove this when bots know how to use vehicles
-
-    if (IS_BOT_CLIENT(other))
-        if (autocvar_g_vehicles_allow_bots)
-            dprint("Bot enters vehicle\n"); // This is where we need to disconnect (some, all?) normal bot AI and hand over to vehicle's _aiframe()
-        else
-            return;
-
-    if(self.phase > time)
-        return;
-    if(other.frozen)
-        return;
-    if(other.vehicle)
-        return;
-    if(other.deadflag != DEAD_NO)
-        return;
-
-    if(teamplay)
-    if(self.team)
-    if(self.team != other.team)
-        return;
-
-    RemoveGrapplingHook(other);
-
-    self.vehicle_ammo1   = 0;
-    self.vehicle_ammo2   = 0;
-    self.vehicle_reload1 = 0;
-    self.vehicle_reload2 = 0;
-    self.vehicle_energy  = 0;
-
-    self.owner          = other;
-    self.switchweapon   = other.switchweapon;
-
-    // .viewmodelforclient works better.
-    //self.vehicle_hudmodel.drawonlytoclient = self.owner;
-
-    self.vehicle_hudmodel.viewmodelforclient = self.owner;
-
-    self.event_damage         = vehicles_damage;
-    self.nextthink            = 0;
-    self.owner.angles         = self.angles;
-    self.owner.takedamage     = DAMAGE_NO;
-    self.owner.solid          = SOLID_NOT;
-    self.owner.movetype       = MOVETYPE_NOCLIP;
-    self.owner.alpha          = -1;
-    self.owner.vehicle        = self;
-    self.owner.event_damage   = func_null;
-    self.owner.view_ofs       = '0 0 0';
-    self.colormap             = self.owner.colormap;
-    if(self.tur_head)
-        self.tur_head.colormap    = self.owner.colormap;
-
-    self.owner.hud            = self.hud;
-    self.owner.PlayerPhysplug = self.PlayerPhysplug;
-
-    self.owner.vehicle_ammo1    = self.vehicle_ammo1;
-    self.owner.vehicle_ammo2    = self.vehicle_ammo2;
-    self.owner.vehicle_reload1  = self.vehicle_reload1;
-    self.owner.vehicle_reload2  = self.vehicle_reload2;
-
-    // Cant do this, hides attached objects too.
-    //self.exteriormodeltoclient = self.owner;
-    //self.tur_head.exteriormodeltoclient = self.owner;
-
-    other.flags &= ~FL_ONGROUND;
-    self.flags  &= ~FL_ONGROUND;
-
-    self.team                 = self.owner.team;
-    self.flags               -= FL_NOTARGET;
-    self.monster_attack       = true;
-
-    if (IS_REAL_CLIENT(other))
-    {
-        msg_entity = other;
-        WriteByte (MSG_ONE, SVC_SETVIEWPORT);
-        WriteEntity(MSG_ONE, self.vehicle_viewport);
-
-        WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
-        if(self.tur_head)
-        {
-            WriteAngle(MSG_ONE, self.tur_head.angles.x + self.angles.x); // tilt
-            WriteAngle(MSG_ONE, self.tur_head.angles.y + self.angles.y); // yaw
-            WriteAngle(MSG_ONE, 0);                                      // roll
-        }
-        else
-        {
-            WriteAngle(MSG_ONE,  self.angles.x * -1); // tilt
-            WriteAngle(MSG_ONE,  self.angles.y);      // yaw
-            WriteAngle(MSG_ONE,  0);                  // roll
-        }
-    }
-
-    vehicles_clearreturn();
-
-    CSQCVehicleSetup(self.owner, self.hud);
-
-    vh_player = other;
-    vh_vehicle = self;
-    MUTATOR_CALLHOOK(VehicleEnter);
-    other = vh_player;
-    self = vh_vehicle;
-
-    self.vehicle_enter();
-    antilag_clear(other);
-}
-
-/** vehicles_findgoodexit
-    Locates a valid location for the player to exit the vehicle.
-    Will first try prefer_spot, then up 100 random spots arround the vehicle
-    wich are in direct line of sight and empty enougth to hold a players bbox
-**/
-vector vehicles_findgoodexit(vector prefer_spot)
-{
-    //vector exitspot;
-    float mysize;
-
-    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
-    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
-        return prefer_spot;
-
-    mysize = 1.5 * vlen(self.maxs - self.mins);
-    float i;
-    vector v, v2;
-    v2 = 0.5 * (self.absmin + self.absmax);
-    for(i = 0; i < 100; ++i)
-    {
-        v = randomvec();
-        v.z = 0;
-        v = v2 + normalize(v) * mysize;
-        tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
-        if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
-            return v;
-    }
-
-    /*
-    exitspot = (self.origin + '0 0 48') + v_forward * mysize;
-    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
-    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
-        return exitspot;
-
-    exitspot = (self.origin + '0 0 48') - v_forward * mysize;
-    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
-    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
-        return exitspot;
-
-    exitspot = (self.origin + '0 0 48') + v_right * mysize;
-    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
-    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
-        return exitspot;
-
-    exitspot = (self.origin + '0 0 48') - v_right * mysize;
-    tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
-    if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
-        return exitspot;
-    */
-
-    return self.origin;
-}
-
-/** vehicles_exit
-    Standarrd vehicle release fucntion.
-    custom code goes in self.vehicle_exit
-**/
-float vehicles_exit_running;
-void vehicles_exit(float eject)
-{
-    entity _vehicle;
-    entity _player;
-    entity _oldself = self;
-
-    if(vehicles_exit_running)
-    {
-        dprint("^1vehicles_exit allready running! this is not good..\n");
-        return;
-    }
-
-    vehicles_exit_running = true;
-    if(IS_CLIENT(self))
-    {
-        _vehicle = self.vehicle;
-
-        if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
-        {
-            _vehicle.vehicle_exit(eject);
-            self = _oldself;
-            vehicles_exit_running = false;
-            return;
-        }
-    }
-    else
-        _vehicle = self;
-
-    _player = _vehicle.owner;
-
-    self = _vehicle;
-
-    if (_player)
-    {
-        if (IS_REAL_CLIENT(_player))
-        {
-            msg_entity = _player;
-            WriteByte (MSG_ONE, SVC_SETVIEWPORT);
-            WriteEntity( MSG_ONE, _player);
-
-            WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
-            WriteAngle(MSG_ONE, 0);
-            WriteAngle(MSG_ONE, _vehicle.angles.y);
-            WriteAngle(MSG_ONE, 0);
-        }
-
-        setsize(_player, PL_MIN,PL_MAX);
-
-        _player.takedamage     = DAMAGE_AIM;
-        _player.solid          = SOLID_SLIDEBOX;
-        _player.movetype       = MOVETYPE_WALK;
-        _player.effects        &= ~EF_NODRAW;
-        _player.alpha          = 1;
-        _player.PlayerPhysplug = func_null;
-        _player.vehicle        = world;
-        _player.view_ofs       = PL_VIEW_OFS;
-        _player.event_damage   = PlayerDamage;
-        _player.hud            = HUD_NORMAL;
-        _player.switchweapon   = _vehicle.switchweapon;
-
-        CSQCVehicleSetup(_player, HUD_NORMAL);
-    }
-    _vehicle.flags |= FL_NOTARGET;
-
-    if(_vehicle.deadflag == DEAD_NO)
-        _vehicle.avelocity          = '0 0 0';
-
-    _vehicle.tur_head.nodrawtoclient             = world;
-
-    if(!teamplay)
-        _vehicle.team = 0;
-
-    vh_player = _player;
-    vh_vehicle = _vehicle;
-    MUTATOR_CALLHOOK(VehicleExit);
-    _player = vh_player;
-    _vehicle = vh_vehicle;
-
-    _vehicle.team = _vehicle.tur_head.team;
-
-    sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
-    _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
-    _vehicle.phase = time + 1;
-    _vehicle.monster_attack = false;
-
-    _vehicle.vehicle_exit(eject);
-
-    vehicles_setreturn();
-    vehicles_reset_colors();
-    _vehicle.owner = world;
-    self = _oldself;
-
-    vehicles_exit_running = false;
-}
-
-
-void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
-{
-    if(self.regen_field < field_max)
-    if(timer + rpause < time)
-    {
-        if(_healthscale)
-            regen = regen * (self.vehicle_health / self.tur_health);
-
-        self.regen_field = min(self.regen_field + regen * delta_time, field_max);
-
-        if(self.owner)
-            self.owner.regen_field = (self.regen_field / field_max) * 100;
-    }
-}
-
-void shieldhit_think()
-{
-    self.alpha -= 0.1;
-    if (self.alpha <= 0)
-    {
-        //setmodel(self, "");
-        self.alpha = -1;
-        self.effects |= EF_NODRAW;
-    }
-    else
-    {
-        self.nextthink = time + 0.1;
-    }
-}
-
-void vehicles_painframe()
-{
-    if(self.owner.vehicle_health <= 50)
-    if(self.pain_frame < time)
-    {
-        float _ftmp;
-        _ftmp = self.owner.vehicle_health / 50;
-        self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
-        pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
-
-        if(self.vehicle_flags & VHF_DMGSHAKE)
-            self.velocity += randomvec() * 30;
-
-        if(self.vehicle_flags & VHF_DMGROLL)
-            if(self.vehicle_flags & VHF_DMGHEADROLL)
-                self.tur_head.angles += randomvec();
-            else
-                self.angles += randomvec();
-
-    }
-}
-
-void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{
-    self.dmg_time = time;
-
-       // WEAPONTODO
-    if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
-        damage *= autocvar_g_vehicles_vortex_damagerate;
-
-    if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
-        damage *= autocvar_g_vehicles_machinegun_damagerate;
-
-    if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
-        damage *= autocvar_g_vehicles_rifle_damagerate;
-
-    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
-        damage *= autocvar_g_vehicles_vaporizer_damagerate;
-
-    if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
-        damage *= autocvar_g_vehicles_tag_damagerate;
-
-    self.enemy = attacker;
-
-    if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
-    {
-        if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
-        {
-            self.vehicle_shieldent = spawn();
-            self.vehicle_shieldent.effects = EF_LOWPRECISION;
-
-            setmodel(self.vehicle_shieldent, "models/vhshield.md3");
-            setattachment(self.vehicle_shieldent, self, "");
-            setorigin(self.vehicle_shieldent, real_origin(self) - self.origin);
-            self.vehicle_shieldent.scale       = 256 / vlen(self.maxs - self.mins);
-            self.vehicle_shieldent.think       = shieldhit_think;
-        }
-
-        self.vehicle_shieldent.colormod    = '1 1 1';
-        self.vehicle_shieldent.alpha       = 0.45;
-        self.vehicle_shieldent.angles      = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
-        self.vehicle_shieldent.nextthink   = time;
-        self.vehicle_shieldent.effects &= ~EF_NODRAW;
-
-        self.vehicle_shield -= damage;
-
-        if(self.vehicle_shield < 0)
-        {
-            self.vehicle_health            -= fabs(self.vehicle_shield);
-            self.vehicle_shieldent.colormod = '2 0 0';
-            self.vehicle_shield             = 0;
-            self.vehicle_shieldent.alpha    = 0.75;
-
-               if(sound_allowed(MSG_BROADCAST, attacker))
-                spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);   // FIXME: PLACEHOLDER
-        }
-        else
-               if(sound_allowed(MSG_BROADCAST, attacker))
-                spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
-
-    }
-    else
-    {
-        self.vehicle_health -= damage;
-
-        if(sound_allowed(MSG_BROADCAST, attacker))
-            spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
-    }
-
-       if(self.damageforcescale < 1 && self.damageforcescale > 0)
-               self.velocity += force * self.damageforcescale;
-       else
-               self.velocity += force;
-
-    if(self.vehicle_health <= 0)
-    {
-        if(self.owner)
-            if(self.vehicle_flags & VHF_DEATHEJECT)
-                vehicles_exit(VHEF_EJECT);
-            else
-                vehicles_exit(VHEF_RELESE);
-
-
-        antilag_clear(self);
-
-        self.vehicle_die();
-        vehicles_setreturn();
-    }
-}
-
-void vehicles_clearreturn()
-{
-    entity ret;
-    // Remove "return helper", if any.
-    ret = findchain(classname, "vehicle_return");
-    while(ret)
-    {
-        if(ret.wp00 == self)
-        {
-            ret.classname   = "";
-            ret.think       = SUB_Remove;
-            ret.nextthink   = time + 0.1;
-
-            if(ret.waypointsprite_attached)
-                WaypointSprite_Kill(ret.waypointsprite_attached);
-
-            return;
-        }
-        ret = ret.chain;
-    }
-}
-
-void vehicles_return()
-{
-    pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
-
-    self.wp00.think     = vehicles_spawn;
-    self.wp00.nextthink = time;
-
-    if(self.waypointsprite_attached)
-        WaypointSprite_Kill(self.waypointsprite_attached);
-
-    remove(self);
-}
-
-void vehicles_showwp_goaway()
-{
-    if(self.waypointsprite_attached)
-        WaypointSprite_Kill(self.waypointsprite_attached);
-
-    remove(self);
-
-}
-
-void vehicles_showwp()
-{
-    entity oldself = world;
-    vector rgb;
-
-    if(self.cnt)
-    {
-        self.think      = vehicles_return;
-        self.nextthink  = self.cnt;
-    }
-    else
-    {
-        self.think      = vehicles_return;
-        self.nextthink  = time +1;
-
-        oldself = self;
-        self = spawn();
-        setmodel(self, "null");
-        self.team = oldself.wp00.team;
-        self.wp00 = oldself.wp00;
-        setorigin(self, oldself.wp00.pos1);
-
-        self.nextthink = time + 5;
-        self.think = vehicles_showwp_goaway;
-    }
-
-    if(teamplay && self.team)
-           rgb = Team_ColorRGB(self.team);
-    else
-           rgb = '1 1 1';
-    WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
-    if(self.waypointsprite_attached)
-    {
-        WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
-        if(oldself == world)
-            WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
-        WaypointSprite_Ping(self.waypointsprite_attached);
-    }
-
-    if(oldself != world)
-        self = oldself;
-}
-
-void vehicles_setreturn()
-{
-    entity ret;
-
-    vehicles_clearreturn();
-
-    ret = spawn();
-    ret.classname   = "vehicle_return";
-    ret.wp00       = self;
-    ret.team        = self.team;
-    ret.think       = vehicles_showwp;
-
-       if(self.deadflag != DEAD_NO)
-       {
-               ret.cnt = max(game_starttime, time) + self.vehicle_respawntime;
-               ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 5);
-       }
-       else
-               ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 1);
-
-    setmodel(ret, "null");
-    setorigin(ret, self.pos1 + '0 0 96');
-}
-
-void vehicles_reset_colors()
-{
-    entity e;
-    float _effects = 0, _colormap;
-    vector _glowmod, _colormod;
-
-    if(autocvar_g_nodepthtestplayers)
-        _effects |= EF_NODEPTHTEST;
-
-    if(autocvar_g_fullbrightplayers)
-        _effects |= EF_FULLBRIGHT;
-
-    if(self.team)
-        _colormap = 1024 + (self.team - 1) * 17;
-    else
-        _colormap = 1024;
-
-    _glowmod  = '0 0 0';
-    _colormod = '0 0 0';
-
-    // Find all ents attacked to main model and setup effects, colormod etc.
-    e = findchainentity(tag_entity, self);
-    while(e)
-    {
-        if(e != self.vehicle_shieldent)
-        {
-            e.effects   = _effects; //  | EF_LOWPRECISION;
-            e.colormod  = _colormod;
-            e.colormap  = _colormap;
-            e.alpha     = 1;
-        }
-        e = e.chain;
-    }
-
-    self.vehicle_hudmodel.effects  = self.effects  = _effects; // | EF_LOWPRECISION;
-    self.vehicle_hudmodel.colormod = self.colormod = _colormod;
-    self.vehicle_hudmodel.colormap = self.colormap = _colormap;
-    self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
-
-    self.alpha     = 1;
-    self.avelocity = '0 0 0';
-    self.velocity  = '0 0 0';
-    self.effects   = _effects;
-}
-
-void vehicle_use()
-{
-    dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
-
-    self.tur_head.team = activator.team;
-
-    if(self.tur_head.team == 0)
-        self.active = ACTIVE_NOT;
-    else
-        self.active = ACTIVE_ACTIVE;
-
-    if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO)
-    {
-        dprint("^3Eat shit yall!\n");
-        vehicles_setreturn();
-        vehicles_reset_colors();
-    }
-    else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO)
-    {
-
-    }
-}
-
-float vehicle_addplayerslot(    entity _owner,
-                                entity _slot,
-                                float _hud,
-                                string _hud_model,
-                                float() _framefunc,
-                                void(float) _exitfunc)
-{
-    if (!(_owner.vehicle_flags & VHF_MULTISLOT))
-        _owner.vehicle_flags |= VHF_MULTISLOT;
-
-    _slot.PlayerPhysplug = _framefunc;
-    _slot.vehicle_exit = _exitfunc;
-    _slot.hud = _hud;
-    _slot.vehicle_flags = VHF_PLAYERSLOT;
-    _slot.vehicle_viewport = spawn();
-    _slot.vehicle_hudmodel = spawn();
-    _slot.vehicle_hudmodel.viewmodelforclient = _slot;
-    _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
-
-    setmodel(_slot.vehicle_hudmodel, _hud_model);
-    setmodel(_slot.vehicle_viewport, "null");
-
-    setattachment(_slot.vehicle_hudmodel, _slot, "");
-    setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
-
-    return true;
-}
-
-float vehicle_initialize(string  net_name,
-                         string  bodymodel,
-                         string  topmodel,
-                         string  hudmodel,
-                         string  toptag,
-                         string  hudtag,
-                         string  viewtag,
-                         float   vhud,
-                         vector  min_s,
-                         vector  max_s,
-                         float   nodrop,
-                         void(float _spawnflag)  spawnproc,
-                         float   _respawntime,
-                         float() physproc,
-                         void()  enterproc,
-                         void(float extflag) exitfunc,
-                         void() dieproc,
-                         void() thinkproc,
-                         float  use_csqc,
-                         float _max_health,
-                         float _max_shield)
-{
-       if(!autocvar_g_vehicles)
-               return false;
-
-    if(self.targetname)
-    {
-        self.vehicle_controller = find(world, target, self.targetname);
-        if(!self.vehicle_controller)
-        {
-            bprint("^1WARNING: ^7Vehicle with invalid .targetname\n");
-        }
-        else
-        {
-            self.team = self.vehicle_controller.team;
-            self.use = vehicle_use;
-
-            if(teamplay)
-            {
-                if(self.vehicle_controller.team == 0)
-                    self.active = ACTIVE_NOT;
-                else
-                    self.active = ACTIVE_ACTIVE;
-            }
-        }
-    }
-
-    precache_sound("onslaught/ons_hit2.wav");
-    precache_sound("onslaught/electricity_explode.wav");
-
-
-    addstat(STAT_HUD, AS_INT,  hud);
-       addstat(STAT_VEHICLESTAT_HEALTH,  AS_INT, vehicle_health);
-       addstat(STAT_VEHICLESTAT_SHIELD,  AS_INT, vehicle_shield);
-       addstat(STAT_VEHICLESTAT_ENERGY,  AS_INT, vehicle_energy);
-
-       addstat(STAT_VEHICLESTAT_AMMO1,   AS_INT, vehicle_ammo1);
-       addstat(STAT_VEHICLESTAT_RELOAD1, AS_INT, vehicle_reload1);
-
-       addstat(STAT_VEHICLESTAT_AMMO2,   AS_INT, vehicle_ammo2);
-       addstat(STAT_VEHICLESTAT_RELOAD2, AS_INT, vehicle_reload2);
-
-    if(bodymodel == "")
-        error("vehicles: missing bodymodel!");
-
-    if(hudmodel == "")
-        error("vehicles: missing hudmodel!");
-
-    if(net_name == "")
-        self.netname = self.classname;
-    else
-        self.netname = net_name;
-
-    if(self.team && !teamplay)
-        self.team = 0;
-
-    self.vehicle_flags |= VHF_ISVEHICLE;
-
-    setmodel(self, bodymodel);
-
-    self.vehicle_viewport   = spawn();
-    self.vehicle_hudmodel   = spawn();
-    self.tur_head           = spawn();
-    self.tur_head.owner     = self;
-    self.takedamage         = DAMAGE_AIM;
-    self.bot_attack         = true;
-    self.iscreature         = true;
-    self.teleportable       = false; // no teleporting for vehicles, too buggy
-    self.damagedbycontents     = true;
-    self.hud                = vhud;
-    self.tur_health          = _max_health;
-    self.tur_head.tur_health = _max_shield;
-    self.vehicle_die         = dieproc;
-    self.vehicle_exit        = exitfunc;
-    self.vehicle_enter       = enterproc;
-    self.PlayerPhysplug      = physproc;
-    self.event_damage        = func_null;
-    self.touch               = vehicles_touch;
-    self.think               = vehicles_spawn;
-    self.vehicle_spawn       = spawnproc;
-       self.vehicle_respawntime = max(0, _respawntime);
-    self.effects             = EF_NODRAW;
-       self.dphitcontentsmask   = DPCONTENTS_BODY | DPCONTENTS_SOLID;
-       if(!autocvar_g_vehicles_delayspawn || !self.vehicle_respawntime)
-               self.nextthink = time;
-       else
-               self.nextthink = max(time, game_starttime) + max(0, self.vehicle_respawntime + ((random() * 2 - 1) * autocvar_g_vehicles_delayspawn_jitter));
-
-       if(autocvar_g_playerclip_collisions)
-               self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
-
-    if(autocvar_g_nodepthtestplayers)
-        self.effects = self.effects | EF_NODEPTHTEST;
-
-    if(autocvar_g_fullbrightplayers)
-        self.effects = self.effects | EF_FULLBRIGHT;
-
-    setmodel(self.vehicle_hudmodel, hudmodel);
-    setmodel(self.vehicle_viewport, "null");
-
-    if(topmodel != "")
-    {
-        setmodel(self.tur_head, topmodel);
-        setattachment(self.tur_head, self, toptag);
-        setattachment(self.vehicle_hudmodel, self.tur_head, hudtag);
-        setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
-    }
-    else
-    {
-        setattachment(self.tur_head, self, "");
-        setattachment(self.vehicle_hudmodel, self, hudtag);
-        setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
-    }
-
-    setsize(self, min_s, max_s);
-    if (!nodrop)
-    {
-        setorigin(self, self.origin);
-        tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
-        setorigin(self, trace_endpos);
-    }
-
-    self.pos1 = self.origin;
-    self.pos2 = self.angles;
-    self.tur_head.team = self.team;
-
-       if(MUTATOR_CALLHOOK(VehicleSpawn))
-               return false;
-
-    return true;
-}
-
-vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
-                         float _pichlimit_min, float _pichlimit_max,
-                         float _rotlimit_min, float _rotlimit_max, float _aimspeed)
-{
-    vector vtmp, vtag;
-    float ftmp;
-    vtag = gettaginfo(_turrret, gettagindex(_turrret, _tagname));
-    vtmp = vectoangles(normalize(_target - vtag));
-    vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles;
-    vtmp = AnglesTransform_Normalize(vtmp, true);
-    ftmp = _aimspeed * frametime;
-    vtmp.y = bound(-ftmp, vtmp.y, ftmp);
-    vtmp.x = bound(-ftmp, vtmp.x, ftmp);
-    _turrret.angles_y = bound(_rotlimit_min, _turrret.angles.y + vtmp.y, _rotlimit_max);
-    _turrret.angles_x = bound(_pichlimit_min, _turrret.angles.x + vtmp.x, _pichlimit_max);
-    return vtag;
-}
-
-void vehicles_gib_explode()
-{
-       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
-       pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
-       remove(self);
-}
-
-void vehicles_gib_think()
-{
-       self.alpha -= 0.1;
-       if(self.cnt >= time)
-               remove(self);
-       else
-               self.nextthink = time + 0.1;
-}
-
-entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot)
-{
-       entity _gib = spawn();
-       setmodel(_gib, _template.model);
-       setorigin(_gib, gettaginfo(self, gettagindex(self, _tag)));
-       _gib.velocity = _vel;
-       _gib.movetype = MOVETYPE_TOSS;
-       _gib.solid = SOLID_CORPSE;
-       _gib.colormod = '-0.5 -0.5 -0.5';
-       _gib.effects = EF_LOWPRECISION;
-       _gib.avelocity = _rot;
-
-       if(_burn)
-               _gib.effects |= EF_FLAME;
-
-       if(_explode)
-       {
-               _gib.think = vehicles_gib_explode;
-               _gib.nextthink = time + random() * _explode;
-               _gib.touch = vehicles_gib_explode;
-       }
-       else
-       {
-               _gib.cnt = time + _maxtime;
-               _gib.think = vehicles_gib_think;
-               _gib.nextthink = time + _maxtime - 1;
-               _gib.alpha = 1;
-       }
-       return _gib;
-}
-
-/*
-vector predict_target(entity _targ, vector _from, float _shot_speed)
-{
-    float i;                // loop
-    float _distance;        // How far to target
-    float _impact_time;     // How long untill projectile impacts
-    vector _predict_pos;    // Predicted enemy location
-    vector _original_origin;// Where target is before predicted
-
-     _original_origin = real_origin(_targ); // Typicaly center of target BBOX
-
-    _predict_pos = _original_origin;
-    for(i = 0; i < 4; ++i)  // Loop a few times to increase prediction accuracy (increase loop count if accuracy is to low)
-    {
-        _distance = vlen(_predict_pos - _from); // Get distance to previos predicted location
-        _impact_time = _distance / _shot_speed; // Calculate impact time
-        _predict_pos = _original_origin + _targ.velocity * _impact_time; // Calculate new predicted location
-    }
-
-    return _predict_pos;
-}
-*/
diff --git a/qcsrc/server/vehicles/vehicles.qh b/qcsrc/server/vehicles/vehicles.qh
deleted file mode 100644 (file)
index e6b9760..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef VEHICLES_H
-#define VEHICLES_H
-
-#ifdef VEHICLES_ENABLED
-#include "vehicles.qc"
-
-#include "racer.qc"
-#include "spiderbot.qc"
-#include "raptor.qc"
-#ifndef VEHICLES_NO_UNSTABLE
-#include "bumblebee.qc"
-#endif
-#endif
-#endif
diff --git a/qcsrc/server/vehicles/vehicles_def.qh b/qcsrc/server/vehicles/vehicles_def.qh
deleted file mode 100644 (file)
index 080f891..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef VEHICLES_DEF_H
-#define VEHICLES_DEF_H
-
-#include "../tturrets/include/turrets_early.qh"
-
-// #define VEHICLES_USE_ODE
-#define VEHICLES_ENABLED
-#ifdef VEHICLES_ENABLED
-
-.int vehicle_flags;
-const int VHF_ISVEHICLE     = 2;    /// Indicates vehicle
-const int VHF_HASSHIELD     = 4;    /// Vehicle has shileding
-const int VHF_SHIELDREGEN   = 8;    /// Vehicles shield regenerates
-const int VHF_HEALTHREGEN   = 16;   /// Vehicles health regenerates
-const int VHF_ENERGYREGEN   = 32;   /// Vehicles energy regenerates
-const int VHF_DEATHEJECT    = 64;   /// Vehicle ejects pilot upon fatal damage
-const int VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
-const int VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound
-const int VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
-const int VHF_DMGSHAKE      = 1024; /// Add random velocity each frame if health < 50%
-const int VHF_DMGROLL       = 2048; /// Add random angles each frame if health < 50%
-const int VHF_DMGHEADROLL   = 4096; /// Add random head angles each frame if health < 50%
-const int VHF_MULTISLOT     = 8192; /// Vehicle has multiple player slots
-const int VHF_PLAYERSLOT    = 16384;    /// This ent is a player slot on a multi-person vehicle
-
-.entity gun1;
-.entity gun2;
-.entity gun3;
-.entity vehicle_shieldent;  /// Entity to disply the shild effect on damage
-.entity vehicle;
-.entity vehicle_viewport;
-.entity vehicle_hudmodel;
-.entity vehicle_controller;
-
-.entity gunner1;
-.entity gunner2;
-
-.float vehicle_health;      /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
-.float vehicle_energy;      /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
-.float vehicle_shield;      /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
-
-.float vehicle_ammo1;   /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
-.float vehicle_reload1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload1 value.
-.float vehicle_ammo2;   /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo2 value.
-.float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
-
-.float sound_nexttime;
-const float VOL_VEHICLEENGINE = 1;
-
-.float hud;
-.float dmg_time;
-.float  vehicle_respawntime;
-//.void() vehicle_spawn;
-
-void vehicles_exit(float eject);
-.void(float exit_flags) vehicle_exit;
-const float VHEF_NORMAL = 0;  /// User pressed exit key
-const float VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
-const float VHEF_RELESE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
-
-const float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
-const float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
-const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
-
-.void() vehicle_enter;  /// Vehicles custom funciton to be executed when owner exit it
-.void() vehicle_die;    /// Vehicles custom function to be executed when vehile die
-const float VHSF_NORMAL = 0;
-const float VHSF_FACTORY = 2;
-.void(float _spawnflag) vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
-.float(float _imp) vehicles_impulse;
-.float vehicle_weapon2mode = volly_counter;
-
-#ifdef VEHICLES_USE_ODE
-void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
-void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
-void(entity e, vector torque) physics_addtorque = #542; // add relative torque
-#endif  // VEHICLES_USE_ODE
-#endif  // VEHICLES_ENABLED
-#endif
index 02ebdec920562847fb780067d94da3a9c36267df..d7b637d0ce03fcefaabe35d6fbce6a6441b3d997 100644 (file)
@@ -374,11 +374,11 @@ entity WaypointSprite_Spawn(
        wp.team = t;
        wp.owner = own;
        wp.currentammo = hideable;
-       if(own)
+       if (own)
        {
-               if(own.ownfield)
-                       remove(own.ownfield);
-               own.ownfield = wp;
+               if (own.(ownfield))
+                       remove(own.(ownfield));
+               own.(ownfield) = wp;
                wp.owned_by_field = ownfield;
        }
        wp.fade_rate = maxdistance;
index 2557d10d1599d1a3eec2a32457387b4f84048841..bfa18464f0a998790108c4d274726b2a67bcc23d 100644 (file)
@@ -1,17 +1,11 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "accuracy.qh"
-    #include "../autocvars.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../mutators/mutators_include.qh"
-#endif
+#include "accuracy.qh"
+#include "../_all.qh"
+
+#include "../mutators/mutators_include.qh"
+#include "../../common/constants.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
 
 float accuracy_byte(float n, float d)
 {
index 5125410b9fa4b7cf2cc26b252bdad5ea13be6478..a837b2e47fd5f00c917943b95883d91d56f80449 100644 (file)
@@ -1,17 +1,12 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "common.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../../common/deathtypes.qh"
-#endif
+#include "common.qh"
+#include "../_all.qh"
+
+#include "../t_items.qh"
+#include "../../common/constants.qh"
+#include "../../common/deathtypes.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
 
 void W_GiveWeapon (entity e, float wep)
 {
index 133e92d3fc9e529cdbe990dea1e7ee2154c749fa..fef16a833b48ab9fa9add93bf1b8de5fc7e715f3 100644 (file)
@@ -1,15 +1,12 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "csqcprojectile.qh"
-    #include "../t_items.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../command/common.qh"
-#endif
+#include "csqcprojectile.qh"
+#include "../_all.qh"
+
+#include "../t_items.qh"
+
+#include "../command/common.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/weapons/weapons.qh"
 
 .float csqcprojectile_type;
 
index ec1004cd1dfc2c57d24545332853b7e030954499..c93b319530b5df6407d9453a895b3e7106d553da 100644 (file)
@@ -1,14 +1,9 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "hitplot.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../antilag.qh"
-#endif
+#include "hitplot.qh"
+#include "../_all.qh"
+
+#include "../antilag.qh"
+#include "../g_subs.qh"
+#include "../../common/weapons/weapons.qh"
 
 vector W_HitPlotUnnormalizedUntransform(vector screenforward, vector screenright, vector screenup, vector v)
 {
index 5ea0a5d9d842c8690cdf979cd7a9c717e5439477..da9b00a184e218338bad00edef85439f52f86c4f 100644 (file)
@@ -1,17 +1,12 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "selection.qh"
-    #include "weaponsystem.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-#endif
+#include "selection.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../t_items.qh"
+#include "../waypointsprites.qh"
+#include "../../common/constants.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
 
 // switch between weapons
 void Send_WeaponComplain(entity e, float wpn, float type)
index ea62fcf19eba9c05d08169e827357b879ef3ba9a..9d46475af52c6cc4096224e8a4fb3a3c5156790d 100644 (file)
@@ -1,17 +1,10 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "spawning.qh"
-    #include "weaponsystem.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../mutators/mutators_include.qh"
-#endif
+#include "spawning.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../mutators/mutators_include.qh"
+#include "../t_items.qh"
+#include "../../common/weapons/weapons.qh"
 
 string W_Apply_Weaponreplace(string in)
 {
index 6b47a88227fb65a344588de7a96a3459e5e76c73..6b549993ab1a90f999899a247cd4b00f2f2e7d9f 100644 (file)
@@ -1,20 +1,15 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "throwing.qh"
-    #include "weaponsystem.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../constants.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../../common/mapinfo.qh"
-#endif
+#include "throwing.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../mutators/mutators_include.qh"
+#include "../t_items.qh"
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
 
 void thrown_wep_think()
 {
@@ -40,7 +35,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        entity oldself, wep;
        float thisammo, i;
        string s;
-       var .float ammotype = (get_weaponinfo(wpn)).ammo_field;
+       var .int ammotype = (get_weaponinfo(wpn)).ammo_field;
 
        wep = spawn();
 
@@ -107,24 +102,24 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                        // if our weapon is loaded, give its load back to the player
                        if(self.(weapon_load[self.weapon]) > 0)
                        {
-                               own.ammotype += self.(weapon_load[self.weapon]);
+                               own.(ammotype) += self.(weapon_load[self.weapon]);
                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                        }
 
-                       wep.ammotype = 0;
+                       wep.(ammotype) = 0;
                }
                else if(doreduce)
                {
                        // if our weapon is loaded, give its load back to the player
                        if(self.(weapon_load[self.weapon]) > 0)
                        {
-                               own.ammotype += self.(weapon_load[self.weapon]);
+                               own.(ammotype) += self.(weapon_load[self.weapon]);
                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                        }
 
-                       thisammo = min(own.ammotype, wep.ammotype);
-                       wep.ammotype = thisammo;
-                       own.ammotype -= thisammo;
+                       thisammo = min(own.(ammotype), wep.(ammotype));
+                       wep.(ammotype) = thisammo;
+                       own.(ammotype) -= thisammo;
 
                        switch(ammotype)
                        {
index 1621f8e8e20205aa7cd1f30779aa90d11e6400d5..2a3181d1b2d3987ccf529a964038db1039214035 100644 (file)
@@ -1,17 +1,20 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../warpzonelib/common.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "tracing.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../antilag.qh"
-#endif
+#include "tracing.qh"
+#include "../_all.qh"
+
+#include "accuracy.qh"
+#include "common.qh"
+#include "hitplot.qh"
+
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../antilag.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/util.qh"
+
+#include "../../common/weapons/weapons.qh"
+
+#include "../../warpzonelib/common.qh"
 
 // this function calculates w_shotorg and w_shotdir based on the weapon model
 // offset, trueaim and antilag, and won't put w_shotorg inside a wall.
index 64fdc5bb30faddb767064c406780ec6758dcdd13..fb668ae7c52b7ce0391cae62316518580cf260a0 100644 (file)
@@ -1,14 +1,10 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-       #include "../../dpdefs/dpextensions.qh"
-       #include "../../common/urllib.qh"
-       #include "../../common/weapons/weapons.qh"
-       #include "weaponstats.qh"
-       #include "../autocvars.qh"
-       #include "../defs.qh"
-#endif
+#include "weaponstats.qh"
+#include "../_all.qh"
+
+#include "../g_world.qh"
+
+#include "../../common/urllib.qh"
+#include "../../common/weapons/weapons.qh"
 
 void WeaponStats_Init()
 {
index ab85389c5c9dc675e84f4917e21a6c08cf47eb03..accf5b2f0fab1681c4eacdd456e5edc075e2079e 100644 (file)
@@ -1,23 +1,19 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
-    #include "../../common/constants.qh"
-    #include "../../common/util.qh"
-    #include "../../common/animdecide.qh"
-    #include "../../common/monsters/monsters.qh"
-    #include "../../common/weapons/weapons.qh"
-    #include "weaponsystem.qh"
-    #include "../t_items.qh"
-    #include "../autocvars.qh"
-    #include "../defs.qh"
-    #include "../../common/notifications.qh"
-    #include "../mutators/mutators_include.qh"
-    #include "../command/common.qh"
-    #include "../../csqcmodellib/sv_model.qh"
-    #include "../round_handler.qh"
-#endif
+#include "weaponsystem.qh"
+#include "../_all.qh"
+
+#include "selection.qh"
+
+#include "../command/common.qh"
+#include "../mutators/mutators_include.qh"
+#include "../round_handler.qh"
+#include "../t_items.qh"
+#include "../../common/animdecide.qh"
+#include "../../common/constants.qh"
+#include "../../common/monsters/monsters.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
+#include "../../csqcmodellib/sv_model.qh"
 
 /*
 ===========================================================================
diff --git a/qcsrc/test/compilationunit.sh b/qcsrc/test/compilationunit.sh
new file mode 100755 (executable)
index 0000000..e4f3878
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -eu
+cd "$(dirname "$0")"
+cd ..
+
+declare -a NOWARN=(
+  '-Wno-field-redeclared'
+  '-Wno-unused-variable'
+  '-Wno-implicit-function-pointer'
+)
+declare -a FEATURES=(
+  '-DVEHICLES_ENABLED=1'
+  '-DVEHICLES_USE_ODE=0'
+)
+declare QCC=../../../gmqcc/gmqcc
+
+function check() {
+  declare -l base="$1"
+  declare -la predefs=("${!2}")
+  find "$base" -type f -name '*.qc' -print0 | sort -z | while IFS= read -r -d '' file; do
+    echo "$file"
+    ${QCC} -std=gmqcc -fftepp -fftepp-predefs -Werror -Wall "${NOWARN[@]}" "${FEATURES[@]}" -futf8 -O3 "${predefs[@]}" "$file" >/dev/null
+  done
+}
+
+clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh")
+check "client" clientdefs[@]
+
+serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh")
+check "server" serverdefs[@]
+
+menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh")
+check "menu" menudefs[@]
index e8a455b6ee25548bf67e22c68c15fd3e1626089d..079ceaa7d1a5577a4e5326b873da4788842430b0 100644 (file)
@@ -1,11 +1,11 @@
+#include "anglestransform.qh"
+
 #if defined(CSQC)
        #include "../dpdefs/csprogsdefs.qh"
-       #include "anglestransform.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
        #include "../dpdefs/progsdefs.qh"
     #include "../dpdefs/dpextensions.qh"
-    #include "anglestransform.qh"
 #endif
 
 #ifdef POSITIVE_PITCH_IS_DOWN
index 5c2609a7dfbd388d8cb1b1172974b74fd8dbbd5a..e0bb6434584efb034b554b9985febc3ff39a8280 100644 (file)
@@ -1,9 +1,10 @@
+#include "client.qh"
+#include "common.qh"
+
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "common.qh"
-       #include "client.qh"
        #include "../client/autocvars.qh"
        #include "../csqcmodellib/cl_model.qh"
+       #include "../dpdefs/csprogsdefs.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
 #endif
index aa0de911963a9bc700e6aa3167b2181633d7b7b6..0734811c181108981470782c4fe31fd929c15188 100644 (file)
@@ -1,13 +1,13 @@
+#include "common.qh"
+
 #if defined(CSQC)
        #include "../dpdefs/csprogsdefs.qh"
-    #include "common.qh"
     #include "../server/t_items.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "common.qh"
     #include "../common/weapons/weapons.qh"
+    #include "../dpdefs/dpextensions.qh"
+       #include "../dpdefs/progsdefs.qh"
 #endif
 
 void WarpZone_Accumulator_Clear(entity acc)
index c9cde9072c34210fb2f387f137569dfa35f71d9e..395547036ceb8fa24e6045f3d1aec5b4cb4f8c6a 100644 (file)
@@ -1,11 +1,10 @@
+#include "mathlib.qh"
 #if defined(CSQC)
        #include "../dpdefs/csprogsdefs.qh"
-    #include "mathlib.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
     #include "../dpdefs/dpextensions.qh"
-    #include "mathlib.qh"
+       #include "../dpdefs/progsdefs.qh"
 #endif
 
 int fpclassify(float x)
index ddd494de5b8422e5560cb68301d5fada7b43d73d..a09bdce42810e0f18ee305bf39bb71c8dd959c2d 100644 (file)
@@ -104,7 +104,8 @@ const float M_LOG2E    = 1.4426950408889634074;   /* log_2 e */
 const float M_LOG10E   = 0.43429448190325182765;  /* log_10 e */
 const float M_LN2      = 0.69314718055994530942;  /* log_e 2 */
 const float M_LN10     = 2.30258509299404568402;  /* log_e 10 */
-const float M_PI       = 3.14159265358979323846;  /* pi */
+// -Wdouble-declaration
+#define M_PI             3.14159265358979323846   /* pi */
 const float M_PI_2     = 1.57079632679489661923;  /* pi/2 */
 const float M_PI_4     = 0.78539816339744830962;  /* pi/4 */
 const float M_1_PI     = 0.31830988618379067154;  /* 1/pi */
index a9380070b7f7f77d57bca408ad03ba5c648bcc0d..bd6266ea0ca008f8141244638a2bd1ee4b6043e5 100644 (file)
@@ -1,15 +1,16 @@
+#include "server.qh"
+
+#include "common.qh"
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-       #include "../dpdefs/dpextensions.qh"
-       #include "common.qh"
-       #include "server.qh"
        #include "../common/constants.qh"
        #include "../common/util.qh"
+       #include "../dpdefs/dpextensions.qh"
+       #include "../dpdefs/progsdefs.qh"
+       #include "../server/command/common.qh"
        #include "../server/constants.qh"
        #include "../server/defs.qh"
-       #include "../server/command/common.qh"
 #endif
 
 #ifdef WARPZONELIB_KEEPDEBUG
index b94eafbdafd4e422af7dd6eb5c31933156dbb988..e82c4ba6e212b41a25714f457448382ca4b95cb8 100644 (file)
@@ -1,11 +1,13 @@
+#include "util_server.qh"
+
+#include "common.qh"
+
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "common.qh"
-    #include "util_server.qh"
     #include "../csqcmodellib/sv_model.qh"
+    #include "../dpdefs/dpextensions.qh"
+       #include "../dpdefs/progsdefs.qh"
 #endif
 
 void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)