Flight
2011-09-15 03:55:55
So… "R_GetInteractingNPC" doesn't seem to be working very well, so I put together a temporary alternative, and I just thought maybe it's worth throwing in the library. I tested it and it checks out just fine.
If you don't like referring to 'R_InCombat' then I'm sure you could directly hook the LoopCycles here if you wanted, which I would imagine to be a few milliseconds faster.
Function R_Fighting: Boolean;
var
MyPlayer,I: Integer;
begin
MyPlayer := SmartGetFieldObject(0, hook_static_MyPlayer);
I := SmartGetFieldInt(MyPlayer, hook_character_Interacting);
if (I > -1) And R_InCombat then
Result := True;
SmartFreeObject(MyPlayer);
end;
If you don't like referring to 'R_InCombat' then I'm sure you could directly hook the LoopCycles here if you wanted, which I would imagine to be a few milliseconds faster.