[saco] Implement/match CActorPed::ApplyAnimation(...)

This commit is contained in:
RD42 2024-10-25 23:47:29 +08:00
parent 61497a1372
commit 4a3df886e2
3 changed files with 30 additions and 1 deletions

View File

@ -66,6 +66,32 @@ void CActorPed::Destroy()
//-----------------------------------------------------------
void CActorPed::ApplyAnimation( char *szAnimName, char *szAnimFile, float fT,
int opt1, int opt2, int opt3, int opt4, int iUnk )
{
int iWaitAnimLoad=0;
if(!m_pPed) return;
if(!GamePool_Ped_GetAt(m_dwGTAId)) return;
// Can't allow 'naughty' anims!
if( !stricmp(szAnimFile,"SEX") )
return;
if (!pGame->IsAnimationLoaded(szAnimFile)) {
pGame->RequestAnimation(szAnimFile);
while(!pGame->IsAnimationLoaded(szAnimFile)) {
Sleep(1);
iWaitAnimLoad++;
if(iWaitAnimLoad == 15) return; // we can't wait forever
}
}
ScriptCommand(&apply_animation,m_dwGTAId,szAnimName,szAnimFile,fT,opt1,opt2,opt3,opt4,iUnk);
}
//-----------------------------------------------------------
DWORD dwActorPed=0;
BOOL __declspec(naked) FlushPedIntelligence()

View File

@ -15,9 +15,12 @@ public:
void SetTargetRotation(float fRotation);
float GetHealth();
void SetHealth(float fHealth);
float GetArmour();
void SetArmour(float fArmour);
void ApplyAnimation(char *szAnimName, char *szAnimFile, float fT,
int opt1, int opt2, int opt3, int opt4, int iUnk);
void ClearAnimations();

View File

@ -89,7 +89,7 @@ const SCRIPT_COMMAND set_actor_animation_set = { 0x0245, "is" };
const SCRIPT_COMMAND request_animation = { 0x04ED, "s" };
const SCRIPT_COMMAND is_animation_loaded = { 0x04EE, "s" };
const SCRIPT_COMMAND release_animation = { 0x04EF, "s" };
const SCRIPT_COMMAND apply_animation = { 0x0812, "issfiiiii" }; // actor,animation,library,floatunk,bool,bool,bool,bool,int
const SCRIPT_COMMAND set_actor_weapon_droppable = { 0x087e, "ii" };
const SCRIPT_COMMAND set_actor_money = { 0x03fe, "ii" };