diff options
author | yexo <yexo@openttd.org> | 2009-02-14 21:15:23 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-02-14 21:15:23 +0000 |
commit | 8583274f183dd88c7488d35e36efe340033bed76 (patch) | |
tree | a8c637f9f38f7524dd62134a1470a14b779c0748 /src/ai/api/ai_station.hpp.sq | |
parent | a79524c805ff0f6cc20f8e21c40433f9240a5e9f (diff) | |
download | openttd-8583274f183dd88c7488d35e36efe340033bed76.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.sq | 5 |
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); |