Jump to content

Would an OBSE handler get removed in this situation?


VencGanence

Recommended Posts

Edit: I found a way to test the thing I thought couldn't be tested and have my answer: the first block will trigger OnUnEquip.

 

 

 

 

I'm optimizing my scripts for Shurifen when I run into an issue I don't see a way to test.

 

I changed the object script so it sets and removes the OnHitWith handler, but in the level up block of the quest script

Player.AddItem DLScalar20 1
if ( aaShurifenEquip == 1 )
	Player.EquipItem DLScalar20
endif
Player.RemoveItem DLScalar15 1

I'm not sure if this will trigger the OnUnEquip block, removing the handler for the previous version, since it happens so fast.

 

I considered adding to the block

Player.AddItem DLScalar20 1
RemoveEventHandler "OnHitWith" aaShurifenOnHit
if ( aaShurifenEquip == 1 )
	Player.EquipItem DLScalar20
endif
Player.RemoveItem DLScalar15 1

But if Player.EquipItem does trigger the OnUnEquip block, I don't know if the RemoveEventHandler there would cause an error.

Edited by VencGanence
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...