| 3 |
|
|
| 4 |
|
#define FLAG_AND_INCREMENT( FLAG ) PD->UpdateFlags |= (1 << FLAG ); DataPointer += FLpData_PartSize( FLAG ); |
| 5 |
|
|
| 6 |
< |
void FLsPacketBuild( uint8_t p, PlayerData* PD ) |
| 6 |
> |
void FLsPacketBuild( uint8_t p, PlayerData* PD, bool UpdateAll ) |
| 7 |
|
{ |
| 8 |
|
Character* Player = PlayerList[p]->Chr; |
| 9 |
|
ActiveCharacter* APlayer = ONrGetActiveCharacter(Player); |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
if( PI->Facings.Facing != Player->Facing || |
| 40 |
< |
PI->Facings.DesiredFacing != Player->DesiredFacing ) |
| 40 |
> |
PI->Facings.DesiredFacing != Player->DesiredFacing || UpdateAll ) |
| 41 |
|
{ |
| 42 |
|
PlayerFacing* ptr = (void*)DataPointer; |
| 43 |
|
ptr->Facing = Player->Facing; |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
if(PI->Health.Health != Player->Health || |
| 52 |
< |
PI->Health.MaxHealth != Player->MaxHealth ) |
| 52 |
> |
PI->Health.MaxHealth != Player->MaxHealth || UpdateAll ) |
| 53 |
|
{ |
| 54 |
|
PlayerHealth* ptr = (void*)DataPointer; |
| 55 |
|
ptr->Health = Player->Health; |
| 88 |
|
//Do inventory |
| 89 |
|
} |
| 90 |
|
|
| 91 |
< |
if( PI->Class != Player->ONCC ) |
| 91 |
> |
if( PI->Class != Player->ONCC || UpdateAll ) |
| 92 |
|
{ |
| 93 |
|
sprintf_s( DataPointer, 32, "%s", TMrInstance_GetInstanceName( Player->ONCC ) ); |
| 94 |
+ |
sprintf_s( PI->ClassString, 32, "%s", DataPointer ); |
| 95 |
|
PI->Class = Player->ONCC; |
| 96 |
|
|
| 97 |
|
FLAG_AND_INCREMENT( PFlag_Class ); |
| 99 |
|
|
| 100 |
|
if(APlayer) |
| 101 |
|
{ |
| 102 |
< |
if( (APlayer->PhyContext) && memcmp(&PI->Position, &APlayer->PhyContext->Position, sizeof(Vector3)) ) |
| 102 |
> |
if( (APlayer->PhyContext) && (memcmp(&PI->Position, &APlayer->PhyContext->Position, sizeof(Vector3)) || UpdateAll )) |
| 103 |
|
{ |
| 104 |
|
Vector3* ptr = (Vector3*)DataPointer; |
| 105 |
|
*ptr = PI->Position = APlayer->PhyContext->Position; |
| 107 |
|
FLAG_AND_INCREMENT( PFlag_Position ); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
< |
if(APlayer->Animation != PI->Animation) |
| 110 |
> |
if(APlayer->Animation != PI->Animation || !APlayer->Frame || UpdateAll ) |
| 111 |
|
{ |
| 112 |
|
sprintf_s( DataPointer, 32, "%s", TMrInstance_GetInstanceName( APlayer->Animation ) ); |
| 113 |
+ |
sprintf_s( PI->AnimationString, 32, "%s", DataPointer ); |
| 114 |
|
PI->Animation = APlayer->Animation; |
| 115 |
+ |
|
| 116 |
|
|
| 117 |
|
FLAG_AND_INCREMENT( PFlag_Animation ); |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
if(APlayer->targetThrow) |
| 121 |
|
{ |
| 122 |
< |
if(!PI->HasAppliedThrow) |
| 122 |
> |
if(!PI->HasAppliedThrow || UpdateAll ) |
| 123 |
|
{ |
| 124 |
|
PlayerThrowData* ptr = (void*)DataPointer; |
| 125 |
|
ptr->throwing = Players[APlayer->throwing].list_slot; |
| 166 |
|
{ |
| 167 |
|
if(PlayerList[p] && PlayerList[p]->Chr) |
| 168 |
|
{ |
| 169 |
< |
FLsPacketBuild(p, &BuildData[p]); |
| 169 |
> |
FLsPacketBuild(p, &BuildData[p], 0); |
| 170 |
|
|
| 171 |
|
assert( BuildData[p].Size < 255 ); |
| 172 |
|
|