Maniac
Apolyton Sage
reloadEntity() (at least I think that's the culprit) causes the unit to cease to be IsSelected(). This causes issues like the promotion panel not being updated, or unit selection cycling no longer working (you have to manually click on another unit). Try it out with the Illian assassin and that spell that gives it the Hidden promotion for instance.
To fix the promotion list not being updated, you should move the stuff that causes an entity reload to the end of the :sethasPromotion function. To fix unit cycling, you should gDLL->getInterfaceIFace()->selectUnit(this,?,?,?) after reloadEntity().
This should work (using the 40x SDK files):
Sorry for the layout mixup. That's because you use four spaces while I use tabs.
To fix the promotion list not being updated, you should move the stuff that causes an entity reload to the end of the :sethasPromotion function. To fix unit cycling, you should gDLL->getInterfaceIFace()->selectUnit(this,?,?,?) after reloadEntity().
This should work (using the 40x SDK files):
Code:
if (IsSelected())
{
gDLL->getInterfaceIFace()->setDirty(SelectionButtons_DIRTY_BIT, true);
gDLL->getInterfaceIFace()->setDirty(InfoPane_DIRTY_BIT, true);
}
//update graphics
gDLL->getEntityIFace()->updatePromotionLayers(getUnitEntity());
if (GC.getPromotionInfo(eIndex).getUnitArtStyleType() != NO_UNIT_ARTSTYLE)
{
if (iChange > 0)
{
setUnitArtStyleType(GC.getPromotionInfo(eIndex).getUnitArtStyleType());
}
else
{
if (GC.getPromotionInfo(eIndex).getUnitArtStyleType() == getUnitArtStyleType())
{
setUnitArtStyleType(NO_UNIT_ARTSTYLE);
}
}
reloadEntity();
gDLL->getInterfaceIFace()->selectUnit(this, false, false, false);
}
if (GC.getPromotionInfo(eIndex).getGroupSize() != 0)
{
if (bNewValue)
{
setGroupSize(GC.getPromotionInfo(eIndex).getGroupSize());
}
else
{
setGroupSize(0);
}
reloadEntity();
gDLL->getInterfaceIFace()->selectUnit(this, false, false, false);
}
Sorry for the layout mixup. That's because you use four spaces while I use tabs.