void DrawDebugModel(entity this)
{
- if(time - floor(time) > 0.5)
+ if (time - floor(time) > 0.5)
{
PolyDrawModel(self);
self.drawmask = 0;
// Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
#ifdef BLURTEST
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
}
}
#else
- if(request)
+ if (request)
{
LOG_INFO("Blurtest is not enabled on this client.\n");
return;
void LocalCommand_boxparticles(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
{
int index = stoi(argv(2));
entity own;
- if(index <= 0)
+ if (index <= 0)
own = entitybyindex(-index);
else
own = findfloat(world, entnum, index);
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
void LocalCommand_create_scrshot_ent(int request)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
int fh = fopen(filename, FILE_WRITE);
- if(fh >= 0)
+ if (fh >= 0)
{
fputs(fh, "{\n");
fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
void LocalCommand_debugmodel(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
void LocalCommand_handlevote(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
int vote_selection;
string vote_string;
- if(InterpretBoolean(argv(1)))
+ if (InterpretBoolean(argv(1)))
{
vote_selection = 2;
vote_string = "yes";
vote_string = "no";
}
- if(vote_selection)
+ if (vote_selection)
{
- if(uid2name_dialog) // handled by "uid2name" option
+ if (uid2name_dialog) // handled by "uid2name" option
{
vote_active = 0;
vote_prev = 0;
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
void LocalCommand_hud(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
- switch(argv(1))
+ switch (argv(1))
{
case "configure":
{
case "quickmenu":
{
- if(QuickMenu_IsOpened())
+ if (QuickMenu_IsOpened())
QuickMenu_Close();
else
- QuickMenu_Open(argv(2), argv(3)); // mode, submenu
+ QuickMenu_Open(argv(2), argv(3)); // mode, submenu
return;
}
case "minigame":
{
- if(HUD_MinigameMenu_IsOpened())
+ if (HUD_MinigameMenu_IsOpened())
HUD_MinigameMenu_Close();
else
HUD_MinigameMenu_Open();
case "save":
{
- if(argv(2))
+ if (argv(2))
{
HUD_Panel_ExportCfg(argv(2));
return;
}
else
{
- break; // go to usage, we're missing the paramater needed here.
+ break; // go to usage, we're missing the paramater needed here.
}
}
case "radar":
{
- if(argv(2))
- HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)),0);
+ if (argv(2))
+ HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)), 0);
else
- HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
+ HUD_Radar_Show_Maximized(!hud_panel_radar_maximized, 0);
return;
}
case "clickradar":
{
- HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
+ HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
return;
}
}
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2hud^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
LOG_INFO(" 'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
LOG_INFO(" and 'layout' is how to organize the scoreboard columns for the set action.\n");
LOG_INFO(" quickmenu [[default | file | \"\"] submenu]\n");
- LOG_INFO(" Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
+ LOG_INFO(" Called without options (or with " ") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
LOG_INFO(" Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
LOG_INFO(" Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
return;
void LocalCommand_localprint(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
- if(argv(1))
+ if (argv(1))
{
centerprint_hud(argv(1));
return;
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2localprint^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
void LocalCommand_mv_download(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
- if(argv(1))
+ if (argv(1))
{
Cmd_MapVote_MapDownload(argc);
return;
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
void LocalCommand_find(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
entity client;
- for(client = world; (client = find(client, classname, argv(1))); )
+ for (client = world; (client = find(client, classname, argv(1))); )
LOG_INFO(etos(client), "\n");
return;
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2find^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
void LocalCommand_sendcvar(int request, int argc)
{
- switch(request)
+ switch (request)
{
case CMD_REQUEST_COMMAND:
{
- if(argv(1))
+ if (argv(1))
{
// W_FixWeaponOrder will trash argv, so save what we need.
string thiscvar = strzone(argv(1));
string s = cvar_string(thiscvar);
- if(thiscvar == "cl_weaponpriority")
+ if (thiscvar == "cl_weaponpriority")
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
- else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
+ else if (substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
}
default:
+ {
LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
+ }
case CMD_REQUEST_USAGE:
{
LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
void LocalCommand_(int request)
{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
-
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 cl_cmd \n");
- print(" No arguments required.\n");
- return;
- }
- }
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print("\nUsage:^3 cl_cmd \n");
+ print(" No arguments required.\n");
+ return;
+ }
+ }
}
*/
// ==================================
// Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-#define CLIENT_COMMANDS(request,arguments) \
+#define CLIENT_COMMANDS(request, arguments) \
CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
void LocalCommand_macro_help()
{
- #define CLIENT_COMMAND(name,function,description) \
- { if(strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
+ #define CLIENT_COMMAND(name, function, description) \
+ { if (strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
CLIENT_COMMANDS(0, 0);
#undef CLIENT_COMMAND
-
- return;
}
bool LocalCommand_macro_command(int argc)
{
- #define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return true; } }
+ #define CLIENT_COMMAND(name, function, description) \
+ { if (name == strtolower(argv(0))) { function; return true; } }
CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
#undef CLIENT_COMMAND
bool LocalCommand_macro_usage(int argc)
{
- #define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return true; } }
+ #define CLIENT_COMMAND(name, function, description) \
+ { if (name == strtolower(argv(1))) { function; return true; } }
CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
#undef CLIENT_COMMAND
void LocalCommand_macro_write_aliases(int fh)
{
- #define CLIENT_COMMAND(name,function,description) \
- { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
+ #define CLIENT_COMMAND(name, function, description) \
+ { if (strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
CLIENT_COMMANDS(0, 0);
#undef CLIENT_COMMAND
-
- return;
}
string s = strtolower(argv(0));
if (s == "help")
{
- if(argc == 1)
+ if (argc == 1)
{
LOG_INFO("\nClient console commands:\n");
LocalCommand_macro_help();
return;
}
- else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
+ else if (GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
{
return;
}
- else if(LocalCommand_macro_usage(argc)) // now try for normal commands too
+ else if (LocalCommand_macro_usage(argc)) // now try for normal commands too
{
return;
}
}
// continue as usual and scan for normal commands
- if (GenericCommand(command)// handled by common/command/generic.qc
- || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
- || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
- ) return;
+ if (GenericCommand(command) // handled by common/command/generic.qc
+ || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
+ || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
+ ) return;
// nothing above caught the command, must be invalid
LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
-
- return;
}
void ConsoleCommand_macro_init()
{
// first init normal commands
- #define CONSOLE_COMMAND(name,execution) \
+ #define CONSOLE_COMMAND(name, execution) \
{ registercommand(name); }
CONSOLE_COMMANDS_NORMAL();
// then init movement commands
#ifndef CAMERATEST
- if(isdemo())
+ if (isdemo())
{
#endif
- #define CONSOLE_COMMAND(name,execution) \
- { registercommand(name); }
+ #define CONSOLE_COMMAND(name, execution) \
+ registercommand(name);
- CONSOLE_COMMANDS_MOVEMENT();
+ CONSOLE_COMMANDS_MOVEMENT();
#undef CONSOLE_COMMAND
#ifndef CAMERATEST
- }
+}
#endif
}
bool ConsoleCommand_macro_normal(string s, int argc)
{
- #define CONSOLE_COMMAND(name,execution) \
+ #define CONSOLE_COMMAND(name, execution) \
{ if (name == s) { { execution } return true; } }
CONSOLE_COMMANDS_NORMAL();
bool ConsoleCommand_macro_movement(string s, int argc)
{
- if(camera_active)
+ if (camera_active)
{
- #define CONSOLE_COMMAND(name,execution) \
+ #define CONSOLE_COMMAND(name, execution) \
{ if (name == s) { { execution } return true; } }
CONSOLE_COMMANDS_MOVEMENT();
int argc = tokenize_console(command);
string s = strtolower(argv(0));
// Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
- return (ConsoleCommand_macro_normal(s, argc)
- || ConsoleCommand_macro_movement(s, argc)
- );
+ return ConsoleCommand_macro_normal(s, argc)
+ || ConsoleCommand_macro_movement(s, argc)
+ ;
}
* }
*/
#define EV_CSQC_ConsoleCommand(i, o) \
- /** command name */ i(string, cmd_name) \
- /** also, argv() can be used */ i(int, cmd_argc) \
- /** whole command, use only if you really have to */ i(string, cmd_string) \
- /**/
+ /** command name */ i(string, cmd_name) \
+ /** also, argv() can be used */ i(int, cmd_argc) \
+ /** whole command, use only if you really have to */ i(string, cmd_string) \
+ /**/
MUTATOR_HOOKABLE(CSQC_ConsoleCommand, EV_CSQC_ConsoleCommand);
/* Called when the crosshair is being updated */
* return = true;
*/
#define EV_CSQC_Parse_TempEntity(i, o) \
- /** mutator id */ i(int, mutator_argv_int_0) \
- /**/
+ /** mutator id */ i(int, mutator_argv_int_0) \
+ /**/
MUTATOR_HOOKABLE(CSQC_Parse_TempEntity, EV_CSQC_Parse_TempEntity);
/**
* return = true;
*/
#define EV_CSQC_Ent_Update(i, o) \
- /** mutator id */ i(int, mutator_argv_int_0) \
- /** bIsNewEntity */ i(bool, mutator_argv_bool_0) \
- /**/
+ /** mutator id */ i(int, mutator_argv_int_0) \
+ /** bIsNewEntity */ i(bool, mutator_argv_bool_0) \
+ /**/
MUTATOR_HOOKABLE(CSQC_Ent_Update, EV_CSQC_Ent_Update);
/** Called when a projectile is linked with CSQC */
#define EV_Ent_Projectile(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(Ent_Projectile, EV_Ent_Projectile);
/** Called when a projectile's properties are being modified */
#define EV_EditProjectile(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
/* Called when projectiles are precached */
/** Called when updating the attached tags index */
#define EV_TagIndex_Update(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(TagIndex_Update, EV_TagIndex_Update);
/** Called when setting the attached tags */
#define EV_TagIndex_Apply(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(TagIndex_Apply, EV_TagIndex_Apply);
/** Called when setting up skeleton bones */
#define EV_Skeleton_CheckBones(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(Skeleton_CheckBones, EV_Skeleton_CheckBones);
/** Called when setting up bones from the loaded model */
#define EV_Skeleton_CheckModel(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(Skeleton_CheckModel, EV_Skeleton_CheckModel);
/** Called when clearing the global parameters for a model */
/** Called when getting the global parameters for a model */
#define EV_GetModelParams(i, o) \
- /** entity id */ i(string, checkmodel_input) \
- /** entity id */ i(string, checkmodel_command) \
- /**/
+ /** entity id */ i(string, checkmodel_input) \
+ /** entity id */ i(string, checkmodel_command) \
+ /**/
string checkmodel_input, checkmodel_command;
MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
/** called when a player presses the jump key */
#define EV_PlayerJump(i, o) \
- /**/ i(float, player_multijump) \
- /**/ i(float, player_jumpheight) \
- /**/ o(float, player_multijump) \
- /**/ o(float, player_jumpheight) \
- /**/
+ /**/ i(float, player_multijump) \
+ /**/ i(float, player_jumpheight) \
+ /**/ o(float, player_multijump) \
+ /**/ o(float, player_jumpheight) \
+ /**/
float player_multijump;
float player_jumpheight;
MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
/** Called checking if 3rd person mode should be forced on */
#define EV_WantEventchase(i, o) \
- /** entity id */ i(entity, __self) \
- /**/
+ /** entity id */ i(entity, __self) \
+ /**/
MUTATOR_HOOKABLE(WantEventchase, EV_WantEventchase);
#endif
#include "../mutators/events.qh"
#include "../../common/constants.qh"
-#include "../../common/nades/all.qh"
#include "../../common/movetypes/movetypes.qh"
+#include "../../common/nades/all.qh"
#include "../../lib/csqcmodel/interpolate.qh"
.vector colormod;
void SUB_Stop()
-{SELFPARAM();
+{
+ SELFPARAM();
self.move_velocity = self.move_avelocity = '0 0 0';
self.move_movetype = MOVETYPE_NONE;
}
this.trail_oldtime = time;
// force the effect even for stationary firemine
- if(this.cnt == PROJECTILE_FIREMINE)
- if(from == to)
+ if (this.cnt == PROJECTILE_FIREMINE)
+ if (from == to)
from.z += 1;
if (this.traileffect)
f = self.move_flags;
- if(self.count & 0x80)
+ if (self.count & 0x80)
{
- //self.move_flags &= ~FL_ONGROUND;
- if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
+ // self.move_flags &= ~FL_ONGROUND;
+ if (self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
Movetype_Physics_NoMatchServer();
- // the trivial movetypes do not have to match the
- // server's ticrate as they are ticrate independent
- // NOTE: this assumption is only true if MOVETYPE_FLY
- // projectiles detonate on impact. If they continue
- // moving, we might still be ticrate dependent.
+ // the trivial movetypes do not have to match the
+ // server's ticrate as they are ticrate independent
+ // NOTE: this assumption is only true if MOVETYPE_FLY
+ // projectiles detonate on impact. If they continue
+ // moving, we might still be ticrate dependent.
else
Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
- if(!(self.move_flags & FL_ONGROUND))
- if(self.velocity != '0 0 0')
+ if (!(self.move_flags & FL_ONGROUND))
+ if (self.velocity != '0 0 0')
self.move_angles = self.angles = vectoangles(self.velocity);
}
else
InterpolateOrigin_Do();
}
- if(self.count & 0x80)
+ if (self.count & 0x80)
{
drawn = (time >= self.spawntime - 0.02);
t = max(time, self.spawntime);
t = time;
}
- if(!(f & FL_ONGROUND))
+ if (!(f & FL_ONGROUND))
{
rot = '0 0 0';
- switch(self.cnt)
+ switch (self.cnt)
{
/*
case PROJECTILE_GRENADE:
- rot = '-2000 0 0'; // forward
- break;
+ rot = '-2000 0 0'; // forward
+ break;
*/
case PROJECTILE_GRENADE_BOUNCING:
rot = '0 -1000 0'; // sideways
break;
case PROJECTILE_HOOKBOMB:
- rot = '1000 0 0'; // forward
+ rot = '1000 0 0'; // forward
break;
default:
break;
}
- if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
+ if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
rot = self.avelocity;
self.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(self.angles), rot * (t - self.spawntime)));
a = 1 - (time - self.fade_time) * self.fade_rate;
self.alpha = bound(0, self.alphamod * a, 1);
- if(self.alpha <= 0)
+ if (self.alpha <= 0)
drawn = 0;
self.renderflags = 0;
trailorigin = self.origin;
- switch(self.cnt)
+ switch (self.cnt)
{
case PROJECTILE_GRENADE:
case PROJECTILE_GRENADE_BOUNCING:
break;
}
- if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
+ if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
trailorigin += v_up * 4;
- if(drawn)
+ if (drawn)
Projectile_DrawTrail(self, trailorigin);
else
Projectile_ResetTrail(self, trailorigin);
self.drawmask = 0;
- if(!drawn)
+ if (!drawn)
return;
- switch(self.cnt)
+ switch (self.cnt)
{
// Possibly add dlights here.
default:
}
void loopsound(entity e, int ch, string samp, float vol, float attn)
-{SELFPARAM();
- if(self.silent)
+{
+ SELFPARAM();
+ if (self.silent)
return;
_sound(e, ch, samp, vol, attn);
}
void Ent_RemoveProjectile()
-{SELFPARAM();
- if(self.count & 0x80)
+{
+ SELFPARAM();
+ if (self.count & 0x80)
{
tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.05, MOVE_NORMAL, self);
Projectile_DrawTrail(self, trace_endpos);
}
void Ent_Projectile()
-{SELFPARAM();
+{
+ SELFPARAM();
int f;
// projectile properties:
self.count = (f & 0x80);
self.iflags = (self.iflags & IFLAG_INTERNALMASK) | IFLAG_AUTOANGLES | IFLAG_ANGLES | IFLAG_ORIGIN;
self.solid = SOLID_TRIGGER;
- //self.effects = EF_NOMODELFLAGS;
+ // self.effects = EF_NOMODELFLAGS;
// this should make collisions with bmodels more exact, but it leads to
// projectiles no longer being able to lie on a bmodel
self.move_nomonsters = MOVE_WORLDONLY;
- if(f & 0x40)
+ if (f & 0x40)
self.move_flags |= FL_ONGROUND;
else
self.move_flags &= ~FL_ONGROUND;
- if(!self.move_time)
+ if (!self.move_time)
{
// for some unknown reason, we don't need to care for
// sv_gameplayfix_delayprojectiles here.
self.spawntime = time;
}
else
+ {
self.move_time = max(self.move_time, time);
+ }
- if(!(self.count & 0x80))
+ if (!(self.count & 0x80))
InterpolateOrigin_Undo();
- if(f & 1)
+ if (f & 1)
{
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
setorigin(self, self.origin);
- if(self.count & 0x80)
+ if (self.count & 0x80)
{
self.velocity_x = ReadCoord();
self.velocity_y = ReadCoord();
self.velocity_z = ReadCoord();
- if(f & 0x10)
+ if (f & 0x10)
self.gravity = ReadCoord();
else
- self.gravity = 0; // none
+ self.gravity = 0; // none
self.move_origin = self.origin;
self.move_velocity = self.velocity;
}
- if(time == self.spawntime || (self.count & 0x80) || (f & 0x08))
+ if (time == self.spawntime || (self.count & 0x80) || (f & 0x08))
{
self.trail_oldorigin = self.origin;
- if(!(self.count & 0x80))
+ if (!(self.count & 0x80))
InterpolateOrigin_Reset();
}
- if(f & 0x20)
+ if (f & 0x20)
{
self.fade_time = time + ReadByte() * ticrate;
self.fade_rate = 1 / (ReadByte() * ticrate);
self.team = ReadByte() - 1;
}
- if(f & 2)
+ if (f & 2)
{
self.cnt = ReadByte();
self.scale = 1;
self.traileffect = 0;
- switch (self.cnt) {
-#define CASE(id) case PROJECTILE_##id: setmodel(self, MDL_PROJECTILE_##id);
+ switch (self.cnt)
+ {
+ #define CASE(id) case PROJECTILE_##id: setmodel(self, MDL_PROJECTILE_##id);
CASE(ELECTRO) self.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break;
CASE(ROCKET) self.traileffect = EFFECT_TR_ROCKET.m_id; self.scale = 2; break;
CASE(CRYLINK) self.traileffect = EFFECT_TR_CRYLINKPLASMA.m_id; break;
CASE(HOOKBOMB) self.traileffect = EFFECT_TR_KNIGHTSPIKE.m_id; break;
CASE(HAGAR) self.traileffect = EFFECT_HAGAR_ROCKET.m_id; self.scale = 0.75; break;
CASE(HAGAR_BOUNCING) self.traileffect = EFFECT_HAGAR_ROCKET.m_id; self.scale = 0.75; break;
- CASE(NAPALM_FOUNTAIN) // fallthrough // sself.modelindex = 0; self.traileffect = _particleeffectnum("torch_small"); break;
+ CASE(NAPALM_FOUNTAIN) // fallthrough // sself.modelindex = 0; self.traileffect = _particleeffectnum("torch_small"); break;
CASE(FIREBALL) self.modelindex = 0; self.traileffect = EFFECT_FIREBALL.m_id; break; // particle effect is good enough
CASE(FIREMINE) self.modelindex = 0; self.traileffect = EFFECT_FIREMINE.m_id; break; // particle effect is good enough
CASE(TAG) self.traileffect = EFFECT_TR_ROCKET.m_id; break;
CASE(ROCKETMINSTA_LASER) self.traileffect = EFFECT_ROCKETMINSTA_LASER(self.team).m_id; break;
#undef CASE
default:
- if(MUTATOR_CALLHOOK(Ent_Projectile, self))
+ if (MUTATOR_CALLHOOK(Ent_Projectile, self))
break;
if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
self.move_movetype = MOVETYPE_TOSS;
self.alphamod = 1;
- switch(self.cnt)
+ switch (self.cnt)
{
case PROJECTILE_ELECTRO:
// only new engines support sound moving with object
self.mins = '-4 -4 -4';
self.maxs = '4 4 4';
break;
- case PROJECTILE_RAPTORBOMB:
+ case PROJECTILE_RAPTORBOMB:
self.mins = '-3 -3 -3';
self.maxs = '3 3 3';
break;
- case PROJECTILE_RAPTORBOMBLET:
- break;
- case PROJECTILE_RAPTORCANNON:
+ case PROJECTILE_RAPTORBOMBLET:
break;
- case PROJECTILE_SPIDERROCKET:
- loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
+ case PROJECTILE_RAPTORCANNON:
break;
- case PROJECTILE_WAKIROCKET:
- loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
+ case PROJECTILE_SPIDERROCKET:
+ loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
break;
- /*
- case PROJECTILE_WAKICANNON:
+ case PROJECTILE_WAKIROCKET:
+ loopsound(self, CH_SHOTS_SINGLE, SND(TAG_ROCKET_FLY), VOL_BASE, ATTEN_NORM);
break;
+ /*
+ case PROJECTILE_WAKICANNON:
+ break;
case PROJECTILE_BUMBLE_GUN:
- // only new engines support sound moving with object
- loopsound(self, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM);
- self.mins = '0 0 -4';
- self.maxs = '0 0 -4';
- self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = func_null;
- self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
- self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
- break;
+ // only new engines support sound moving with object
+ loopsound(self, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM);
+ self.mins = '0 0 -4';
+ self.maxs = '0 0 -4';
+ self.move_movetype = MOVETYPE_BOUNCE;
+ self.move_touch = func_null;
+ self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
+ self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
+ break;
*/
default:
break;
}
- if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
+ if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
{
entity nade_type = Nade_FromProjectile(self.cnt);
self.mins = '-16 -16 -16';
self.scale = 1.5;
self.avelocity = randomvec() * 720;
- if(nade_type == NADE_TYPE_TRANSLOCATE || nade_type == NADE_TYPE_SPAWN)
+ if (nade_type == NADE_TYPE_TRANSLOCATE || nade_type == NADE_TYPE_SPAWN)
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
else
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
setsize(self, self.mins, self.maxs);
}
- if(self.gravity)
+ if (self.gravity)
{
- if(self.move_movetype == MOVETYPE_FLY)
+ if (self.move_movetype == MOVETYPE_FLY)
self.move_movetype = MOVETYPE_TOSS;
- if(self.move_movetype == MOVETYPE_BOUNCEMISSILE)
+ if (self.move_movetype == MOVETYPE_BOUNCEMISSILE)
self.move_movetype = MOVETYPE_BOUNCE;
}
else
{
- if(self.move_movetype == MOVETYPE_TOSS)
+ if (self.move_movetype == MOVETYPE_TOSS)
self.move_movetype = MOVETYPE_FLY;
- if(self.move_movetype == MOVETYPE_BOUNCE)
+ if (self.move_movetype == MOVETYPE_BOUNCE)
self.move_movetype = MOVETYPE_BOUNCEMISSILE;
}
- if(!(self.count & 0x80))
+ if (!(self.count & 0x80))
InterpolateOrigin_Note();
self.classname = "csqcprojectile";
#define CLIENT_WEAPONS_PROJECTILE_H
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;
+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();
# If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C]
# This is generally a bad idea, as it may break your code.
-mod_sort_include = false # false/true
+mod_sort_include = true # false/true
# If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace.
# WARNING: Code doesn't seem to use this feature - delete from the config?
# Will add or remove the braces around a fully braced case statement.
# Will only remove the braces if there are no variable declarations in the block.
# NOTE: is 78 worse than ignore
-mod_case_brace = remove # ignore/add/remove/force
+mod_case_brace = add # ignore/add/remove/force
# If TRUE, it will remove a void 'return;' that appears as the last statement in a function.
mod_remove_empty_return = true # false/true #force
# Whether to put a star on subsequent comment lines
# WARNING: Code doesn't seem to use this feature - delete from the config?
-cmt_star_cont = false # false/true
+cmt_star_cont = true # false/true
# The number of spaces to insert at the start of subsequent comment lines
# WARNING: Code doesn't seem to use this feature - delete from the config?
# type myfoo1 myfoo2
type void
+type bool
+type int
type float
type vector
type entity
type string
type .void
+type .bool
+type .int
type .float
type .vector
type .entity
# You can assign any keyword to any type with the set option.
# set func_call_user _ N_
-# menu QC OO
+# QC OO
macro-open CLASS
macro-else EXTENDS
macro-close ENDCLASS