]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret.qh
Merge branch 'master' into terencehill/scoreboard_panel_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret.qh
index edf1d5b573f9cd44ba2d45b4c9da6b89e4db33d7..dc84acc7401b7457508fcb85429f696204c595d6 100644 (file)
@@ -1,7 +1,6 @@
-#ifndef TURRET_H
-#define TURRET_H
+#pragma once
 
-#include "../weapons/all.qh"
+#include <common/weapons/all.qh>
 
 CLASS(Turret, Object)
     ATTRIB(Turret, m_id, int, 0)
@@ -23,7 +22,7 @@ CLASS(Turret, Object)
     /** turret hitbox size */
     ATTRIB(Turret, maxs, vector, '0 0 0')
 
-    METHOD(Turret, display, void(entity this, void(string name, string icon) returns)) {
+    METHOD(Turret, display, void(Turret this, void(string name, string icon) returns)) {
         returns(this.turret_name, string_null);
     }
     /** (BOTH) setup turret data */
@@ -31,7 +30,7 @@ CLASS(Turret, Object)
 
     }
     /** (SERVER) logic to run every frame */
-    METHOD(Turret, tr_think, void(Turret this)) {
+    METHOD(Turret, tr_think, void(Turret this, entity it)) {
 
     }
     /** (SERVER) called when turret dies */
@@ -43,11 +42,14 @@ CLASS(Turret, Object)
 
     }
     ATTRIB(Turret, m_weapon, Weapon, WEP_Null)
+#ifdef SVQC
     /** (SERVER) called when turret attacks */
-    METHOD(Turret, tr_attack, void(Turret this)) {
+    METHOD(Turret, tr_attack, void(Turret this, entity it)) {
         Weapon w = this.m_weapon;
-        w.wr_think(w, true, false);
+        .entity weaponentity = weaponentities[0];
+        w.wr_think(w, it, weaponentity, 1);
     }
+#endif
     /** (ALL) */
     METHOD(Turret, tr_config, void(Turret this)) {
         // TODO
@@ -173,5 +175,3 @@ const int TNSF_MOVE         = 64;
 const int TNSF_ANIM         = 128;
 
 const int TNSF_FULL_UPDATE  = 16777215;
-
-#endif