1 // --------------------------------------------------------------------------
2 // BEGIN REQUIRED CSQC FUNCTIONS
5 #define DP_CSQC_ENTITY_REMOVE_IS_B0RKED
7 void cvar_clientsettemp(string cv, string val)
10 for(e = world; (e = find(e, classname, "saved_cvar_value")); )
14 e.classname = "saved_cvar_value";
15 e.netname = strzone(cv);
16 e.message = strzone(cvar_string(cv));
21 void cvar_clientsettemp_restore()
24 for(e = world; (e = find(e, classname, "saved_cvar_value")); )
25 cvar_set(e.netname, e.message);
28 void() menu_show_error =
30 drawstring('0 200 0', "ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!", '8 8 0', '1 0 0', 1, 0);
33 // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
34 // Useful for precaching things
36 void() menu_sub_null =
45 void WaypointSprite_Load();
50 __engine_check = checkextension("DP_SV_WRITEPICTURE");
53 print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n");
54 localcmd("\ndisconnect\n");
60 check_unacceptable_compiler_bugs();
68 compressShortVector_init();
72 menu_show = menu_show_error;
73 menu_action = menu_sub_null;
75 for(i = 0; i < 255; ++i)
76 if(getplayerkey(i, "viewentity") == "")
81 // localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
82 //registercmd("ctf_menu");
83 registercmd("ons_map");
84 //registercmd("menu_action");
86 registercmd("+button3");
87 registercmd("-button3");
88 registercmd("+button4");
89 registercmd("-button4");
90 registercmd("+showaccuracy");registercmd("-showaccuracy");
96 registercmd("+forward");registercmd("-forward");
97 registercmd("+back");registercmd("-back");
98 registercmd("+moveup");registercmd("-moveup");
99 registercmd("+movedown");registercmd("-movedown");
100 registercmd("+moveright");registercmd("-moveright");
101 registercmd("+moveleft");registercmd("-moveleft");
102 registercmd("+roll_right");registercmd("-roll_right");
103 registercmd("+roll_left");registercmd("-roll_left");
107 registercvar("sbar_usecsqc", "1");
108 registercvar("sbar_columns", "default", CVAR_SAVE);
112 // sbar_fields uses strunzone on the titles!
113 for(i = 0; i < MAX_SBAR_FIELDS; ++i)
114 sbar_title[i] = strzone("(null)");
118 teams = Sort_Spawn();
119 players = Sort_Spawn();
121 GetTeam(COLOR_SPECTATOR, true); // add specs first
123 cvar_clientsettemp("_supports_weaponpriority", "1");
127 WaypointSprite_Load();
129 Projectile_Precache();
130 GibSplash_Precache();
132 DamageInfo_Precache();
133 Announcer_Precache();
135 get_mi_min_max_texcoords(1); // try the CLEVER way first
136 minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
137 shortmapname = mi_shortname;
139 if(precache_pic(minimapname) == "")
141 // but maybe we have a non-clever minimap
142 minimapname = strcat("gfx/", mi_shortname, "_mini.tga");
143 if(precache_pic(minimapname) == "")
144 minimapname = ""; // FAIL
146 get_mi_min_max_texcoords(0); // load new texcoords
149 mi_center = (mi_min + mi_max) * 0.5;
150 mi_scale = mi_max - mi_min;
151 minimapname = strzone(minimapname);
154 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
155 void CSQC_Shutdown(void)
169 cvar_clientsettemp_restore();
172 cvar_set("chase_active",ftos(chase_active_backup));
176 float SetTeam(entity o, float Team)
186 case COLOR_SPECTATOR:
189 print("trying to switch to unsupported team ", ftos(Team), "\n");
190 Team = COLOR_SPECTATOR;
193 if(Team == -1) // leave
197 //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
198 tm = GetTeam(o.team, false);
208 //print("(CONNECT) enter team ", ftos(o.team), "\n");
210 tm = GetTeam(Team, true);
215 else if(Team != o.team)
217 //print("(CHANGE) leave team ", ftos(o.team), "\n");
218 tm = GetTeam(o.team, false);
221 //print("(CHANGE) enter team ", ftos(o.team), "\n");
222 tm = GetTeam(Team, true);
230 void Playerchecker_Think()
234 for(i = 0; i < maxclients; ++i)
237 if(GetPlayerName(i) == "")
241 //print("playerchecker: KILL KILL KILL\n");
242 // player disconnected
253 //print("playerchecker: SPAWN SPAWN SPAWN\n");
256 playerslots[i] = e = spawn();
258 //e.gotscores = 0; // we might already have the scores...
259 SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
261 Sbar_UpdatePlayerPos(e);
265 self.nextthink = time + 0.2;
272 print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
273 localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n"));
275 entity playerchecker;
276 playerchecker = spawn();
277 playerchecker.think = Playerchecker_Think;
278 playerchecker.nextthink = time + 0.2;
286 // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
287 // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
289 void Cmd_Sbar_SetFields(float);
290 void Cmd_Sbar_Help(float);
291 float CSQC_ConsoleCommand(string strMessage)
295 //argc = tokenize(strMessage);
296 argc = tokenize_console(strMessage);
302 if(strCmd == "+button4") { // zoom
303 // return false, because the message shall be sent to the server anyway (for demos/speccing)
311 } else if(strCmd == "-button4") { // zoom
312 if(ignore_minus_zoom)
319 } else if(strCmd == "+button3") { // secondary
322 } else if(strCmd == "-button3") { // secondary
325 } else if(strCmd == "+showscores") {
326 sb_showscores = true;
328 } else if(strCmd == "-showscores") {
329 sb_showscores = false;
331 } else if(strCmd == "+showaccuracy") {
332 sb_showaccuracy = true;
334 } else if(strCmd == "-showaccuracy") {
335 sb_showaccuracy = false;
340 if(strCmd == "+forward" || strCmd == "-back") {
341 ++camera_direction_x;
343 } else if(strCmd == "-forward" || strCmd == "+back") {
344 --camera_direction_x;
346 } else if(strCmd == "+moveright" || strCmd == "-moveleft") {
347 --camera_direction_y;
349 } else if(strCmd == "-moveright" || strCmd == "+moveleft") {
350 ++camera_direction_y;
352 } else if(strCmd == "+moveup" || strCmd == "-movedown") {
353 ++camera_direction_z;
355 } else if(strCmd == "-moveup" || strCmd == "+movedown") {
356 --camera_direction_z;
358 } else if(strCmd == "+roll_right" || strCmd == "-roll_left") {
361 } else if(strCmd == "+roll_left" || strCmd == "-roll_right") {
370 entity debug_shotorg;
373 self.origin = view_origin + view_forward * self.view_ofs_x + view_right * self.view_ofs_y + view_up * self.view_ofs_z;
374 self.angles = view_angles;
375 self.angles_x = -self.angles_x;
379 void ShotOrg_Draw2D()
381 vector coord2d_topleft, coord2d_topright, coord2d;
385 s = vtos(self.view_ofs);
386 s = substring(s, 1, strlen(s) - 2);
387 if(tokenize_console(s) == 3)
388 s = strcat(argv(0), " ", argv(1), " ", argv(2));
390 coord2d_topleft = project_3d_to_2d(self.origin + view_up * 4 - view_right * 4);
391 coord2d_topright = project_3d_to_2d(self.origin + view_up * 4 + view_right * 4);
393 fs = '1 1 0' * ((coord2d_topright_x - coord2d_topleft_x) / stringwidth(s, FALSE));
395 coord2d = coord2d_topleft;
398 coord2d_x += (coord2d_topright_x - coord2d_topleft_x) * (1 - 8 / fs_x) * 0.5;
403 drawstring(coord2d, s, fs, '1 1 1', 1, 0);
408 debug_shotorg = spawn();
409 debug_shotorg.draw = ShotOrg_Draw;
410 debug_shotorg.draw2d = ShotOrg_Draw2D;
411 debug_shotorg.renderflags = RF_VIEWMODEL;
412 debug_shotorg.effects = EF_FULLBRIGHT;
413 precache_model("models/shotorg_adjuster.md3");
414 setmodel(debug_shotorg, "models/shotorg_adjuster.md3");
415 debug_shotorg.scale = 2;
416 debug_shotorg.view_ofs = '25 8 -8';
419 void GameCommand(string msg)
422 argc = tokenize_console(msg);
424 if(argv(0) == "help" || argc == 0)
426 print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
427 print(" settemp cvar value\n");
429 print(" sbar_columns_set ...\n");
430 print(" sbar_columns_help\n");
431 GameCommand_Generic("help");
435 if(GameCommand_Generic(msg))
440 if(cmd == "mv_download") {
441 Cmd_MapVote_MapDownload(argc);
443 else if(cmd == "settemp") {
444 cvar_clientsettemp(argv(1), argv(2));
446 else if(cmd == "radar") {
447 ons_showmap = !ons_showmap;
449 else if(cmd == "sbar_columns_set") {
450 Cmd_Sbar_SetFields(argc);
452 else if(cmd == "sbar_columns_help") {
456 else if(cmd == "blurtest") {
457 blurtest_time0 = time;
458 blurtest_time1 = time + stof(argv(1));
459 blurtest_radius = stof(argv(2));
460 blurtest_power = stof(argv(3));
463 else if(cmd == "shotorg_move") {
467 debug_shotorg.view_ofs = debug_shotorg.view_ofs + stov(argv(1));
468 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
470 else if(cmd == "shotorg_movez") {
474 debug_shotorg.view_ofs = debug_shotorg.view_ofs + stof(argv(1)) * (debug_shotorg.view_ofs * (1 / debug_shotorg.view_ofs_x)); // closer/farther, same xy pos
475 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
477 else if(cmd == "shotorg_set") {
481 debug_shotorg.view_ofs = stov(argv(1));
482 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
484 else if(cmd == "shotorg_setz") {
488 debug_shotorg.view_ofs = debug_shotorg.view_ofs * (stof(argv(1)) / debug_shotorg.view_ofs_x); // closer/farther, same xy pos
489 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
491 else if(cmd == "shotorg_toggle_hide") {
494 debug_shotorg.cnt = !debug_shotorg.cnt;
497 else if(cmd == "shotorg_end") {
500 print(vtos(debug_shotorg.view_ofs), "\n");
501 remove(debug_shotorg);
502 debug_shotorg = world;
504 localcmd("sv_cmd debug_shotorg\n");
508 print("Invalid command. For a list of supported commands, try cl_cmd help.\n");
514 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
515 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
516 // All keys are in ascii.
517 // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
518 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
519 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
520 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
522 local float bSkipKey;
526 if(menu_action(bInputType, nPrimary, nSecondary))
531 // END REQUIRED CSQC FUNCTIONS
532 // --------------------------------------------------------------------------
534 // --------------------------------------------------------------------------
535 // BEGIN OPTIONAL CSQC FUNCTIONS
538 InterpolateOrigin_Undo();
540 self.classname = "entcs_receiver";
541 self.sv_entnum = ReadByte() - 1;
542 self.origin_x = ReadShort();
543 self.origin_y = ReadShort();
544 self.origin_z = ReadShort();
545 self.angles_y = ReadByte() * 360.0 / 256;
546 self.origin_z = self.angles_x = self.angles_z = 0;
548 InterpolateOrigin_Note();
553 void Ent_RemovePlayerScore()
559 SetTeam(self.owner, -1);
560 self.owner.gotscores = 0;
561 for(i = 0; i < MAX_SCORE; ++i)
562 self.owner.(scores[i]) = 0; // clear all scores
566 void Ent_ReadPlayerScore()
572 // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN
573 // (no I've never heard of M-x replace-string, sed, or anything like that)
574 isNew = !self.owner; // workaround for DP bug
577 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
578 if(!isNew && n != self.sv_entnum)
580 print("A CSQC entity changed its owner!\n");
583 self.enttype = ENT_CLIENT_SCORES;
589 if not(playerslots[self.sv_entnum])
590 playerslots[self.sv_entnum] = spawn();
591 o = self.owner = playerslots[self.sv_entnum];
592 o.sv_entnum = self.sv_entnum;
595 //if not(o.sort_prev)
596 // RegisterPlayer(o);
597 //playerchecker will do this for us later, if it has not already done so
600 for(i = 0; i < MAX_SCORE; ++i)
601 o.(scores[i]) = ReadShort();
610 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
612 o.(scores[i]) = ReadShort();
616 Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
618 self.entremove = Ent_RemovePlayerScore;
621 void Ent_ReadTeamScore()
626 self.team = ReadByte();
627 o = self.owner = GetTeam(self.team, true); // these team numbers can always be trusted
629 #if MAX_TEAMSCORE <= 3
630 for(i = 0; i < MAX_TEAMSCORE; ++i)
631 o.(teamscores[i]) = ReadShort();
634 #if MAX_TEAMSCORE <= 8
640 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
642 o.(teamscores[i]) = ReadShort();
645 Sbar_UpdateTeamPos(o);
652 void Ent_ClientData()
655 float newspectatee_status;
659 sb_showscores_force = (f & 1);
663 newspectatee_status = ReadByte();
664 if(newspectatee_status == player_localentnum)
665 newspectatee_status = -1; // observing
668 newspectatee_status = 0;
670 spectatorbutton_zoom = (f & 4);
674 angles_held_status = 1;
675 angles_held_x = ReadAngle();
676 angles_held_y = ReadAngle();
680 angles_held_status = 0;
682 if(newspectatee_status != spectatee_status)
686 race_checkpointtime = 0;
688 spectatee_status = newspectatee_status;
693 float nags, i, j, b, f;
700 strunzone(vote_called_vote);
701 vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
706 for(j = 0; j < maxclients; ++j)
708 playerslots[j].ready = 1;
709 for(i = 1; i <= maxclients; i += 8)
712 for(j = i-1, b = 1; b < 256; b *= 2, ++j)
715 playerslots[j].ready = 0;
719 ready_waiting = (nags & 1);
720 ready_waiting_for_me = (nags & 2);
721 vote_waiting = (nags & 4);
722 vote_waiting_for_me = (nags & 8);
723 warmup_stage = (nags & 16);
726 void Ent_RandomSeed()
734 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
735 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
736 void Ent_RadarLink();
738 void Ent_ScoresInfo();
739 void(float bIsNewEntity) CSQC_Ent_Update =
745 // set up the "time" global for received entities to be correct for interpolation purposes
753 serverprevtime = time;
754 serverdeltatime = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE);
755 time = serverprevtime + serverdeltatime;
758 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
760 if(t != self.enttype)
762 print("A CSQC entity changed its type!\n");
769 case ENT_CLIENT_ENTCS: Ent_ReadEntCS(); break;
770 case ENT_CLIENT_SCORES: Ent_ReadPlayerScore(); break;
771 case ENT_CLIENT_TEAMSCORES: Ent_ReadTeamScore(); break;
772 case ENT_CLIENT_POINTPARTICLES: Ent_PointParticles(); break;
773 case ENT_CLIENT_RAINSNOW: Ent_RainOrSnow(); break;
774 case ENT_CLIENT_LASER: Ent_Laser(); break;
775 case ENT_CLIENT_NAGGER: Ent_Nagger(); break;
776 case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break;
777 case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break;
778 case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
779 case ENT_CLIENT_GIBSPLASH: Ent_GibSplash(); break;
780 case ENT_CLIENT_DAMAGEINFO: Ent_DamageInfo(); break;
781 case ENT_CLIENT_CASING: Ent_Casing(); break;
782 case ENT_CLIENT_INIT: Ent_Init(); break;
783 case ENT_CLIENT_SCORES_INFO: Ent_ScoresInfo(); break;
784 case ENT_CLIENT_MAPVOTE: Ent_MapVote(); break;
785 case ENT_CLIENT_CLIENTDATA: Ent_ClientData(); break;
786 case ENT_CLIENT_RANDOMSEED: Ent_RandomSeed(); break;
787 case ENT_CLIENT_WALL: Ent_Wall(); break;
789 error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
795 // Destructor, but does NOT deallocate the entity by calling remove(). Also
796 // used when an entity changes its type. For an entity that someone interacts
797 // with others, make sure it can no longer do so.
805 self.draw = menu_sub_null;
806 self.entremove = menu_sub_null;
807 // TODO possibly set more stuff to defaults
809 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
810 void CSQC_Ent_Remove()
819 if(gametype == GAME_ONSLAUGHT) {
820 print(strcat("Using ", minimapname, " as minimap.\n"));
821 precache_pic("gfx/ons-cp-neutral.tga");
822 precache_pic("gfx/ons-cp-red.tga");
823 precache_pic("gfx/ons-cp-blue.tga");
824 precache_pic("gfx/ons-frame.tga");
825 precache_pic("gfx/ons-frame-team.tga");
826 } else if(gametype == GAME_KEYHUNT) {
827 precache_pic("gfx/sb_key_carrying");
828 precache_pic("gfx/sb_key_carrying_outline");
831 // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided. To execute standard behavior, simply execute localcmd with the string.
832 void CSQC_Parse_StuffCmd(string strMessage)
834 localcmd(strMessage);
836 // CSQC_Parse_Print : Provides the print string in the first parameter that the server provided. To execute standard behavior, simply execute print with the string.
837 void CSQC_Parse_Print(string strMessage)
839 print(ColorTranslateRGB(strMessage));
842 // CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided.
843 void CSQC_Parse_CenterPrint(string strMessage)
845 centerprint(strMessage);
850 // TODO somehow thwart prvm_globalset client ...
853 localcmd(strcat("\nfog ", forcefog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
856 void Gamemode_Init();
857 void Ent_ScoresInfo()
860 self.classname = "ent_client_scores_info";
861 gametype = ReadByte();
862 for(i = 0; i < MAX_SCORE; ++i)
864 scores_label[i] = strzone(ReadString());
865 scores_flags[i] = ReadByte();
867 for(i = 0; i < MAX_TEAMSCORE; ++i)
869 teamscores_label[i] = strzone(ReadString());
870 teamscores_flags[i] = ReadByte();
879 self.classname = "ent_client_init";
881 nb_pb_period = ReadByte() / 32; //Accuracy of 1/32th
883 for(i = 0; i < 24; ++i)
884 weaponimpulse[i] = ReadByte() - 1;
885 hook_shotorigin_x = ReadCoord();
886 hook_shotorigin_y = ReadCoord();
887 hook_shotorigin_z = ReadCoord();
891 forcefog = strzone(ReadString());
893 armorblockpercent = ReadByte() / 255.0;
907 case RACE_NET_CHECKPOINT_HIT_QUALIFYING:
908 race_checkpoint = ReadByte();
909 race_time = ReadShort();
910 race_previousbesttime = ReadShort();
911 if(race_previousbestname)
912 strunzone(race_previousbestname);
913 race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
915 race_checkpointtime = time;
917 if(race_checkpoint == 0 || race_checkpoint == 254)
919 race_penaltyaccumulator = 0;
920 race_laptime = time; // valid
925 case RACE_NET_CHECKPOINT_CLEAR:
927 race_checkpointtime = 0;
930 case RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING:
931 race_laptime = ReadCoord();
932 race_checkpointtime = -99999;
934 case RACE_NET_CHECKPOINT_NEXT_QUALIFYING:
935 race_nextcheckpoint = ReadByte();
937 race_nextbesttime = ReadShort();
938 if(race_nextbestname)
939 strunzone(race_nextbestname);
940 race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
943 case RACE_NET_CHECKPOINT_HIT_RACE:
944 race_mycheckpoint = ReadByte();
945 race_mycheckpointtime = time;
946 race_mycheckpointdelta = ReadShort();
947 race_mycheckpointlapsdelta = ReadByte();
948 if(race_mycheckpointlapsdelta >= 128)
949 race_mycheckpointlapsdelta -= 256;
950 if(race_mycheckpointenemy)
951 strunzone(race_mycheckpointenemy);
952 race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
955 case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
956 race_othercheckpoint = ReadByte();
957 race_othercheckpointtime = time;
958 race_othercheckpointdelta = ReadShort();
959 race_othercheckpointlapsdelta = ReadByte();
960 if(race_othercheckpointlapsdelta >= 128)
961 race_othercheckpointlapsdelta -= 256;
962 if(race_othercheckpointenemy)
963 strunzone(race_othercheckpointenemy);
964 race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
967 case RACE_NET_PENALTY_RACE:
968 race_penaltyeventtime = time;
969 race_penaltytime = ReadByte();
970 //race_penaltyaccumulator += race_penaltytime;
971 if(race_penaltyreason)
972 strunzone(race_penaltyreason);
973 race_penaltyreason = strzone(ReadString());
976 case RACE_NET_PENALTY_QUALIFYING:
977 race_penaltyeventtime = time;
978 race_penaltytime = ReadByte();
979 race_penaltyaccumulator += race_penaltytime;
980 if(race_penaltyreason)
981 strunzone(race_penaltyreason);
982 race_penaltyreason = strzone(ReadString());
990 current_viewzoom = 0.6;
993 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
994 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
995 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
996 float CSQC_Parse_TempEntity()
998 local float bHandled;
1004 // NOTE: Could just do return instead of break...
1007 case TE_CSQC_PICTURE:
1008 Net_MapVote_Picture();
1016 Net_GrapplingHook();
1023 case TE_CSQC_ZCURVEPARTICLES:
1024 Net_ReadZCurveParticles();
1027 case TE_CSQC_NEXGUNBEAMPARTICLE:
1028 Net_ReadNexgunBeamParticle();
1031 case TE_CSQC_LIGHTNINGARC:
1032 Net_ReadLightningarc();
1036 // No special logic for this temporary entity; return 0 so the engine can handle it
1044 string getcommandkey(string text, string command)
1049 if (!sbar_showbinds)
1052 keys = db_get(binddb, command);
1055 n = tokenize(findkeysforcommand(command)); // uses '...' strings
1056 for(j = 0; j < n; ++j)
1062 keys = keynumtostring(k);
1064 keys = strcat(keys, ", ", keynumtostring(k));
1067 if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
1071 db_put(binddb, command, keys);
1075 if (sbar_showbinds > 1)
1076 return strcat(text, " (not bound)");
1080 else if (sbar_showbinds > 1)
1081 return strcat(text, " (", keys, ")");