Fix cast to bool in map element functions

This commit is contained in:
Michael Steenbeek 2017-08-01 13:42:50 +02:00 committed by GitHub
parent ee443818a8
commit 2f3a30f22b
3 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@ extern "C" {
// This define specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "15"
#define NETWORK_STREAM_VERSION "16"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
#ifdef __cplusplus

View File

@ -2886,7 +2886,7 @@ void map_element_set_track_sequence(rct_map_element * mapElement, sint32 trackSe
bool map_element_get_green_light(const rct_map_element * mapElement)
{
return (bool)mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT;
return (mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT) != 0;
}
void map_element_set_green_light(rct_map_element * mapElement, bool greenLight)
@ -2910,7 +2910,7 @@ void map_element_set_brake_booster_speed(rct_map_element *mapElement, sint32 spe
bool map_element_is_taking_photo(const rct_map_element * mapElement)
{
return (bool)mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK;
return (mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK) != 0;
}
void map_element_set_onride_photo_timeout(rct_map_element * mapElement)

View File

@ -164,7 +164,7 @@ void map_element_set_track_sequence(rct_map_element * mapElement, int trackSeque
bool map_element_get_green_light(const rct_map_element * mapElement)
{
return (bool)mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT;
return (mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT) != 0;
}
void map_element_set_green_light(rct_map_element * mapElement, bool greenLight)
@ -188,7 +188,7 @@ void map_element_set_brake_booster_speed(rct_map_element *mapElement, int speed)
bool map_element_is_taking_photo(const rct_map_element * mapElement)
{
return (bool)mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK;
return (mapElement->properties.track.sequence & MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK) != 0;
}
void map_element_set_onride_photo_timeout(rct_map_element * mapElement)