X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qc;h=d7de988d710d7db4fba611d49e339f6b23b551b5;hp=f2448998c7c634888cba59c7b2d1f9aecc47c83c;hb=3f9034c2fec80f69f791cb4ef78e7eb672dea2bb;hpb=bdb5a7169145f7982de9109bd4c833112a6b747b diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index f2448998c..d7de988d7 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1922,26 +1922,29 @@ void SetMovetypeFollow(entity ent, entity e) ent.aiment_classname = strzone(e.classname); ent.aiment_deadflag = e.deadflag; } + void UnsetMovetypeFollow(entity ent) { set_movetype(ent, MOVETYPE_FLY); PROJECTILE_MAKETRIGGER(ent); - ent.aiment = NULL; + // FIXME: engine bug? + // resetting aiment the engine will set orb's origin close to world's origin + //ent.aiment = NULL; } -float LostMovetypeFollow(entity ent) + +int LostMovetypeFollow(entity ent) { /* if(ent.move_movetype != MOVETYPE_FOLLOW) if(ent.aiment) error("???"); */ - if(ent.aiment) - { - if(ent.aiment.classname != ent.aiment_classname) - return 1; - if(ent.aiment.deadflag != ent.aiment_deadflag) - return 1; - } + // FIXME: engine bug? + // when aiment disconnects the engine will set orb's origin close to world's origin + if(!ent.aiment) + return 2; + if(ent.aiment.classname != ent.aiment_classname || ent.aiment.deadflag != ent.aiment_deadflag) + return 1; return 0; } #endif