Port .msa motion events, .mss sounds and skill motions
ParseRaceMotionData now reads LoopData, MotionEventData and the per-motion .mss sound script. ActorInstance runs the events each 1/60 s frame: effects, sounds, splash attacks, fly shots, show/hide and warp. Player skill and guild-skill motions are registered. ClickSkillSlot and remote FUNC_SKILL states play the skill motions, and fly targets are synced with the server (audit P1 #4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
31c74cec28
commit
f6dfcfc337
@@ -31,6 +31,7 @@
|
||||
#include "python_sash.h"
|
||||
#include "python_manager_bank.h"
|
||||
#include "NetworkActorManager.h"
|
||||
#include "python_background.h"
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
@@ -663,11 +664,22 @@ bool PythonNetworkStream::RecvKillLOG() {
|
||||
bool PythonNetworkStream::RecvFlyTargetingPacket(bool add) {
|
||||
TPacketGCFlyTargeting p;
|
||||
if(!Read(sizeof(p),&p)) return false;
|
||||
// __GlobalPositionToLocalPosition + AddFlyTarget/SetFlyTarget on the shooter's
|
||||
// graphic instance: fly-target tracking is not ported. Windows logs the missing
|
||||
// shooter only for AddFlyTargeting in release builds.
|
||||
if(!NetworkActorManager::Instance().GetActorData(p.dwShooterVID) && add)
|
||||
trace_error("CPythonNetworkStream::RecvFlyTargetingPacket() - dwShooterVID["+std::to_string(p.dwShooterVID)+"] NOT EXIST");
|
||||
GlobalToLocalPosition(p.lX,p.lY);
|
||||
// Windows logs the missing shooter only for AddFlyTargeting in release builds.
|
||||
auto* shooter=NetworkActorManager::Instance().GetActorData(p.dwShooterVID);
|
||||
if(!shooter || !shooter->m_pActorInstance) {
|
||||
if(add) trace_error("CPythonNetworkStream::RecvFlyTargetingPacket() - dwShooterVID["+std::to_string(p.dwShooterVID)+"] NOT EXIST");
|
||||
return true;
|
||||
}
|
||||
ActorInstance& inst=*shooter->m_pActorInstance;
|
||||
auto* target=p.dwTargetVID ? NetworkActorManager::Instance().GetActorData(p.dwTargetVID) : nullptr;
|
||||
if(target && target->m_pActorInstance) {
|
||||
if(add) inst.AddFlyTarget(p.dwTargetVID); else inst.SetFlyTarget(p.dwTargetVID);
|
||||
} else {
|
||||
// GetHeight(lX, lY) + 60.0f: "TEMPORARY HEIGHT" on Windows. Engine axes are (x, h, y).
|
||||
const float h=CPythonBackground::Instance().GetHeight(float(p.lX),float(p.lY))+60.0f;
|
||||
if(add) inst.AddFlyTarget(float(p.lX),h,float(p.lY)); else inst.SetFlyTarget(float(p.lX),h,float(p.lY));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user