fix filtering on object selection

This commit is contained in:
Ted John committed 2016-07-08 22:58:38 +01:00
1 parent 840179299c
commit db304cdfcb
8 files changed
+84 -61

No files matched your search

+21 -9
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;
}