Bug in Damage::BreakMyShield
It was when I was playing with Fugitive and tried to neutralise Ragnar when I discovered rather irritating bug:
when trying to shot him with a bow his shield was able to withstand any amount of damage without breaking.
Later it turned out it's true if only I was shooting repeatedly, if I made a break in barrage the shield was breaking up.
To see how it works check this link.
here is some log from console where you can see how it goes:
\[code\]
Load Time = 2.418000
if shield: // shield=<B_PyEntity object at 22c1a14>
shield=EscudoRagnar# 169
if shield: // shield=<B_PyEntity object at 22c07cc>
shield=EscudoRagnar# 38
if shield: // shield=<B_PyEntity object at 22c2260>
shield=EscudoRagnar# -93
## at this point shield should break already
if shield: // shield=<B_PyEntity object at 22c2314>
shield=EscudoRagnar# -131.0
## but it remains 'invincible' with 0 durability
if shield: // shield=<B_PyEntity object at 22c23d4>
shield=EscudoRagnar# -131.0
if shield: // shield=<B_PyEntity object at 22c23ec>
shield=EscudoRagnar# -131.0
object PerkinsQuiver_Arrow_8 of kind Flecha of mass 0.5 sticking for 6.0 seconds
if shield: // shield=<B_PyEntity object at 22c2188>
shield=EscudoRagnar# -131.0
End ActivateMenu()
\[/code\]
I started to look for a reason and I found that fault lies somewhere in Damage.py::BreakMyShield method.
# @ Lib/Damage.py
\[code\]
def BreakMyShield(EntityName):
me=Bladex.GetEntity(EntityName)
if me.InvLeft<>"":
esc=Bladex.GetEntity(me.InvLeft)
if esc:
n_child=esc.GetNChildren()
for n in range(n_child):
child=Bladex.GetEntity(esc.GetChild(n))
if child and child.Kind<>"Entity Spot":
esc.UnLink(child)
child.Impulse(0,0,0)
if Breakings.ExplodeSpecialObject ( me.InvLeft , 24000.0)==1:
if Reference.EntitiesObjectData.has_key(me.InvLeft):
del Reference.EntitiesObjectData[me.InvLeft]
DropInvalidObjectsOnImpact (EntityName)
me.Wuea=Reference.WUEA_ENDED
me.LaunchAnmType("df_s_broken")
inv=me.GetInventory()
inv.RemoveShield(me.InvLeft)
inv.LinkLeftHand("None")
if me.Data.NPC:
me.Data.ResetCombat (EntityName)
\[/code\]
for some reason when shooting repeatedly n_child is > 0
as far as I get it tries to unlink (is it same what delete?) derived objects but it fails and abandons execution of the rest of function body
question is how to fix it so it was dealing with that problem properly without dropping the rest of function body
PS. there are attached some files that will help if one wants to check that themselves - there is modified Lib/Damage.py with lot of print() debug info and already prepared scene - Coliseum map with Ragnar and "unlimited" quiver
there are also some console logs from my investigation, maybe that will help
PPS. sorry for this messy codes but they lose all indentations/new lines formatting when put in bbcode so I put them into message body