X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_hook.qc;h=1684573281b46e01d9a0ba531821ce8328997fd7;hb=b0210c08a287ad4631e16ddf3a83a0b0c546283f;hp=fd3cd08ecfe70d9864117218e9ad2e6dddec0c26;hpb=0ff1afbe6825c541b231fb4c4cfcbf60cbb5ecd7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index fd3cd08ec..168457328 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -5,7 +5,7 @@ #include "weapons/weaponsystem.qh" #include "weapons/selection.qh" #include "weapons/tracing.qh" -#include "cl_player.qh" +#include "player.qh" #include "command/common.qh" #include "round_handler.qh" #include "../common/state.qh" @@ -74,10 +74,10 @@ void RemoveGrapplingHook(entity pl) { if(pl.hook == NULL) return; - remove(pl.hook); + delete(pl.hook); pl.hook = NULL; - if(pl.movetype == MOVETYPE_FLY) - pl.movetype = MOVETYPE_WALK; + if(pl.move_movetype == MOVETYPE_FLY) + set_movetype(pl, MOVETYPE_WALK); //pl.disableclientprediction = false; } @@ -87,7 +87,7 @@ void GrapplingHookReset(entity this) if(this.realowner.hook == this) RemoveGrapplingHook(this.owner); else // in any case: - remove(this); + delete(this); } void GrapplingHookThink(entity this); @@ -101,7 +101,7 @@ void GrapplingHook_Stop(entity this) this.nextthink = time; settouch(this, func_null); this.velocity = '0 0 0'; - this.movetype = MOVETYPE_NONE; + set_movetype(this, MOVETYPE_NONE); this.hook_length = -1; } @@ -220,8 +220,8 @@ void GrapplingHookThink(entity this) this.hook_length = newlength; } - if(pull_entity.movetype == MOVETYPE_FLY) - pull_entity.movetype = MOVETYPE_WALK; + if(pull_entity.move_movetype == MOVETYPE_FLY) + set_movetype(pull_entity, MOVETYPE_WALK); if(this.realowner.hook_state & HOOK_RELEASING) { @@ -238,7 +238,7 @@ void GrapplingHookThink(entity this) dv = ((v - v0) * dir) * dir; if(tarzan >= 2) { - if(this.aiment.movetype == MOVETYPE_WALK || this.aiment.classname == "nade") + if(this.aiment.move_movetype == MOVETYPE_WALK || this.aiment.classname == "nade") { entity aim_ent = ((IS_VEHICLE(this.aiment) && this.aiment.owner) ? this.aiment.owner : this.aiment); v = v - dv * 0.5; @@ -280,7 +280,7 @@ void GrapplingHookThink(entity this) if(spd < 50) spd = 0; this.realowner.velocity = dir*spd; - this.realowner.movetype = MOVETYPE_FLY; + set_movetype(this.realowner, MOVETYPE_FLY); UNSET_ONGROUND(this.realowner); } @@ -303,14 +303,14 @@ void GrapplingHookThink(entity this) void GrapplingHookTouch(entity this, entity toucher) { - if(toucher.movetype == MOVETYPE_FOLLOW) + if(toucher.move_movetype == MOVETYPE_FOLLOW) return; PROJECTILE_TOUCH(this, toucher); GrapplingHook_Stop(this); if(toucher) - if(toucher.movetype != MOVETYPE_NONE) + if(toucher.move_movetype != MOVETYPE_NONE) { SetMovetypeFollow(this, toucher); WarpZone_RefSys_BeginAddingIncrementally(this, this.aiment); @@ -370,8 +370,9 @@ void FireGrapplingHook(entity actor) missile.reset = GrapplingHookReset; missile.classname = "grapplinghook"; missile.flags = FL_PROJECTILE; + IL_PUSH(g_projectiles, missile); - missile.movetype = ((autocvar_g_balance_grapplehook_gravity) ? MOVETYPE_TOSS : MOVETYPE_FLY); + set_movetype(missile, ((autocvar_g_balance_grapplehook_gravity) ? MOVETYPE_TOSS : MOVETYPE_FLY)); PROJECTILE_MAKETRIGGER(missile); //setmodel (missile, MDL_HOOK); // precision set below