So the Entity 'killer' in playerDrops is not getting assigned, right?
|
|
This issue has been fixed!
For those with the same problem using the Vencillio base, go into your Player class and remove the variable that is commented out.
Player class
Basically what is happening is upon death, the variables of the player resets which also resets the entity (killer) from being recognised, hence not sending the drop to that player.Code:@Override public void reset() { following.updateWaypoint(); appearanceUpdateRequired = false; chatUpdateRequired = false; resetMovementQueue = false; needsPlacement = false; getMovementHandler().resetMoveDirections(); getUpdateFlags().setUpdateRequired(false); getUpdateFlags().reset(); //getCombat().getDamageTracker().clear(); }
Hope that has helped.
Thank you to:
Kris
arch337
Falconpunch
So the Entity 'killer' in playerDrops is not getting assigned, right?
Wrong, the killer is declared but the drops still are not being assigned to the entity itself.
The code:
Calculates the damage dealt from a specific entity, and returns if the entity has dealt the highest damage. Which is what I don't understand, it works for NPC drops, but isn't assigning it to other players.Code:player.getCombat().getDamageTracker().getKiller()
The addDamage declaration is also within the right spots upon initiating a hit and setting the hits damage which is found within the Combat class.
So basically, for some reason, I had it debug the entity 'killer' and it returned null even after assigning it with the getKiller() method.
Meaning it isn't recognising the killer who has slain the player. So I am trying to figure out why it isn't assigning the entity to as the killer in order for the killer to receive the drop.

Upon reviewing playerdrops, it seems you have emblems. If those are working, you could in theory, just make a method to add coins on the ground based on their armor.
Something like int CashForUntradeables(item id, int cashAmt)
And make it just return a total amount of cash on the ground for the killer. Id do more if I wasn't on my phone



Debug the add damage method. I've got a feeling like it's getting added to the map but it gets reset by another method shortly after -> resulting in a null overall. Put simple out prints around it and see if it gets added properly n shit.
Edit: Also, make sure the reset() method in player doesn't get ran before the drop is being thrown. From what I understand the person who dies will have the reset() method ran which clears their damage-taken map -> After this the drop gets thrown. Correct me if I'm wrong there.
So I've done that, basically I am thinking it has to be reset before the player dies, there is no way otherwise.I debugged the damage map to see if it is adding the damage and found it is
Maybe it is to do with the combat timer.... I will have a look and re-debug everything soon I am just getting home now.
| « Elvarg npc range combat doesn't load | need help setting up source » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |