Fixing temporary IPs wich last forever
#1
Posté 17 décembre 2011 - 04:15
This is an old, well known bug, apply a temp property to your weapon and relog before it expires and you have a permanent item property. Although one can loop throught all inventory items and remove temp props in the OnClientEnter handler, I'm wondering if there's a cleaner fix to this?
Thank you
Kato
#2
Posté 17 décembre 2011 - 04:22
#3
Posté 17 décembre 2011 - 04:28
Kato
#4
Posté 17 décembre 2011 - 04:41
I'll just double check this in my mod though to be sure.
#5
Posté 17 décembre 2011 - 04:48
Kato
#6
Posté 17 décembre 2011 - 05:08
The game removed the effect from the item I test enchanted on logging back in past its expiration time.
I do think logging out and back in still seperates the caster object stored on it though, which was a common trick I've seen used in quite a few PWs in order to get extra buffs in, or to keep them when the caster needed to rest but the people they enchanted didn't.
#7
Posté 17 décembre 2011 - 06:48
SHOVA wrote...
I think this was fixed with 1.69, or one of the expansions. I suggest updating your mod event scripts to the latest. The on client leave, on client enter. that is where the fix should be.
it wasn't its not a bug per see, rather than PW issue, reason why this is happening is that temporary itemproperties have a timestamp when created which tell the game when they should be removed, the problem arise when the PW module restart -> this reset clocks to toolset default date which is way lower than date of itemproperties expiration
persistent time should fix it, if not try this piece of code in your OnClientEnter script:
this should go above void main()
this somwhere inside:void removeAllTempEffect(object oItem)
{
itemproperty ip = GetFirstItemProperty(oItem);
while(GetIsItemPropertyValid(ip))
{
if(GetItemPropertyDurationType(ip) == DURATION_TYPE_TEMPORARY)
{
RemoveItemProperty(oItem, ip);
}
ip = GetNextItemProperty(oItem);
}
}
void removeEffectFromWeapons(object oPC) {
removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC));
removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC));
removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC));
removeAllTempEffect(GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC));
// remove effect also from all item in invertory
object oItem = GetFirstItemInInventory(oPC);
while (oItem != OBJECT_INVALID) {
removeAllTempEffect(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
removeEffectFromWeapons(GetEnteringObject());
#8
Posté 17 décembre 2011 - 07:09
Kato
#9
Posté 18 décembre 2011 - 03:13
#10
Posté 18 décembre 2011 - 04:08





Retour en haut






