author | rubidium |
Mon, 07 Apr 2008 18:32:42 +0000 | |
branch | noai |
changeset 10088 | 922c6e6a8d3e |
parent 9871 | dfafb0cf20ee |
child 10089 | e351169bf3a5 |
permissions | -rw-r--r-- |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
1 |
#include "ai_error.hpp" |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
2 |
|
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
3 |
namespace SQConvert { |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
4 |
/* Allow enums to be used as Squirrel parameters */ |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
5 |
template <> AIError::ErrorCategories GetParam(ForceType<AIError::ErrorCategories>, HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIError::ErrorCategories)tmp; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
6 |
template <> int Return<AIError::ErrorCategories>(HSQUIRRELVM vm, AIError::ErrorCategories res) { sq_pushinteger(vm, (int32)res); return 1; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
7 |
template <> AIError::ErrorMessages GetParam(ForceType<AIError::ErrorMessages>, HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIError::ErrorMessages)tmp; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
8 |
template <> int Return<AIError::ErrorMessages>(HSQUIRRELVM vm, AIError::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
9 |
|
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
10 |
/* Allow AIError to be used as Squirrel parameter */ |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
11 |
template <> AIError *GetParam(ForceType<AIError *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIError *)instance; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
12 |
template <> AIError &GetParam(ForceType<AIError &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIError *)instance; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
13 |
template <> const AIError *GetParam(ForceType<const AIError *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIError *)instance; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
14 |
template <> const AIError &GetParam(ForceType<const AIError &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIError *)instance; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
15 |
template <> int Return<AIError *>(HSQUIRRELVM vm, AIError *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIError", res, NULL, DefSQDestructorCallback<AIError>); return 1; } |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
16 |
}; // namespace SQConvert |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
17 |
|
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
18 |
void SQAIError_Register(Squirrel *engine) { |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
19 |
DefSQClass <AIError> SQAIError("AIError"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
20 |
SQAIError.PreRegister(engine); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
21 |
SQAIError.AddConstructor<void (AIError::*)(), 1>(engine, "x"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
22 |
|
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
23 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_NONE, "ERR_CAT_NONE"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
24 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_GENERAL, "ERR_CAT_GENERAL"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
25 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_VEHICLE, "ERR_CAT_VEHICLE"); |
9867
b7d9ffe24f81
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents:
9865
diff
changeset
|
26 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_STATION, "ERR_CAT_STATION"); |
b7d9ffe24f81
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents:
9865
diff
changeset
|
27 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_BRIDGE, "ERR_CAT_BRIDGE"); |
10088
922c6e6a8d3e
(svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents:
9871
diff
changeset
|
28 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_TUNNEL, "ERR_CAT_TUNNEL"); |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
29 |
SQAIError.DefSQConst(engine, AIError::ERR_CAT_BIT_SIZE, "ERR_CAT_BIT_SIZE"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
30 |
SQAIError.DefSQConst(engine, AIError::ERR_NONE, "ERR_NONE"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
31 |
SQAIError.DefSQConst(engine, AIError::ERR_UNKNOWN, "ERR_UNKNOWN"); |
9863
73647fe2e301
(svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents:
9861
diff
changeset
|
32 |
SQAIError.DefSQConst(engine, AIError::ERR_PRECONDITION_FAILED, "ERR_PRECONDITION_FAILED"); |
9871
dfafb0cf20ee
(svn r12603) [NoAI] -Add: 'support' for telling AIs that the last error message was a NewGRF generated message, so we can't say anything sensible about the real error message.
rubidium
parents:
9867
diff
changeset
|
33 |
SQAIError.DefSQConst(engine, AIError::ERR_NEWGRF_SUPPLIED_ERROR, "ERR_NEWGRF_SUPPLIED_ERROR"); |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
34 |
SQAIError.DefSQConst(engine, AIError::ERR_GENERAL_BASE, "ERR_GENERAL_BASE"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
35 |
SQAIError.DefSQConst(engine, AIError::ERR_NOT_ENOUGH_CASH, "ERR_NOT_ENOUGH_CASH"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
36 |
SQAIError.DefSQConst(engine, AIError::ERR_LOCAL_AUTHORITY_REFUSES, "ERR_LOCAL_AUTHORITY_REFUSES"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
37 |
SQAIError.DefSQConst(engine, AIError::ERR_ALREADY_BUILT, "ERR_ALREADY_BUILT"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
38 |
SQAIError.DefSQConst(engine, AIError::ERR_AREA_NOT_CLEAR, "ERR_AREA_NOT_CLEAR"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
39 |
SQAIError.DefSQConst(engine, AIError::ERR_AREA_IS_OWNED_BY_ANOTHER_COMPANY, "ERR_AREA_IS_OWNED_BY_ANOTHER_COMPANY"); |
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
40 |
SQAIError.DefSQConst(engine, AIError::ERR_NAME_IS_NOT_UNIQUE, "ERR_NAME_IS_NOT_UNIQUE"); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
41 |
SQAIError.DefSQConst(engine, AIError::ERR_FLAT_LAND_REQUIRED, "ERR_FLAT_LAND_REQUIRED"); |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
42 |
|
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
43 |
AIError::RegisterErrorMap(STR_0003_NOT_ENOUGH_CASH_REQUIRES, AIError::ERR_NOT_ENOUGH_CASH); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
44 |
AIError::RegisterErrorMap(STR_2009_LOCAL_AUTHORITY_REFUSES, AIError::ERR_LOCAL_AUTHORITY_REFUSES); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
45 |
AIError::RegisterErrorMap(STR_1007_ALREADY_BUILT, AIError::ERR_ALREADY_BUILT); |
9867
b7d9ffe24f81
(svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents:
9865
diff
changeset
|
46 |
AIError::RegisterErrorMap(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST, AIError::ERR_ALREADY_BUILT); |
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
47 |
AIError::RegisterErrorMap(STR_2004_BUILDING_MUST_BE_DEMOLISHED, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
48 |
AIError::RegisterErrorMap(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
49 |
AIError::RegisterErrorMap(STR_300B_MUST_DEMOLISH_RAILROAD, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
50 |
AIError::RegisterErrorMap(STR_300E_MUST_DEMOLISH_AIRPORT_FIRST, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
51 |
AIError::RegisterErrorMap(STR_MUST_DEMOLISH_CARGO_TRAM_STATION, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
52 |
AIError::RegisterErrorMap(STR_3047_MUST_DEMOLISH_TRUCK_STATION, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
53 |
AIError::RegisterErrorMap(STR_MUST_DEMOLISH_PASSENGER_TRAM_STATION, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
54 |
AIError::RegisterErrorMap(STR_3046_MUST_DEMOLISH_BUS_STATION, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
55 |
AIError::RegisterErrorMap(STR_306A_BUOY_IN_THE_WAY, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
56 |
AIError::RegisterErrorMap(STR_304D_MUST_DEMOLISH_DOCK_FIRST, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
57 |
AIError::RegisterErrorMap(STR_4800_IN_THE_WAY, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
58 |
AIError::RegisterErrorMap(STR_5804_COMPANY_HEADQUARTERS_IN, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
59 |
AIError::RegisterErrorMap(STR_5800_OBJECT_IN_THE_WAY, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
60 |
AIError::RegisterErrorMap(STR_1801_MUST_REMOVE_ROAD_FIRST, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
61 |
AIError::RegisterErrorMap(STR_1008_MUST_REMOVE_RAILROAD_TRACK, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
62 |
AIError::RegisterErrorMap(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
63 |
AIError::RegisterErrorMap(STR_5006_MUST_DEMOLISH_TUNNEL_FIRST, AIError::ERR_AREA_NOT_CLEAR); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
64 |
AIError::RegisterErrorMap(STR_1024_AREA_IS_OWNED_BY_ANOTHER, AIError::ERR_AREA_IS_OWNED_BY_ANOTHER_COMPANY); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
65 |
AIError::RegisterErrorMap(STR_NAME_MUST_BE_UNIQUE, AIError::ERR_NAME_IS_NOT_UNIQUE); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
66 |
AIError::RegisterErrorMap(STR_0007_FLAT_LAND_REQUIRED, AIError::ERR_FLAT_LAND_REQUIRED); |
9861
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
67 |
|
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
68 |
AIError::RegisterErrorMapString(AIError::ERR_NONE, "ERR_NONE"); |
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
69 |
AIError::RegisterErrorMapString(AIError::ERR_UNKNOWN, "ERR_UNKNOWN"); |
9863
73647fe2e301
(svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents:
9861
diff
changeset
|
70 |
AIError::RegisterErrorMapString(AIError::ERR_PRECONDITION_FAILED, "ERR_PRECONDITION_FAILED"); |
9871
dfafb0cf20ee
(svn r12603) [NoAI] -Add: 'support' for telling AIs that the last error message was a NewGRF generated message, so we can't say anything sensible about the real error message.
rubidium
parents:
9867
diff
changeset
|
71 |
AIError::RegisterErrorMapString(AIError::ERR_NEWGRF_SUPPLIED_ERROR, "ERR_NEWGRF_SUPPLIED_ERROR"); |
9861
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
72 |
AIError::RegisterErrorMapString(AIError::ERR_NOT_ENOUGH_CASH, "ERR_NOT_ENOUGH_CASH"); |
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
73 |
AIError::RegisterErrorMapString(AIError::ERR_LOCAL_AUTHORITY_REFUSES, "ERR_LOCAL_AUTHORITY_REFUSES"); |
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
74 |
AIError::RegisterErrorMapString(AIError::ERR_ALREADY_BUILT, "ERR_ALREADY_BUILT"); |
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
75 |
AIError::RegisterErrorMapString(AIError::ERR_AREA_NOT_CLEAR, "ERR_AREA_NOT_CLEAR"); |
53fc03195e31
(svn r12544) [NoAI] -Codechange: do not force dependency on OTTD internal strings when defining errors.
rubidium
parents:
9844
diff
changeset
|
76 |
AIError::RegisterErrorMapString(AIError::ERR_AREA_IS_OWNED_BY_ANOTHER_COMPANY, "ERR_AREA_IS_OWNED_BY_ANOTHER_COMPANY"); |
9865
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
77 |
AIError::RegisterErrorMapString(AIError::ERR_NAME_IS_NOT_UNIQUE, "ERR_NAME_IS_NOT_UNIQUE"); |
f241472f09dc
(svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents:
9863
diff
changeset
|
78 |
AIError::RegisterErrorMapString(AIError::ERR_FLAT_LAND_REQUIRED, "ERR_FLAT_LAND_REQUIRED"); |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
79 |
|
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
80 |
SQAIError.DefSQStaticMethod(engine, &AIError::GetClassName, "GetClassName", 1, "x"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
81 |
SQAIError.DefSQStaticMethod(engine, &AIError::GetErrorCategory, "GetErrorCategory", 1, "x"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
82 |
SQAIError.DefSQStaticMethod(engine, &AIError::GetLastError, "GetLastError", 1, "x"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
83 |
SQAIError.DefSQStaticMethod(engine, &AIError::GetLastErrorString, "GetLastErrorString", 1, "x"); |
9863
73647fe2e301
(svn r12552) [NoAI] -Change: do not force the use of StringIDs when setting errors.
rubidium
parents:
9861
diff
changeset
|
84 |
SQAIError.DefSQStaticMethod(engine, &AIError::StringToError, "StringToError", 2, "xi"); |
9844
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
85 |
SQAIError.DefSQStaticMethod(engine, &AIError::RegisterErrorMap, "RegisterErrorMap", 3, "xii"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
86 |
SQAIError.DefSQStaticMethod(engine, &AIError::RegisterErrorMapString, "RegisterErrorMapString", 3, "xis"); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
87 |
|
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
88 |
SQAIError.PostRegister(engine); |
738b8f69675f
(svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents:
diff
changeset
|
89 |
} |