void write_String_To_File(int fh, string str, bool alsoprint)
{
fputs(fh, str);
- if (alsoprint) LOG_INFO(str);
+ if (alsoprint) LOG_HELP(str);
}
string get_model_datafilename(string m, float sk, string fil)
ent.v_angle = ent.angles - e.angles; // relative angles
ent.aiment_classname = strzone(e.classname);
ent.aiment_deadflag = e.deadflag;
+
+ if(IS_PLAYER(ent.aiment))
+ {
+ entity pl = ent.aiment;
+ ent.view_ofs.x = bound(pl.mins.x + 4, ent.view_ofs.x, pl.maxs.x - 4);
+ ent.view_ofs.y = bound(pl.mins.y + 4, ent.view_ofs.y, pl.maxs.y - 4);
+ ent.view_ofs.z = bound(pl.mins.z + 4, ent.view_ofs.z, pl.maxs.z - 4);
+ }
}
+
void UnsetMovetypeFollow(entity ent)
{
set_movetype(ent, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(ent);
- ent.aiment = NULL;
+ if (ent.aiment_classname)
+ strunzone(ent.classname);
+ // 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