HackedNPC code section offset same as Cubot

This commit is contained in:
simon 2018-12-23 12:47:32 -05:00
parent 0973548b71
commit 0dbec1d258
2 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,7 @@ public class HackedNPC extends NonPlayerCharacter implements ControllableUnit {
cpu.setMemory(new Memory(MEM_SIZE));
cpu.setHardwareHost(this);
cpu.getMemory().write(0, program, 0, program.length);
cpu.getMemory().write(cpu.getCodeSectionOffset(), program, 0, program.length);
for (Object serialisedHw : (List) NpcPlugin.DEFAULT_HACKED_NPC.get("hardware")) {
HardwareModule hardware = GameServer.INSTANCE.getRegistry().deserializeHardware((Document) serialisedHw, this);

View File

@ -433,6 +433,10 @@ public class CPU implements MongoSerializable {
this.ip = ip;
}
public int getCodeSectionOffset() {
return codeSectionOffset;
}
public void setCodeSectionOffset(int codeSectionOffset) {
this.codeSectionOffset = codeSectionOffset;
}