mirror of
				https://github.com/simon987/Much-Assembly-Required.git
				synced 2025-11-04 01:56:53 +00:00 
			
		
		
		
	HackedNPC code section offset same as Cubot
This commit is contained in:
		
							parent
							
								
									0973548b71
								
							
						
					
					
						commit
						0dbec1d258
					
				@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user