| 260 | } |
| 261 | |
| 262 | pair<ByteArray, uint64_t> Npc::writeNetState(uint64_t fromVersion, NetCompatibilityRules rules) { |
| 263 | // client-side npcs error nearby vanilla NPC scripts because callScriptedEntity |
| 264 | // for now, scrungle the collision poly to avoid their queries. hacky :( |
| 265 | if (m_npcVariant.overrides && m_npcVariant.overrides.getBool("overrideNetPoly", false)) { |
| 266 | if (auto mode = entityMode()) { |
| 267 | if (*mode == EntityMode::Master && connectionForEntity(entityId()) != ServerConnectionId) { |
| 268 | PolyF poly = m_movementController->collisionPoly(); |
| 269 | m_movementController->setCollisionPoly({ { 0.0f, -3.402823466e+38F }}); |
| 270 | auto result = m_netGroup.writeNetState(fromVersion, rules); |
| 271 | m_movementController->setCollisionPoly(poly); |
| 272 | return result; |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | return m_netGroup.writeNetState(fromVersion, rules); |
| 278 | } |
| 279 | |
| 280 | void Npc::readNetState(ByteArray data, float interpolationTime, NetCompatibilityRules rules) { |
| 281 | m_netGroup.readNetState(data, interpolationTime, rules); |