]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/all.qh
Create aliases for commands on roughly their correct VM, restores settemp functionality
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / all.qh
index e63a931a67361df15b0d7b15f71fbc16e484c862..9dedc89cb780253a184b45ed3f1dba2da1744d9b 100644 (file)
@@ -11,8 +11,53 @@ REGISTRY(Turrets, BITS(5))
 REGISTER_REGISTRY(Turrets)
 REGISTRY_CHECK(Turrets)
 
+#define TR_PROPS_COMMON(P, class, prefix) \
+       P(class, prefix, aim_firetolerance_dist, float) \
+       P(class, prefix, aim_maxpitch, float) \
+       P(class, prefix, aim_maxrot, float) \
+       P(class, prefix, aim_speed, float) \
+       P(class, prefix, ammo_max, float) \
+       P(class, prefix, ammo_recharge, float) \
+       P(class, prefix, health, float) \
+       P(class, prefix, respawntime, float) \
+       P(class, prefix, shot_dmg, float) \
+       P(class, prefix, shot_force, float) \
+       P(class, prefix, shot_radius, float) \
+       P(class, prefix, shot_refire, float) \
+       P(class, prefix, shot_speed, float) \
+       P(class, prefix, shot_spread, float) \
+       P(class, prefix, shot_volly, float) \
+       P(class, prefix, shot_volly_refire, float) \
+       P(class, prefix, target_range, float) \
+       P(class, prefix, target_range_min, float) \
+       P(class, prefix, target_range_optimal, float) \
+       P(class, prefix, target_select_anglebias, float) \
+       P(class, prefix, target_select_missilebias, float) \
+       P(class, prefix, target_select_playerbias, float) \
+       P(class, prefix, target_select_rangebias, float) \
+       P(class, prefix, target_select_samebias, float) \
+       P(class, prefix, track_accel_pitch, float) \
+       P(class, prefix, track_accel_rot, float) \
+       P(class, prefix, track_blendrate, float) \
+       P(class, prefix, track_type, float) \
+       /**/
 
-GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
+#define TR_PROPS(L, class, prefix) \
+       L(TR_CONFIG_BEGIN, TR_CONFIG, TR_CONFIG_END, class, prefix) \
+       /**/
+
+#define TR_CONFIG(class, turname, fld, T)     _TR_CONFIG(class, fld, T, turname)
+#ifdef SVQC
+       #define TR_CONFIG_BEGIN(class) METHOD(class, tr_config, void(class this)) {
+               #define _TR_CONFIG(class, fld, T, turname) if (#turname == this.netname) TUR_CONFIG_WRITE_CVARS(turname, fld, T);
+       #define TR_CONFIG_END() }
+#else
+       #define TR_CONFIG_BEGIN(class)
+               #define _TR_CONFIG(class, fld, T, turname)
+       #define TR_CONFIG_END()
+#endif
+
+GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt", false)
 {
     switch(request)
     {