#include "../constants.qh"
#include "../stats.qh"
#include "../teams.qh"
- #include "../util.qh"
+ #include <common/util.qh>
#include "../monsters/_mod.qh"
#include "config.qh"
#include <server/weapons/csqcprojectile.qh>
#ifdef SVQC
#include "config.qc"
#endif
-#define IMPLEMENTATION
-#include "all.inc"
-#undef IMPLEMENTATION
+
+#include "weapon/_mod.inc"
+
// WEAPON PLUGIN SYSTEM
if (a >= 24)
{
a -= 24;
- return '0 0 1' * power2of(a);
+ return '0 0 1' * (2 ** a);
}
- return '0 1 0' * power2of(a);
+ return '0 1 0' * (2 ** a);
}
- return '1 0 0' * power2of(a);
+ return '1 0 0' * (2 ** a);
}
#ifdef SVQC
void WriteWepSet(float dst, WepSet w)
return W_FixWeaponOrder(order, 1);
}
-void W_RandomWeapons(entity e, float n)
+void W_RandomWeapons(entity e, int n)
{
- int i;
- WepSet remaining;
- WepSet result;
- remaining = e.weapons;
- result = '0 0 0';
- for (i = 0; i < n; ++i)
+ WepSet remaining = e.weapons;
+ WepSet result = '0 0 0';
+ for (int j = 0; j < n; ++j)
{
RandomSelection_Init();
FOREACH(Weapons, it != WEP_Null, {
string W_Sound(string w_snd)
{
string output = strcat("weapons/", w_snd);
-#ifdef SVQC
- MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
- return M_ARGV(1, string);
-#else
- return output;
-#endif
+ MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
+ return M_ARGV(1, string);
}
string W_Model(string w_mdl)
int compressed_shotorg = compressShotOrigin(this.movedir);
// make them match perfectly
#ifdef SVQC
- this.movedir = decompressShotOrigin(this.owner.stat_shotorg = compressed_shotorg);
+ // null during init
+ if (this.owner) this.owner.stat_shotorg = compressed_shotorg;
+ this.movedir = decompressShotOrigin(compressed_shotorg);
#else
this.movedir = decompressShotOrigin(compressed_shotorg);
#endif
}
default:
{
- LOG_INFOF("Incorrect parameters for ^2%s^7\n", "weapon_find");
+ LOG_INFOF("Incorrect parameters for ^2%s^7", "weapon_find");
}
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 cl_cmd weapon_find weapon\n");
- LOG_INFO(" Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.\n");
+ LOG_INFO("Usage:^3 cl_cmd weapon_find weapon");
+ LOG_INFO(" Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.");
return;
}
}