| 207 | |
| 208 | static void Classic_ReadAbsoluteLocation(cc_uint8* data, EntityID id, cc_uint8 flags); |
| 209 | static void AddEntity(cc_uint8* data, EntityID id, const cc_string* name, const cc_string* skin, cc_bool readPosition) { |
| 210 | struct LocalPlayer* p = Entities.CurPlayer; |
| 211 | struct Entity* e; |
| 212 | |
| 213 | if (id != ENTITIES_SELF_ID) { |
| 214 | Entities_Remove(id); |
| 215 | e = &NetPlayers_List[id].Base; |
| 216 | |
| 217 | NetPlayer_Init((struct NetPlayer*)e); |
| 218 | Entities.List[id] = e; |
| 219 | Event_RaiseInt(&EntityEvents.Added, id); |
| 220 | } else { |
| 221 | e = &Entities.CurPlayer->Base; |
| 222 | } |
| 223 | Entity_SetSkin(e, skin); |
| 224 | Entity_SetName(e, name); |
| 225 | |
| 226 | if (!readPosition) return; |
| 227 | Classic_ReadAbsoluteLocation(data, id, |
| 228 | LU_HAS_POS | LU_HAS_YAW | LU_HAS_PITCH | LU_POS_ABSOLUTE_INSTANT); |
| 229 | if (id != ENTITIES_SELF_ID) return; |
| 230 | |
| 231 | p->Spawn = p->Base.Position; |
| 232 | p->SpawnYaw = p->Base.Yaw; |
| 233 | p->SpawnPitch = p->Base.Pitch; |
| 234 | } |
| 235 | |
| 236 | static void UpdateLocation(EntityID id, struct LocationUpdate* update) { |
| 237 | struct Entity* e = Entities.List[id]; |
no test coverage detected