Added asserts in Interpreter::installSegmentX methods.

Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
actorid
Lukasz Gromanowski 11 years ago
parent cb04f43384
commit 50b6e828cc

@ -25,9 +25,9 @@ namespace Compiler
const int opcodeAiFollowExplicit = 0x20023;
const int opcodeAiFollowCell = 0x20024;
const int opcodeAiFollowCellExplicit = 0x20025;
const int opcodeSetHello = 0x200015e;
const int opcodeSetHello = 0x200015e; // Same id as opcodeSetFight
const int opcodeSetHelloExplicit = 0x200015d;
const int opcodeSetFight = 0x200015e;
const int opcodeSetFight = 0x200015e; // Same id as opcodeSetHello
const int opcodeSetFightExplicit = 0x200015f;
const int opcodeSetFlee = 0x2000160;
const int opcodeSetFleeExplicit = 0x2000161;
@ -69,7 +69,7 @@ namespace Compiler
{
const int opcodeCellChanged = 0x2000000;
const int opcodeCOC = 0x2000026;
const int opcodeCOE = 0x200008e;
const int opcodeCOE = 0x200008e; // Same ID as opcodeGetSkill
const int opcodeGetInterior = 0x2000131;
const int opcodeGetPCCell = 0x2000136;
const int opcodeGetWaterLevel = 0x2000141;
@ -290,7 +290,7 @@ namespace Compiler
const int opcodeGetDynamicGetRatio = 0x200006f;
const int opcodeGetDynamicGetRatioExplicit = 0x2000072;
const int opcodeGetSkill = 0x200008e;
const int opcodeGetSkill = 0x200008e; // Same ID as opcodeCOE
const int opcodeGetSkillExplicit = 0x20000a9;
const int opcodeSetSkill = 0x20000c4;
const int opcodeSetSkillExplicit = 0x20000df;

@ -166,31 +166,37 @@ namespace Interpreter
void Interpreter::installSegment0 (int code, Opcode1 *opcode)
{
assert(mSegment0.find(code) == mSegment0.end());
mSegment0.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment1 (int code, Opcode2 *opcode)
{
assert(mSegment1.find(code) == mSegment1.end());
mSegment1.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment2 (int code, Opcode1 *opcode)
{
assert(mSegment2.find(code) == mSegment2.end());
mSegment2.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment3 (int code, Opcode1 *opcode)
{
assert(mSegment3.find(code) == mSegment3.end());
mSegment3.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment4 (int code, Opcode2 *opcode)
{
assert(mSegment4.find(code) == mSegment4.end());
mSegment4.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment5 (int code, Opcode0 *opcode)
{
assert(mSegment5.find(code) == mSegment5.end());
mSegment5.insert (std::make_pair (code, opcode));
}

Loading…
Cancel
Save