Codechange: Access temporary storage through ResolverObject during Resolve.

This commit is contained in:
frosch
2025-05-05 21:28:51 +02:00
committed by frosch
parent 99d7a775ad
commit 85be7a4d92
9 changed files with 59 additions and 34 deletions

View File

@@ -36,7 +36,7 @@
/* Get a variable from the persistent storage */
case 0x7C: {
/* Check the persistent storage for the GrfID stored in register 100h. */
uint32_t grfid = static_cast<uint32_t>(GetRegister(0x100));
uint32_t grfid = static_cast<uint32_t>(this->ro.GetRegister(0x100));
if (grfid == 0xFFFFFFFF) {
if (this->ro.grffile == nullptr) return 0;
grfid = this->ro.grffile->grfid;
@@ -132,7 +132,7 @@
if (this->ro.grffile == nullptr) return;
/* Check the persistent storage for the GrfID stored in register 100h. */
uint32_t grfid = static_cast<uint32_t>(GetRegister(0x100));
uint32_t grfid = static_cast<uint32_t>(this->ro.GetRegister(0x100));
/* A NewGRF can only write in the persistent storage associated to its own GRFID. */
if (grfid == 0xFFFFFFFF) grfid = this->ro.grffile->grfid;