summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_station.hpp.sq
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-14 21:15:23 +0000
committeryexo <yexo@openttd.org>2009-02-14 21:15:23 +0000
commitbce1bcb0f27affa6678c3f657c06955afbf4b47b (patch)
treea8c637f9f38f7524dd62134a1470a14b779c0748 /src/ai/api/ai_station.hpp.sq
parent5a5bc8ab523a27d5d419443a4c19e08778d7974a (diff)
downloadopenttd-bce1bcb0f27affa6678c3f657c06955afbf4b47b.tar.xz
(svn r15488) -Change [API CHANGE]: Add support for distant-join stations.
Diffstat (limited to 'src/ai/api/ai_station.hpp.sq')
-rw-r--r--src/ai/api/ai_station.hpp.sq5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ai/api/ai_station.hpp.sq b/src/ai/api/ai_station.hpp.sq
index be83b9d20..d820f94dc 100644
--- a/src/ai/api/ai_station.hpp.sq
+++ b/src/ai/api/ai_station.hpp.sq
@@ -9,6 +9,8 @@ namespace SQConvert {
template <> int Return<AIStation::ErrorMessages>(HSQUIRRELVM vm, AIStation::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> AIStation::StationType GetParam(ForceType<AIStation::StationType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIStation::StationType)tmp; }
template <> int Return<AIStation::StationType>(HSQUIRRELVM vm, AIStation::StationType res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> AIStation::SpecialStationIDs GetParam(ForceType<AIStation::SpecialStationIDs>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIStation::SpecialStationIDs)tmp; }
+ template <> int Return<AIStation::SpecialStationIDs>(HSQUIRRELVM vm, AIStation::SpecialStationIDs res) { sq_pushinteger(vm, (int32)res); return 1; }
/* Allow AIStation to be used as Squirrel parameter */
template <> AIStation *GetParam(ForceType<AIStation *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIStation *)instance; }
@@ -34,6 +36,9 @@ void SQAIStation_Register(Squirrel *engine) {
SQAIStation.DefSQConst(engine, AIStation::STATION_AIRPORT, "STATION_AIRPORT");
SQAIStation.DefSQConst(engine, AIStation::STATION_DOCK, "STATION_DOCK");
SQAIStation.DefSQConst(engine, AIStation::STATION_ANY, "STATION_ANY");
+ SQAIStation.DefSQConst(engine, AIStation::STATION_NEW, "STATION_NEW");
+ SQAIStation.DefSQConst(engine, AIStation::STATION_JOIN_ADJACENT, "STATION_JOIN_ADJACENT");
+ SQAIStation.DefSQConst(engine, AIStation::STATION_INVALID, "STATION_INVALID");
AIError::RegisterErrorMap(STR_306C_STATION_TOO_SPREAD_OUT, AIStation::ERR_STATION_TOO_LARGE);
AIError::RegisterErrorMap(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT, AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION);