diff --git a/src/p_mobj.c b/src/p_mobj.c index 6604efe02..d4f8efcf3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11666,7 +11666,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) { case MT_ITEMCAPSULE: { - boolean isRingCapsule = (mthing->angle < 1 || mthing->angle == KITEM_SUPERRING || mthing->angle >= NUMKARTITEMS); + boolean isRingCapsule = (mthing->args[0] < 1 || mthing->args[0] == KITEM_SUPERRING || mthing->args[0] >= NUMKARTITEMS); // don't spawn ring capsules in GTR_SPHERES gametypes if (isRingCapsule && (gametyperules & GTR_SPHERES)) @@ -11675,7 +11675,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) // in record attack, only spawn ring capsules // (behavior can be inverted with the Extra flag, i.e. item capsule spawns and ring capsule does not) if (modeattacking - && (!(mthing->options & MTF_EXTRA) == !isRingCapsule)) + && (!(mthing->args[2] & TMICF_INVERTTIMEATTACK) == !isRingCapsule)) return false; } break; @@ -12624,18 +12624,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean mobj->flags |= MF_NOGRAVITY; // Angle = item type - if (mthing->angle > 0 && mthing->angle < NUMKARTITEMS) - mobj->threshold = mthing->angle; + if (mthing->args[0] > 0 && mthing->args[0] < NUMKARTITEMS) + mobj->threshold = mthing->args[0]; // Parameter = extra items (x5 for rings) - mobj->movecount += mthing->extrainfo; - - // Special = +16 items (+80 for rings) - if (mthing->options & MTF_OBJECTSPECIAL) - mobj->movecount += 16; + mobj->movecount += mthing->args[1]; // Ambush = double size (grounded) / half size (aerial) - if (!(mthing->options & MTF_AMBUSH) == !P_IsObjectOnGround(mobj)) + if (!(mthing->args[2] & TMICF_INVERTSIZE) == !P_IsObjectOnGround(mobj)) { mobj->extravalue1 = min(mobj->extravalue1 << 1, FixedDiv(64*FRACUNIT, mobj->info->radius)); // don't make them larger than the blockmap can handle mobj->scalespeed <<= 1; diff --git a/src/p_setup.c b/src/p_setup.c index ef2072622..fecb5bf20 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -6497,6 +6497,26 @@ static void P_ConvertBinaryThingTypes(void) mapthings[i].args[0] = mapthings[i].angle; mapthings[i].args[1] = mapthings[i].extrainfo; break; + case 2010: // MT_ITEMCAPSULE + mapthings[i].args[0] = mapthings[i].angle; + mapthings[i].args[1] = mapthings[i].extrainfo; + + if (mapthings[i].options & MTF_OBJECTSPECIAL) + { + // Special = +16 items (+80 for rings) + mapthings[i].args[1] += 16; + } + + if (mapthings[i].options & MTF_EXTRA) + { + mapthings[i].args[2] |= TMICF_INVERTTIMEATTACK; + } + + if (mapthings[i].options & MTF_AMBUSH) + { + mapthings[i].args[2] |= TMICF_INVERTSIZE; + } + break; case 2333: // MT_BATTLECAPSULE mapthings[i].args[0] = mapthings[i].extrainfo; mapthings[i].args[1] = mapthings[i].angle; diff --git a/src/p_spec.h b/src/p_spec.h index 8daad8575..096690d48 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -63,6 +63,12 @@ typedef enum TMBCF_REVERSE = 1<<1, } textmapbattlecapsuleflags_t; +typedef enum +{ + TMICF_INVERTTIMEATTACK = 1, + TMICF_INVERTSIZE = 1<<1, +} textmapitemcapsuleflags_t; + typedef enum { TMFF_AIMLESS = 1,