Thread: Models on ground bugged with Galkon's Client

Results 1 to 4 of 4
  1. #1 Models on ground bugged with Galkon's Client 
    Registered Member
    Join Date
    Dec 2009
    Posts
    200
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    I add my first models to Galkon's refactored/renamed client.
    And the first thing I notice is that there is a nulled drop option for the item model on the ground that shouldn't be there.



    I also dropped some imported items from other clients based on Galkon's and the same annoying null option is present with those clients too.

    For now people have to right click and select 'Take' when they want to pick up the new items and did I mention there is an annoying fucken null option at the top that only makes you walk on top of the item??

    PLEASE HELP ME

    another picture



    again please help me with this client bug
    Reply With Quote  
     

  2. #2  
    Retired. Stop PMing me.

    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    14
    Posts
    7,528
    Thanks given
    1,783
    Thanks received
    2,822
    Discord
    View profile
    Rep Power
    5000
    Replace void build3dScreenMenu() with this:

    Code:
    	private void build3dScreenMenu()
    	{
    		if(itemSelected == 0 && spellSelected == 0)
    		{
    			menuActionName[menuActionRow] = "Walk here";
    			menuActionID[menuActionRow] = 516;
    			menuActionCmd2[menuActionRow] = super.mouseX;
    			menuActionCmd3[menuActionRow] = super.mouseY;
    			menuActionRow++;
    		}
    		int j = -1;
    		for(int k = 0; k < Model.anInt1687; k++)
    		{
    			int l = Model.anIntArray1688[k];
    			int i1 = l & 0x7f;
    			int j1 = l >> 7 & 0x7f;
    			int k1 = l >> 29 & 3;
    			int l1 = l >> 14 & 0x7fff;
    			if(l == j)
    				continue;
    			j = l;
    			if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
    			{
    				ObjectDef class46 = ObjectDef.forID(l1);
    				if(class46.childrenIDs != null)
    					class46 = class46.method580();
    				if(class46 == null)
    					continue;
    				if(itemSelected == 1)
    				{
    					menuActionName[menuActionRow] = "Use " + selectedItemName + " with @[email protected]" + class46.name;
    					menuActionID[menuActionRow] = 62;
    					menuActionCmd1[menuActionRow] = l;
    					menuActionCmd2[menuActionRow] = i1;
    					menuActionCmd3[menuActionRow] = j1;
    					menuActionRow++;
    				} else
    				if(spellSelected == 1)
    				{
    					if((spellUsableOn & 4) == 4)
    					{
    						menuActionName[menuActionRow] = spellTooltip + " @[email protected]" + class46.name;
    						menuActionID[menuActionRow] = 956;
    						menuActionCmd1[menuActionRow] = l;
    						menuActionCmd2[menuActionRow] = i1;
    						menuActionCmd3[menuActionRow] = j1;
    						menuActionRow++;
    					}
    				} else
    				{
    					if(class46.actions != null)
    					{
    						for(int i2 = 4; i2 >= 0; i2--)
    							if(class46.actions[i2] != null)
    							{
    								menuActionName[menuActionRow] = class46.actions[i2] + " @[email protected]" + class46.name;
    								if(i2 == 0)
    									menuActionID[menuActionRow] = 502;
    								if(i2 == 1)
    									menuActionID[menuActionRow] = 900;
    								if(i2 == 2)
    									menuActionID[menuActionRow] = 113;
    								if(i2 == 3)
    									menuActionID[menuActionRow] = 872;
    								if(i2 == 4)
    									menuActionID[menuActionRow] = 1062;
    								menuActionCmd1[menuActionRow] = l;
    								menuActionCmd2[menuActionRow] = i1;
    								menuActionCmd3[menuActionRow] = j1;
    								menuActionRow++;
    							}
    
    					}
    					//menuActionName[menuActionRow] = "Examine @[email protected]" + class46.name + " @[email protected](@[email protected]" + l1 + "@[email protected]) (@[email protected]" + (i1 + baseX) + "," + (j1 + baseY) + "@[email protected])";
    					menuActionName[menuActionRow] = "Examine @[email protected]" + class46.name;
    					menuActionID[menuActionRow] = 1226;
    					menuActionCmd1[menuActionRow] = class46.type << 14;
    					menuActionCmd2[menuActionRow] = i1;
    					menuActionCmd3[menuActionRow] = j1;
    					menuActionRow++;
    				}
    			}
    			if(k1 == 1)
    			{
    				NPC npc = npcArray[l1];
    				if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
    				{
    					for(int j2 = 0; j2 < npcCount; j2++)
    					{
    						NPC npc2 = npcArray[npcIndices[j2]];
    						if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
    							buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
    					}
    
    					for(int l2 = 0; l2 < playerCount; l2++)
    					{
    						Player player = playerArray[playerIndices[l2]];
    						if(player != null && player.x == npc.x && player.y == npc.y)
    							buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
    					}
    
    				}
    				buildAtNPCMenu(npc.desc, l1, j1, i1);
    			}
    			if(k1 == 0)
    			{
    				Player player = playerArray[l1];
    				if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
    				{
    					for(int k2 = 0; k2 < npcCount; k2++)
    					{
    						NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
    						if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
    							buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
    					}
    
    					for(int i3 = 0; i3 < playerCount; i3++)
    					{
    						Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
    						if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
    							buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
    					}
    
    				}
    				buildAtPlayerMenu(i1, l1, player, j1);
    			}
    			if(k1 == 3)
    			{
    				NodeList class19 = groundArray[plane][i1][j1];
    				if(class19 != null)
    				{
    					for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
    					{
    						ItemDef itemDef = ItemDef.forID(item.ID);
    						if(itemSelected == 1)
    						{
    							menuActionName[menuActionRow] = "Use " + selectedItemName + " with @[email protected]" + itemDef.name;
    							menuActionID[menuActionRow] = 511;
    							menuActionCmd1[menuActionRow] = item.ID;
    							menuActionCmd2[menuActionRow] = i1;
    							menuActionCmd3[menuActionRow] = j1;
    							menuActionRow++;
    						} else
    						if(spellSelected == 1)
    						{
    							if((spellUsableOn & 1) == 1)
    							{
    								menuActionName[menuActionRow] = spellTooltip + " @[email protected]" + itemDef.name;
    								menuActionID[menuActionRow] = 94;
    								menuActionCmd1[menuActionRow] = item.ID;
    								menuActionCmd2[menuActionRow] = i1;
    								menuActionCmd3[menuActionRow] = j1;
    								menuActionRow++;
    							}
    						} else
    						{
    							for(int j3 = 4; j3 >= 0; j3--)
    								if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
    								{
    									menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @[email protected]" + itemDef.name;
    									if(j3 == 0)
    										menuActionID[menuActionRow] = 652;
    									if(j3 == 1)
    										menuActionID[menuActionRow] = 567;
    									if(j3 == 2)
    										menuActionID[menuActionRow] = 234;
    									if(j3 == 3)
    										menuActionID[menuActionRow] = 244;
    									if(j3 == 4)
    										menuActionID[menuActionRow] = 213;
    									menuActionCmd1[menuActionRow] = item.ID;
    									menuActionCmd2[menuActionRow] = i1;
    									menuActionCmd3[menuActionRow] = j1;
    									menuActionRow++;
    								} else
    								if(j3 == 2)
    								{
    									menuActionName[menuActionRow] = "Take @[email protected]" + itemDef.name;
    									menuActionID[menuActionRow] = 234;
    									menuActionCmd1[menuActionRow] = item.ID;
    									menuActionCmd2[menuActionRow] = i1;
    									menuActionCmd3[menuActionRow] = j1;
    									menuActionRow++;
    								}
    
    							//menuActionName[menuActionRow] = "Examine @[email protected]" + itemDef.name + " @[email protected](@[email protected]" + item.ID + "@[email protected])";
    							menuActionName[menuActionRow] = "Examine @[email protected]" + itemDef.name;
    							menuActionID[menuActionRow] = 1448;
    							menuActionCmd1[menuActionRow] = item.ID;
    							menuActionCmd2[menuActionRow] = i1;
    							menuActionCmd3[menuActionRow] = j1;
    							menuActionRow++;
    						}
    					}
    				}
    			}
    		}
    	}
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2009
    Posts
    200
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Galkon View Post
    Replace void build3dScreenMenu() with this:

    Code:
    	private void build3dScreenMenu()
    	{
    		if(itemSelected == 0 && spellSelected == 0)
    		{
    			menuActionName[menuActionRow] = "Walk here";
    			menuActionID[menuActionRow] = 516;
    			menuActionCmd2[menuActionRow] = super.mouseX;
    			menuActionCmd3[menuActionRow] = super.mouseY;
    			menuActionRow++;
    		}
    		int j = -1;
    		for(int k = 0; k < Model.anInt1687; k++)
    		{
    			int l = Model.anIntArray1688[k];
    			int i1 = l & 0x7f;
    			int j1 = l >> 7 & 0x7f;
    			int k1 = l >> 29 & 3;
    			int l1 = l >> 14 & 0x7fff;
    			if(l == j)
    				continue;
    			j = l;
    			if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
    			{
    				ObjectDef class46 = ObjectDef.forID(l1);
    				if(class46.childrenIDs != null)
    					class46 = class46.method580();
    				if(class46 == null)
    					continue;
    				if(itemSelected == 1)
    				{
    					menuActionName[menuActionRow] = "Use " + selectedItemName + " with @[email protected]" + class46.name;
    					menuActionID[menuActionRow] = 62;
    					menuActionCmd1[menuActionRow] = l;
    					menuActionCmd2[menuActionRow] = i1;
    					menuActionCmd3[menuActionRow] = j1;
    					menuActionRow++;
    				} else
    				if(spellSelected == 1)
    				{
    					if((spellUsableOn & 4) == 4)
    					{
    						menuActionName[menuActionRow] = spellTooltip + " @[email protected]" + class46.name;
    						menuActionID[menuActionRow] = 956;
    						menuActionCmd1[menuActionRow] = l;
    						menuActionCmd2[menuActionRow] = i1;
    						menuActionCmd3[menuActionRow] = j1;
    						menuActionRow++;
    					}
    				} else
    				{
    					if(class46.actions != null)
    					{
    						for(int i2 = 4; i2 >= 0; i2--)
    							if(class46.actions[i2] != null)
    							{
    								menuActionName[menuActionRow] = class46.actions[i2] + " @[email protected]" + class46.name;
    								if(i2 == 0)
    									menuActionID[menuActionRow] = 502;
    								if(i2 == 1)
    									menuActionID[menuActionRow] = 900;
    								if(i2 == 2)
    									menuActionID[menuActionRow] = 113;
    								if(i2 == 3)
    									menuActionID[menuActionRow] = 872;
    								if(i2 == 4)
    									menuActionID[menuActionRow] = 1062;
    								menuActionCmd1[menuActionRow] = l;
    								menuActionCmd2[menuActionRow] = i1;
    								menuActionCmd3[menuActionRow] = j1;
    								menuActionRow++;
    							}
    
    					}
    					//menuActionName[menuActionRow] = "Examine @[email protected]" + class46.name + " @[email protected](@[email protected]" + l1 + "@[email protected]) (@[email protected]" + (i1 + baseX) + "," + (j1 + baseY) + "@[email protected])";
    					menuActionName[menuActionRow] = "Examine @[email protected]" + class46.name;
    					menuActionID[menuActionRow] = 1226;
    					menuActionCmd1[menuActionRow] = class46.type << 14;
    					menuActionCmd2[menuActionRow] = i1;
    					menuActionCmd3[menuActionRow] = j1;
    					menuActionRow++;
    				}
    			}
    			if(k1 == 1)
    			{
    				NPC npc = npcArray[l1];
    				if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
    				{
    					for(int j2 = 0; j2 < npcCount; j2++)
    					{
    						NPC npc2 = npcArray[npcIndices[j2]];
    						if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
    							buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
    					}
    
    					for(int l2 = 0; l2 < playerCount; l2++)
    					{
    						Player player = playerArray[playerIndices[l2]];
    						if(player != null && player.x == npc.x && player.y == npc.y)
    							buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
    					}
    
    				}
    				buildAtNPCMenu(npc.desc, l1, j1, i1);
    			}
    			if(k1 == 0)
    			{
    				Player player = playerArray[l1];
    				if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
    				{
    					for(int k2 = 0; k2 < npcCount; k2++)
    					{
    						NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
    						if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
    							buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
    					}
    
    					for(int i3 = 0; i3 < playerCount; i3++)
    					{
    						Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
    						if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
    							buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
    					}
    
    				}
    				buildAtPlayerMenu(i1, l1, player, j1);
    			}
    			if(k1 == 3)
    			{
    				NodeList class19 = groundArray[plane][i1][j1];
    				if(class19 != null)
    				{
    					for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
    					{
    						ItemDef itemDef = ItemDef.forID(item.ID);
    						if(itemSelected == 1)
    						{
    							menuActionName[menuActionRow] = "Use " + selectedItemName + " with @[email protected]" + itemDef.name;
    							menuActionID[menuActionRow] = 511;
    							menuActionCmd1[menuActionRow] = item.ID;
    							menuActionCmd2[menuActionRow] = i1;
    							menuActionCmd3[menuActionRow] = j1;
    							menuActionRow++;
    						} else
    						if(spellSelected == 1)
    						{
    							if((spellUsableOn & 1) == 1)
    							{
    								menuActionName[menuActionRow] = spellTooltip + " @[email protected]" + itemDef.name;
    								menuActionID[menuActionRow] = 94;
    								menuActionCmd1[menuActionRow] = item.ID;
    								menuActionCmd2[menuActionRow] = i1;
    								menuActionCmd3[menuActionRow] = j1;
    								menuActionRow++;
    							}
    						} else
    						{
    							for(int j3 = 4; j3 >= 0; j3--)
    								if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
    								{
    									menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @[email protected]" + itemDef.name;
    									if(j3 == 0)
    										menuActionID[menuActionRow] = 652;
    									if(j3 == 1)
    										menuActionID[menuActionRow] = 567;
    									if(j3 == 2)
    										menuActionID[menuActionRow] = 234;
    									if(j3 == 3)
    										menuActionID[menuActionRow] = 244;
    									if(j3 == 4)
    										menuActionID[menuActionRow] = 213;
    									menuActionCmd1[menuActionRow] = item.ID;
    									menuActionCmd2[menuActionRow] = i1;
    									menuActionCmd3[menuActionRow] = j1;
    									menuActionRow++;
    								} else
    								if(j3 == 2)
    								{
    									menuActionName[menuActionRow] = "Take @[email protected]" + itemDef.name;
    									menuActionID[menuActionRow] = 234;
    									menuActionCmd1[menuActionRow] = item.ID;
    									menuActionCmd2[menuActionRow] = i1;
    									menuActionCmd3[menuActionRow] = j1;
    									menuActionRow++;
    								}
    
    							//menuActionName[menuActionRow] = "Examine @[email protected]" + itemDef.name + " @[email protected](@[email protected]" + item.ID + "@[email protected])";
    							menuActionName[menuActionRow] = "Examine @[email protected]" + itemDef.name;
    							menuActionID[menuActionRow] = 1448;
    							menuActionCmd1[menuActionRow] = item.ID;
    							menuActionCmd2[menuActionRow] = i1;
    							menuActionCmd3[menuActionRow] = j1;
    							menuActionRow++;
    						}
    					}
    				}
    			}
    		}
    	}
    Thanks for update code Galkon, but it's still bugged? Could you please post some new code? Do you have this problem with your own version of the client? God this sucks



    I found this snippet of code in the void, it might contain the problem?

    Code:
    							for(int j3 = 4; j3 >= 0; j3--)
    								if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
    								{
    									menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @[email protected]" + itemDef.name;
    									if(j3 == 0)
    										menuActionID[menuActionRow] = 652;
    									if(j3 == 1)
    										menuActionID[menuActionRow] = 567;
    									if(j3 == 2)
    										menuActionID[menuActionRow] = 234;
    									if(j3 == 3)
    										menuActionID[menuActionRow] = 244;
    									if(j3 == 4)
    										menuActionID[menuActionRow] = 213;
    									menuActionCmd1[menuActionRow] = item.ID;
    									menuActionCmd2[menuActionRow] = i1;
    									menuActionCmd3[menuActionRow] = j1;
    									menuActionRow++;
    Where it says ground item = null and then there is a blank option ... that might be the option I'm trying to delete? I dunno.

    Okay I commented out this line:
    Code:
    menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @[email protected]" + itemDef.name;
    The drop options are now displayed as:



    I'm think of removing this section of code to remove the second take option entirely.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Nov 2008
    Posts
    2,180
    Thanks given
    148
    Thanks received
    99
    Rep Power
    2004
    Use the search Button, theres tons of tuts for this.
    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
  •