1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Make suggested changes

This commit is contained in:
duncanspumpkin
2020-06-07 15:54:07 +01:00
parent 5c48e5f0bb
commit efdabd8880

View File

@@ -36,12 +36,11 @@ struct SpriteBase
template<typename T> bool Is() const;
template<typename T> T* As()
{
T* result = nullptr;
if (Is<T>())
{
result = reinterpret_cast<T*>(this);
}
return result;
return Is<T>() ? reinterpret_cast<T*>(this) : nullptr;
}
template<typename T> const T* As() const
{
return Is<T>() ? reinterpret_cast<const T*>(this) : nullptr;
}
};