Suppress pizzeria clicks in multiplayer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Semmler 2026-03-27 11:43:51 -07:00
parent 32b2834c0b
commit c2901d1226
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
2 changed files with 14 additions and 1 deletions

View File

@ -1,11 +1,14 @@
#include "isleactor.h" #include "isleactor.h"
#include "extensions/multiplayer.h"
#include "legoentity.h" #include "legoentity.h"
#include "legoworld.h" #include "legoworld.h"
#include "misc.h" #include "misc.h"
#include "mxnotificationparam.h" #include "mxnotificationparam.h"
#include "scripts.h" #include "scripts.h"
using namespace Extensions;
DECOMP_SIZE_ASSERT(IsleActor, 0x7c) DECOMP_SIZE_ASSERT(IsleActor, 0x7c)
// FUNCTION: LEGO1 0x1002c780 // FUNCTION: LEGO1 0x1002c780
@ -45,7 +48,12 @@ MxLong IsleActor::Notify(MxParam& p_param)
result = HandleButtonDown((LegoControlManagerNotificationParam&) p_param); result = HandleButtonDown((LegoControlManagerNotificationParam&) p_param);
break; break;
case c_notificationClick: case c_notificationClick:
if (Extension<MultiplayerExt>::Call(MP::HandleEntityNotify, (LegoEntity*) this).value_or(FALSE)) {
result = 1;
}
else {
result = HandleClick(); result = HandleClick();
}
break; break;
case c_notificationEndAnim: case c_notificationEndAnim:
result = HandleEndAnim(); result = HandleEndAnim();

View File

@ -152,6 +152,11 @@ MxBool MultiplayerExt::HandleEntityNotify(LegoEntity* p_entity)
return FALSE; return FALSE;
} }
// Suppress pizzeria clicks entirely in multiplayer
if (p_entity->IsA("Pizzeria") && s_networkManager->IsConnected()) {
return TRUE;
}
// Only intercept plants and buildings // Only intercept plants and buildings
MxU8 type = p_entity->GetType(); MxU8 type = p_entity->GetType();
if (type != LegoEntity::e_plant && type != LegoEntity::e_building) { if (type != LegoEntity::e_plant && type != LegoEntity::e_building) {