mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r1532) -Fix: [1103078] default service period patch options are now cast to 0 with right variable size.
This commit is contained in:
parent
6e07bad728
commit
d41a003bcc
@ -737,7 +737,18 @@ static void WritePE(const PatchEntry *pe, int32 val)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if ((pe->flags & PF_0ISDIS) && val <= 0) {
|
if ((pe->flags & PF_0ISDIS) && val <= 0) {
|
||||||
*(bool*)pe->variable = 0; // "clamp" 'disabled' value to smallest type, PE_BOOL
|
// "clamp" 'disabled' value to smallest type
|
||||||
|
switch (pe->type) {
|
||||||
|
case PE_BOOL: case PE_UINT8:
|
||||||
|
*(bool*)pe->variable = 0;
|
||||||
|
break;
|
||||||
|
case PE_INT16: case PE_UINT16:
|
||||||
|
*(int16*)pe->variable = 0;
|
||||||
|
break;
|
||||||
|
case PE_CURRENCY: case PE_INT32:
|
||||||
|
*(int32*)pe->variable = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user