Jump to content
PseudonymousEd

[41.53] Minor Barricade Exploit (removal of object from barricade doesn't consider skill level)

Recommended Posts

When you add a plank, sheet, or bar as a barricade, the health of the barricade is determined by the condition of the object and a modifier based on your skill.  But when you remove that from the barricade, it does not consider that the health was modified by skill level, so the resulting health is higher than it should be.

 

When you remove an object from the barricade, the condition of that object is based on the health of the barricade divided by the base health the barricade would normally have without the skill modifier.

 

Here is part of removePlank, from the IsoBarricade class:

            float f = Math.min((float)this.plankHealth[n] / 1000.0f, 1.0f);
            inventoryItem = InventoryItemFactory.CreateItem((String)"Base.Plank");
            inventoryItem.setCondition((int)Math.max((float)inventoryItem.getConditionMax() * f, 1.0f));

 

This can technically be exploited to give yourself cheap repairs to barricades.

 

Here's an example using wood planks:

  • A wood plank has a base health of 1000 in a barricade.
  • At level 10 carpentry, this gets modified by 1.5, so the initial health is 1500.
  • Let's say a zombie comes along and causes 400 points of damage to the barricade.  Then you kill the zombie and remove the plank.
  • The barricades' health is 1100, so after you remove the plank the plank's health is 1100 / 1000 = 1.1 which is adjusted to be 1.  
  • The plank is in perfect condition, and if you immediately add it back to the barricade you have a barricade of 1500 again.  

 

A bug, but not something that is going to break the game.

 

To fix it, I'm guessing they'd need to add a variable to hold the maximum health of the barricade at the time it is created.  Then they can take the current health at the time they remove the barricade, and use the percentage to determine the health of the object.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...