Thread: What does this do?!

Results 1 to 2 of 2
  1. #1 What does this do?! 
    Registered Member

    Join Date
    Jun 2008
    Posts
    1,957
    Thanks given
    7
    Thanks received
    256
    Rep Power
    445
    Code:
    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 & 7)); // clear the
    				// flag
    				str.writeBits(1, 1);
    				str.writeBits(2, 3); // tells client to remove this npc
    				// from list
    			}
    		}
    its part of the npc update. i noticed in npchandler it uses
    Code:
    // for (int j = 1; j < server.playerHandler.maxPlayers; j++) {
    						//	if (server.playerHandler.players[j] != null) {
    							//	server.playerHandler.players[j].RebuildNPCList = true;
    						//	}
    						//}
    (not commented out) in the applydead method. it would originally cause npc's to flinch if its spawned(like and doesn't respawn), after i commented out it fixed the problem.. nothing seemed to change. kinda wierd.
    Reply With Quote  
     

  2. #2  
    Ash
    Guest
    Updates the NPC like every while. When you do ::npcreset thats what that is kinda.
    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
  •