VarAction2: Inline procedure calls in more cases

Increase max procedure size limit
Allow all global variables
Allow industry variables: 67, 68
This commit is contained in:
Jonathan G Rennison
2023-12-23 16:49:31 +00:00
parent d5a7a67b8c
commit 39917e8ab2
2 changed files with 31 additions and 8 deletions

View File

@@ -224,6 +224,11 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout
const IndustrySpec *indspec = GetIndustrySpec(this->type);
if (this->industry == nullptr) {
/* Unconditionally allow these, with a dummy result, so that they can be considered always available for optimisation purposes */
if (variable == 0x67 || variable == 0x68) {
return 0 | 0xFFFF;
}
DEBUG(grf, 1, "Unhandled variable 0x%X (no available industry) in callback 0x%x", variable, this->ro.callback);
extra->available = false;