Add support for road stop animation, availability callback

Add animation, callback mask, general flags properties
Add animation frame variables
This commit is contained in:
Jonathan G Rennison
2022-02-15 00:22:18 +00:00
parent 0c3988c39b
commit 23c472d2a0
22 changed files with 329 additions and 44 deletions

View File

@@ -22,6 +22,7 @@
#include "newgrf_debug.h"
#include "newgrf_sound.h"
#include "newgrf_station.h"
#include "newgrf_roadstop.h"
#include "group_gui.h"
#include "strings_func.h"
#include "zoom_func.h"
@@ -3418,6 +3419,13 @@ void Vehicle::LeaveStation()
SetBit(Train::From(this)->flags, VRF_LEAVING_STATION);
}
if (this->type == VEH_ROAD && !(this->vehstatus & VS_CRASHED)) {
/* Trigger road stop animation */
if (IsAnyRoadStopTile(this->tile)) {
TriggerRoadStopRandomisation(st, this->tile, RSRT_VEH_DEPARTS);
TriggerRoadStopAnimation(st, this->tile, SAT_TRAIN_DEPARTS);
}
}
if (this->cur_real_order_index < this->GetNumOrders()) {
Order *real_current_order = this->GetOrder(this->cur_real_order_index);