mirror of https://github.com/OpenRCT2/OpenRCT2.git
Rename VAR_C4 (#16217)
This commit is contained in:
parent
66b402ccf6
commit
05b80acfa1
|
@ -435,7 +435,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots
|
|||
COMPARE_FIELD(Vehicle, cable_lift_target);
|
||||
COMPARE_FIELD(Vehicle, speed);
|
||||
COMPARE_FIELD(Vehicle, powered_acceleration);
|
||||
COMPARE_FIELD(Vehicle, var_C4);
|
||||
COMPARE_FIELD(Vehicle, CollisionDetectionTimer);
|
||||
COMPARE_FIELD(Vehicle, animation_frame);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
|
|
|
@ -1814,7 +1814,7 @@ namespace OpenRCT2
|
|||
cs.ReadWrite(entity.time_waiting);
|
||||
cs.ReadWrite(entity.speed);
|
||||
cs.ReadWrite(entity.powered_acceleration);
|
||||
cs.ReadWrite(entity.dodgems_collision_direction);
|
||||
cs.ReadWrite(entity.CollisionDetectionTimer);
|
||||
cs.ReadWrite(entity.animation_frame);
|
||||
if (cs.GetMode() == OrcaStream::Mode::READING && os.GetHeader().TargetVersion <= 2)
|
||||
{
|
||||
|
|
|
@ -373,7 +373,11 @@ namespace RCT1
|
|||
};
|
||||
uint8_t speed; // 0xC2
|
||||
uint8_t powered_acceleration; // 0xC3
|
||||
uint8_t var_C4;
|
||||
union
|
||||
{
|
||||
uint8_t DodgemsCollisionDetection; // 0xC4
|
||||
uint8_t CollisionDetectionTimer; // 0xC4
|
||||
};
|
||||
uint8_t animation_frame;
|
||||
uint8_t pad_C6[0x2];
|
||||
uint32_t animationState;
|
||||
|
|
|
@ -2747,7 +2747,7 @@ namespace RCT1
|
|||
dst->sound1_id = OpenRCT2::Audio::SoundId::Null;
|
||||
dst->sound2_id = OpenRCT2::Audio::SoundId::Null;
|
||||
dst->var_C0 = src->var_C0;
|
||||
dst->var_C4 = src->var_C4;
|
||||
dst->CollisionDetectionTimer = src->CollisionDetectionTimer;
|
||||
dst->animation_frame = src->animation_frame;
|
||||
dst->animationState = src->animationState;
|
||||
dst->NumLaps = src->NumLaps;
|
||||
|
|
|
@ -506,8 +506,8 @@ namespace RCT2
|
|||
uint8_t powered_acceleration; // 0xC3
|
||||
union
|
||||
{
|
||||
uint8_t dodgems_collision_direction; // 0xC4
|
||||
uint8_t var_C4;
|
||||
uint8_t DodgemsCollisionDirection; // 0xC4
|
||||
uint8_t CollisionDetectionTimer; // 0xC4
|
||||
};
|
||||
uint8_t animation_frame; // 0xC5
|
||||
uint8_t pad_C6[0x2];
|
||||
|
|
|
@ -1876,7 +1876,7 @@ namespace RCT2
|
|||
dst->time_waiting = src->time_waiting;
|
||||
dst->speed = src->speed;
|
||||
dst->powered_acceleration = src->powered_acceleration;
|
||||
dst->dodgems_collision_direction = src->dodgems_collision_direction;
|
||||
dst->CollisionDetectionTimer = src->CollisionDetectionTimer;
|
||||
dst->animation_frame = src->animation_frame;
|
||||
dst->animationState = src->animationState;
|
||||
dst->scream_sound_id = static_cast<OpenRCT2::Audio::SoundId>(src->scream_sound_id);
|
||||
|
|
|
@ -52,7 +52,7 @@ Vehicle* cable_lift_segment_create(
|
|||
current->sound2_flags = 0;
|
||||
current->sound1_id = OpenRCT2::Audio::SoundId::Null;
|
||||
current->sound2_id = OpenRCT2::Audio::SoundId::Null;
|
||||
current->var_C4 = 0;
|
||||
current->CollisionDetectionTimer = 0;
|
||||
current->animation_frame = 0;
|
||||
current->animationState = 0;
|
||||
current->scream_sound_id = OpenRCT2::Audio::SoundId::Null;
|
||||
|
|
|
@ -3151,7 +3151,7 @@ static Vehicle* vehicle_create_car(
|
|||
vehicle->sound1_id = OpenRCT2::Audio::SoundId::Null;
|
||||
vehicle->sound2_id = OpenRCT2::Audio::SoundId::Null;
|
||||
vehicle->next_vehicle_on_train = EntityId::GetNull();
|
||||
vehicle->var_C4 = 0;
|
||||
vehicle->CollisionDetectionTimer = 0;
|
||||
vehicle->animation_frame = 0;
|
||||
vehicle->animationState = 0;
|
||||
vehicle->scream_sound_id = OpenRCT2::Audio::SoundId::Null;
|
||||
|
|
|
@ -6263,10 +6263,10 @@ int32_t Vehicle::UpdateMotionDodgems()
|
|||
}
|
||||
|
||||
auto collideSprite = EntityId::GetNull();
|
||||
if (dodgems_collision_direction != 0)
|
||||
if (DodgemsCollisionDirection != 0)
|
||||
{
|
||||
uint8_t oldCollisionDirection = dodgems_collision_direction & 0x1E;
|
||||
dodgems_collision_direction = 0;
|
||||
uint8_t oldCollisionDirection = DodgemsCollisionDirection & 0x1E;
|
||||
DodgemsCollisionDirection = 0;
|
||||
|
||||
CoordsXYZ location = { x, y, z };
|
||||
|
||||
|
@ -6327,8 +6327,8 @@ int32_t Vehicle::UpdateMotionDodgems()
|
|||
|
||||
if (oldVelocity >= 131072)
|
||||
{
|
||||
collideVehicle->dodgems_collision_direction = direction;
|
||||
dodgems_collision_direction = direction ^ (1 << 4);
|
||||
collideVehicle->DodgemsCollisionDirection = direction;
|
||||
DodgemsCollisionDirection = direction ^ (1 << 4);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -6337,7 +6337,7 @@ int32_t Vehicle::UpdateMotionDodgems()
|
|||
|
||||
if (oldVelocity >= 131072)
|
||||
{
|
||||
dodgems_collision_direction = direction ^ (1 << 4);
|
||||
DodgemsCollisionDirection = direction ^ (1 << 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7556,7 +7556,7 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth
|
|||
|
||||
if (!(vehicleEntry->flags & VEHICLE_ENTRY_FLAG_BOAT_HIRE_COLLISION_DETECTION))
|
||||
{
|
||||
var_C4 = 0;
|
||||
CollisionDetectionTimer = 0;
|
||||
|
||||
// If hacking boat hire rides you can end up here
|
||||
if (otherVehicleIndex == nullptr)
|
||||
|
@ -7673,12 +7673,12 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth
|
|||
|
||||
if (!mayCollide)
|
||||
{
|
||||
var_C4 = 0;
|
||||
CollisionDetectionTimer = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
var_C4++;
|
||||
if (var_C4 < 200)
|
||||
CollisionDetectionTimer++;
|
||||
if (CollisionDetectionTimer < 200)
|
||||
{
|
||||
SetUpdateFlag(VEHICLE_UPDATE_FLAG_6);
|
||||
if (otherVehicleIndex != nullptr)
|
||||
|
@ -9850,7 +9850,7 @@ void Vehicle::Serialise(DataSerialiser& stream)
|
|||
stream << var_C0;
|
||||
stream << speed;
|
||||
stream << powered_acceleration;
|
||||
stream << dodgems_collision_direction;
|
||||
stream << DodgemsCollisionDirection;
|
||||
stream << animation_frame;
|
||||
stream << animationState;
|
||||
stream << scream_sound_id;
|
||||
|
|
|
@ -180,8 +180,8 @@ struct Vehicle : EntityBase
|
|||
uint8_t powered_acceleration;
|
||||
union
|
||||
{
|
||||
uint8_t dodgems_collision_direction;
|
||||
uint8_t var_C4;
|
||||
uint8_t DodgemsCollisionDirection;
|
||||
uint8_t CollisionDetectionTimer;
|
||||
};
|
||||
uint8_t animation_frame;
|
||||
uint8_t pad_C6[0x2];
|
||||
|
|
Loading…
Reference in New Issue