Thread: need help with this

Results 1 to 3 of 3
  1. #1 need help with this 
    Registered Member shoopdawhoop's Avatar
    Join Date
    Apr 2009
    Posts
    685
    Thanks given
    10
    Thanks received
    19
    Rep Power
    57
    something here (i think) prevents NPC's past 3851 to be loaded as i coded them (clientside)
    can anyone tell what line the problem is on?
    Code:
    	public void updateNPC(Player plr, stream str) {
    		updateBlock.currentOffset = 0;
    
    		str.createFrameVarSizeWord(65);
    		str.initBitAccess();
    
    		str.writeBits(8, plr.npcListSize);
    		int size = plr.npcListSize;
    		plr.npcListSize = 0;
    		for (int i = 0; i < size; i++) {
    			if ((plr.RebuildNPCList == false)
    					&& (plr.withinDistance(plr.npcList[i]) == true)) {
    				plr.npcList[i].updateNPCMovement(str);
    				plr.npcList[i].appendNPCUpdateBlock(updateBlock);
    				plr.npcList[plr.npcListSize++] = plr.npcList[i];
    			} else {
    				int id = plr.npcList[i].npcId;
    				plr.npcInListBitmap[id >> 3] &= ~(1 << (id & 70)); // clear the
    				// flag
    				str.writeBits(1, 1);
    				str.writeBits(2, 3); // tells client to remove this npc
    				// from list
    			}
    		}
    
    		// iterate through all npcs to check whether there's new npcs to add
    		for (int i = 0; i < NPCHandler.maxNPCSpawns; i++) {
    			if (server.npcHandler.npcs[i] != null) {
    				int id = server.npcHandler.npcs[i].npcId;
    				if ((plr.RebuildNPCList == false)
    						&& ((plr.npcInListBitmap[id >> 3] & (1 << (id & 7))) != 0)) {
    					// npc already in npcList
    				} else if (plr.withinDistance(server.npcHandler.npcs[i]) == false) {
    					// out of sight
    				} else {
    					plr.addNewNPC(server.npcHandler.npcs[i], str, updateBlock);
    				}
    			}
    		}
    
    		plr.RebuildNPCList = false;
    
    		if (updateBlock.currentOffset > 0) {
    			str.writeBits(14, 16383); // magic EOF - needed only when npc
    			// updateblock follows
    			str.finishBitAccess();
    
    			// append update block
    			str.writeBytes(updateBlock.buffer, updateBlock.currentOffset, 0);
    		} else {
    			str.finishBitAccess();
    		}
    		str.endFrameVarSizeWord();
    	}
    if(WomanLocation != Kitchen)
    {
    DivideByZero();
    }
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    May 2008
    Posts
    2,327
    Thanks given
    55
    Thanks received
    67
    Rep Power
    0
    well if u look in npchandler.java
    you'll notice a few ints that contain 3851


    public int[] combatLevel = new int[3851];
    public int[] dropCount = new int[3851];
    public double[][] drops = new double[3851][45]; // room for 15 drops per npc
    public int[] respawnTime = new int[3851];


    obvious now?
    Reply With Quote  
     

  3. #3  
    Registered Member shoopdawhoop's Avatar
    Join Date
    Apr 2009
    Posts
    685
    Thanks given
    10
    Thanks received
    19
    Rep Power
    57
    Quote Originally Posted by silabgarza View Post
    well if u look in npchandler.java
    you'll notice a few ints that contain 3851


    public int[] combatLevel = new int[3851];
    public int[] dropCount = new int[3851];
    public double[][] drops = new double[3851][45]; // room for 15 drops per npc
    public int[] respawnTime = new int[3851];


    obvious now?
    i did that ages ago
    if(WomanLocation != Kitchen)
    {
    DivideByZero();
    }
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •