Allow scripts (or other outside sources) to easily change the properties of an item capsule

This commit is contained in:
lachablock 2021-06-14 23:04:28 +10:00
parent 9151d31512
commit da37ba8238
2 changed files with 7 additions and 0 deletions

View file

@ -14661,6 +14661,9 @@ void P_RefreshItemCapsuleParts(mobj_t *mobj)
mobj_t *part = mobj->tracer;
skincolornum_t color;
part->threshold = mobj->threshold;
part->movecount = mobj->movecount;
if (itemType < 1 || itemType >= NUMKARTITEMS)
itemType = KITEM_SAD;

View file

@ -6144,6 +6144,10 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
INT32 itemType = mobj->threshold;
mobj_t *part = mobj->tracer;
if (mobj->threshold != part->threshold
|| mobj->movecount != part->movecount) // allow scripters to easily change the capsule properties!
P_RefreshItemCapsuleParts(mobj);
if (itemType < 1 || itemType >= NUMKARTITEMS)
itemType = KITEM_SAD;