Codechange: Make GetRegister return a signed integer, matching the underlying TemporaryStorageArray.

This commit is contained in:
frosch
2025-05-05 19:39:39 +02:00
committed by frosch
parent 74030a63e6
commit 99d7a775ad
8 changed files with 17 additions and 17 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 = GetRegister(0x100);
uint32_t grfid = static_cast<uint32_t>(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 = GetRegister(0x100);
uint32_t grfid = static_cast<uint32_t>(GetRegister(0x100));
/* A NewGRF can only write in the persistent storage associated to its own GRFID. */
if (grfid == 0xFFFFFFFF) grfid = this->ro.grffile->grfid;