mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
MTROPOLIS: Add another variable reference hack to fix Hispaniola not transitioning to night in MTI
This commit is contained in:
parent
cc0cc74a87
commit
464834000f
@ -2770,6 +2770,16 @@ Modifier *CompoundVariableModifier::findChildByName(Runtime *runtime, const Comm
|
||||
if (modifier)
|
||||
return modifier;
|
||||
}
|
||||
|
||||
if (myName.size() == 1 && myName == "g") {
|
||||
if (caseInsensitiveEqual(name, "choresdone") || caseInsensitiveEqual(name, "donechore")) {
|
||||
Project *project = runtime->getProject();
|
||||
Modifier *modifier = project->findGlobalVarWithName(MTropolis::toCaseInsensitive(name)).get();
|
||||
|
||||
if (modifier)
|
||||
return modifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Common::Array<Common::SharedPtr<Modifier> >::const_iterator it = _children.begin(), itEnd = _children.end(); it != itEnd; ++it) {
|
||||
@ -2814,10 +2824,20 @@ CompoundVariableModifier::SaveLoad::SaveLoad(Runtime *runtime, CompoundVariableM
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (const Common::SharedPtr<Modifier> &child : modifier->_children) {
|
||||
if (isMTIHackGlobalContainer) {
|
||||
bool loadFromGlobal = false;
|
||||
|
||||
if (isMTIHackGlobalContainer)
|
||||
loadFromGlobal = true;
|
||||
else if (isMTIHackG) {
|
||||
// Hack to fix Hispaniola not transitioning to night
|
||||
loadFromGlobal = caseInsensitiveEqual(child->getName(), "choresdone") || caseInsensitiveEqual(child->getName(), "donechore");
|
||||
}
|
||||
|
||||
if (loadFromGlobal) {
|
||||
Common::SharedPtr<Modifier> globalVarModifier = runtime->getProject()->findGlobalVarWithName(child->getName());
|
||||
|
||||
if (globalVarModifier) {
|
||||
|
@ -9324,6 +9324,15 @@ DynamicValueWriteProxy VariableModifier::createWriteProxy() {
|
||||
return proxy;
|
||||
}
|
||||
|
||||
#ifdef MTROPOLIS_DEBUG_ENABLE
|
||||
void VariableModifier::debugInspect(IDebugInspectionReport *report) const {
|
||||
Modifier::debugInspect(report);
|
||||
|
||||
if (report->declareStatic("storage"))
|
||||
report->declareStaticContents(Common::String::format("%p", _storage.get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
MiniscriptInstructionOutcome VariableModifier::WriteProxyInterface::write(MiniscriptThread *thread, const DynamicValue &dest, void *objectRef, uintptr ptrOrOffset) {
|
||||
if (!static_cast<VariableModifier *>(objectRef)->varSetValue(thread, dest))
|
||||
return kMiniscriptInstructionOutcomeFailed;
|
||||
|
@ -3010,6 +3010,10 @@ public:
|
||||
|
||||
virtual DynamicValueWriteProxy createWriteProxy();
|
||||
|
||||
#ifdef MTROPOLIS_DEBUG_ENABLE
|
||||
void debugInspect(IDebugInspectionReport *report) const override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
VariableModifier() = delete;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user