mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-02 02:23:56 +00:00
Suppress pizzeria clicks in multiplayer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
32b2834c0b
commit
c2901d1226
@ -1,11 +1,14 @@
|
||||
#include "isleactor.h"
|
||||
|
||||
#include "extensions/multiplayer.h"
|
||||
#include "legoentity.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "mxnotificationparam.h"
|
||||
#include "scripts.h"
|
||||
|
||||
using namespace Extensions;
|
||||
|
||||
DECOMP_SIZE_ASSERT(IsleActor, 0x7c)
|
||||
|
||||
// FUNCTION: LEGO1 0x1002c780
|
||||
@ -45,7 +48,12 @@ MxLong IsleActor::Notify(MxParam& p_param)
|
||||
result = HandleButtonDown((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationClick:
|
||||
result = HandleClick();
|
||||
if (Extension<MultiplayerExt>::Call(MP::HandleEntityNotify, (LegoEntity*) this).value_or(FALSE)) {
|
||||
result = 1;
|
||||
}
|
||||
else {
|
||||
result = HandleClick();
|
||||
}
|
||||
break;
|
||||
case c_notificationEndAnim:
|
||||
result = HandleEndAnim();
|
||||
|
||||
@ -152,6 +152,11 @@ MxBool MultiplayerExt::HandleEntityNotify(LegoEntity* p_entity)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Suppress pizzeria clicks entirely in multiplayer
|
||||
if (p_entity->IsA("Pizzeria") && s_networkManager->IsConnected()) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Only intercept plants and buildings
|
||||
MxU8 type = p_entity->GetType();
|
||||
if (type != LegoEntity::e_plant && type != LegoEntity::e_building) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user