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) {
|
||||
// client-side npcs error nearby vanilla NPC scripts because callScriptedEntity
|
||||
// for now, scrungle the collision poly to avoid their queries. hacky :(
|
||||
if (auto mode = entityMode()) {
|
||||
if (*mode == EntityMode::Master && connectionForEntity(entityId()) != ServerConnectionId) {
|
||||
PolyF poly = m_movementController->collisionPoly();
|
||||
m_movementController->setCollisionPoly({ { 0.0f, -FLT_MAX } });
|
||||
auto result = m_netGroup.writeNetState(fromVersion);
|
||||
m_movementController->setCollisionPoly(poly);
|
||||
return result;
|
||||
if (m_npcVariant.overrides.getBool("overrideNetPoly", false)) {
|
||||
if (auto mode = entityMode()) {
|
||||
if (*mode == EntityMode::Master && connectionForEntity(entityId()) != ServerConnectionId) {
|
||||
PolyF poly = m_movementController->collisionPoly();
|
||||
m_movementController->setCollisionPoly({ { 0.0f, -FLT_MAX } });
|
||||
auto result = m_netGroup.writeNetState(fromVersion);
|
||||
m_movementController->setCollisionPoly(poly);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user