Make client-side NPC collisionPoly override opt-in
This commit is contained in:
parent
f2afd91d0f
commit
5c650d7809
@ -254,13 +254,15 @@ RectF Npc::collisionArea() const {
|
|||||||
pair<ByteArray, uint64_t> Npc::writeNetState(uint64_t fromVersion) {
|
pair<ByteArray, uint64_t> Npc::writeNetState(uint64_t fromVersion) {
|
||||||
// client-side npcs error nearby vanilla NPC scripts because callScriptedEntity
|
// client-side npcs error nearby vanilla NPC scripts because callScriptedEntity
|
||||||
// for now, scrungle the collision poly to avoid their queries. hacky :(
|
// for now, scrungle the collision poly to avoid their queries. hacky :(
|
||||||
if (auto mode = entityMode()) {
|
if (m_npcVariant.overrides.getBool("overrideNetPoly", false)) {
|
||||||
if (*mode == EntityMode::Master && connectionForEntity(entityId()) != ServerConnectionId) {
|
if (auto mode = entityMode()) {
|
||||||
PolyF poly = m_movementController->collisionPoly();
|
if (*mode == EntityMode::Master && connectionForEntity(entityId()) != ServerConnectionId) {
|
||||||
m_movementController->setCollisionPoly({ { 0.0f, -FLT_MAX } });
|
PolyF poly = m_movementController->collisionPoly();
|
||||||
auto result = m_netGroup.writeNetState(fromVersion);
|
m_movementController->setCollisionPoly({ { 0.0f, -FLT_MAX } });
|
||||||
m_movementController->setCollisionPoly(poly);
|
auto result = m_netGroup.writeNetState(fromVersion);
|
||||||
return result;
|
m_movementController->setCollisionPoly(poly);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user