X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qh;h=beaa6cb48a3773e2555b4817177696242b7b7e43;hb=98b2c4213abe04f3ec96a95471ba5fe5fe57e008;hp=fa9d64ab8d238666270e193eb967bd4230c19e0a;hpb=4d9a40898926a8da83b788f9a862f35cdd4c8905;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index fa9d64ab8..beaa6cb48 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -1,12 +1,11 @@ -#ifndef WEAPONS_ALL_H -#define WEAPONS_ALL_H +#pragma once -#include +#include #include #include "config.qh" -// weapon sets -USING(WepSet, vector); +#include "weapon.qh" + #ifdef SVQC void WriteWepSet(float dest, WepSet w); #endif @@ -17,24 +16,23 @@ WepSet WepSet_GetFromStat_InMap(); WepSet ReadWepSet(); #endif -#include "weapon.qh" - -#ifndef MENUQC +#ifdef GAMEQC #include "calculations.qh" +#include "projectiles.qh" #include #endif #include -#ifdef SVQC -#include -#endif - REGISTRY(Weapons, 72) // Increase as needed. Can be up to 72. #define Weapons_from(i) _Weapons_from(i, WEP_Null) REGISTER_REGISTRY(Weapons) STATIC_INIT(WeaponPickup) { FOREACH(Weapons, true, it.m_pickup = NEW(WeaponPickup, it)); } +#ifdef SVQC +#include +#endif + .WepSet m_wepset; #define WEPSET(id) (WEP_##id.m_wepset) #define WepSet_FromWeapon(it) ((it).m_wepset) @@ -66,17 +64,17 @@ GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPON if(wep_config_file >= 0) { Dump_Weapon_Settings(); - LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename)); + LOG_INFOF("Dumping weapons... File located in ^2data/data/%s^7.", filename); fclose(wep_config_file); wep_config_file = -1; wep_config_alsoprint = -1; } else { - LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename)); + LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename); } #else - LOG_INFO(_("Weapons dump command only works with sv_cmd.\n")); + LOG_INFO(_("Weapons dump command only works with sv_cmd.")); #endif return; } @@ -84,10 +82,10 @@ GENERIC_COMMAND(dumpweapons, "Dump all weapons into weapons_dump.txt") // WEAPON default: case CMD_REQUEST_USAGE: { - LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]")); - LOG_INFO(" Where 'filename' is the file to write (default is weapons_dump.cfg),\n"); - LOG_INFO(" if supplied with '-' output to console as well as default,\n"); - LOG_INFO(" if left blank, it will only write to default.\n"); + LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"); + LOG_INFO(" Where 'filename' is the file to write (default is weapons_dump.cfg),"); + LOG_INFO(" if supplied with '-' output to console as well as default,"); + LOG_INFO(" if left blank, it will only write to default."); return; } } @@ -144,10 +142,12 @@ X(weaponreplace, string) X(weaponstartoverride, float) X(weaponstart, float) X(weaponthrowable, float) +#ifdef SVQC X(reload_ammo, float) .float reloading_ammo = reload_ammo; X(reload_time, float) .float reloading_time = reload_time; +#endif #undef X @@ -312,7 +312,7 @@ STATIC_INIT(register_weapons_done) else inaccessible = strcat(inaccessible, "\n", it.netname); }); - if (inaccessible) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s\n", inaccessible); + if (inaccessible) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s", inaccessible); #ifdef CSQC FOREACH(Weapons, true, it.wr_init(it)); #endif @@ -323,17 +323,19 @@ STATIC_INIT(register_weapons_done) weaponorder_byid = strzone(substring(weaponorder_byid, 1, -1)); } -#ifndef MENUQC +#ifdef GAMEQC .entity weaponchild; .entity exteriorweaponentity; -vector weaponentity_glowmod(Weapon wep, int c) +vector weaponentity_glowmod(Weapon wep, entity actor, int c, entity wepent) { vector g; - if (!(g = wep.wr_glow(wep))) g = colormapPaletteColor(c & 0x0F, true) * 2; + if (!(g = wep.wr_glow(wep, actor, wepent))) g = colormapPaletteColor(c & 0x0F, true) * 2; return g; } +.int m_gunalign; + //.int weapon; // current weapon .string weaponname; // name of .weapon @@ -360,5 +362,3 @@ ENUMCLASS_END(WFRAME) vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn); void CL_WeaponEntity_SetModel(entity this, string name, bool _anim); #endif - -#endif