forked from mirror/OpenTTD
(svn r16422) -Codechange: use const_cast for removing const and warn when const is (accidentally?) removed using C-style casts.
This commit is contained in:
@@ -1396,7 +1396,7 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
|
||||
* map else it's returned as-is. */
|
||||
if (!HasBit(callback, 14)) {
|
||||
/* Update cache */
|
||||
if (v != NULL) ((Vehicle*)v)->colourmap = map;
|
||||
if (v != NULL) const_cast<Vehicle *>(v)->colourmap = map;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -1412,7 +1412,7 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
|
||||
if (twocc) map += livery->colour2 * 16;
|
||||
|
||||
/* Update cache */
|
||||
if (v != NULL) ((Vehicle*)v)->colourmap = map;
|
||||
if (v != NULL) const_cast<Vehicle *>(v)->colourmap = map;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user