1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 20:13:07 +01:00

fix filtering on object selection

This commit is contained in:
Ted John
2016-06-29 22:15:38 +01:00
parent 840179299c
commit db304cdfcb
8 changed files with 84 additions and 61 deletions

View File

@@ -17,6 +17,7 @@
#include "../core/IStream.hpp"
#include "../core/Memory.hpp"
#include "../core/Util.hpp"
#include "ObjectRepository.h"
#include "RideObject.h"
extern "C"
@@ -317,15 +318,6 @@ void RideObject::Load()
}
}
}
// TODO sort out this filter stuff
int di = _legacyType.ride_type[0] | (_legacyType.ride_type[1] << 8) | (_legacyType.ride_type[2] << 16);
if ((_legacyType.flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) &&
!rideTypeShouldLoseSeparateFlag(&_legacyType))
{
di |= 0x1000000;
}
RCT2_GLOBAL(0xF433DD, uint32) = di;
}
void RideObject::Unload()
@@ -352,3 +344,23 @@ const utf8 * RideObject::GetCapacity()
const utf8 * capacity = GetStringTable()->GetString(OBJ_STRING_ID_CAPACITY);
return capacity != nullptr ? capacity : "";
}
void RideObject::SetRepositoryItem(ObjectRepositoryItem * item) const
{
for (int i = 0; i < 3; i++)
{
item->RideType[i] = _legacyType.ride_type[i];
}
for (int i = 0; i < 2; i++)
{
item->RideCategory[i] = _legacyType.category[i];
}
uint8 flags = 0;
if ((_legacyType.flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) &&
!rideTypeShouldLoseSeparateFlag(&_legacyType))
{
flags |= 0x1000000;
}
item->RideFlags = flags;
}