Merge branch 'Saturn-Next' into waterrefract
This commit is contained in:
commit
dfc7b5482e
6 files changed
+1024
-1019
No files matched your search
+1
-1
@@ -934,7 +934,7 @@ void G_ConsAllGhostTics(void)
|
||||
void G_ConsGhostTic(INT32 playernum)
|
||||
{
|
||||
UINT8 ziptic;
|
||||
fixed_t px,py,pz,gx,gy,gz;
|
||||
fixed_t px, py, pz, gx, gy, gz;
|
||||
mobj_t *testmo;
|
||||
fixed_t syncleeway;
|
||||
boolean nightsfail = false;
|
||||
|
||||
+9
-7
@@ -883,18 +883,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
break;
|
||||
case MT_HOOPCOLLIDE:
|
||||
// This produces a kind of 'domino effect' with the hoop's pieces.
|
||||
for (; special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop
|
||||
|
||||
for (; special != NULL && special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop
|
||||
i = 0;
|
||||
for (; special->hnext != NULL && special->type == MT_HOOP; special = special->hnext)
|
||||
for (; special != NULL && special->type == MT_HOOP; special = special->hnext)
|
||||
{
|
||||
if (!P_MobjWasRemoved(special->target))
|
||||
if (!P_MobjWasRemoved(special))
|
||||
{
|
||||
special->fuse = 11;
|
||||
special->movedir = i;
|
||||
special->extravalue1 = special->target->extravalue1;
|
||||
special->extravalue2 = special->target->extravalue2;
|
||||
special->target->threshold = 4242;
|
||||
if (!P_MobjWasRemoved(special->target))
|
||||
{
|
||||
special->extravalue1 = special->target->extravalue1;
|
||||
special->extravalue2 = special->target->extravalue2;
|
||||
special->target->threshold = 4242;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -842,7 +842,7 @@ void P_SetThingPosition(mobj_t *thing)
|
||||
// at sector_t->touching_thinglist) are broken. When a node is
|
||||
// added, new sector links are created.
|
||||
|
||||
P_CreateSecNodeList(thing,thing->x,thing->y);
|
||||
P_CreateSecNodeList(thing, thing->x, thing->y);
|
||||
thing->touching_sectorlist = sector_list; // Attach to Thing's mobj_t
|
||||
sector_list = NULL; // clear for next time
|
||||
}
|
||||
|
||||
+92
-80
@@ -921,7 +921,48 @@ static void P_LoadThings(UINT8 *data)
|
||||
}
|
||||
}
|
||||
|
||||
static void P_SpawnMapThings(void)
|
||||
static void P_SpawnEmeraldHunt(void)
|
||||
{
|
||||
INT32 i;
|
||||
INT32 emer[3] = {0, 0, 0};
|
||||
INT32 timeout = 0; // keeps from getting stuck
|
||||
fixed_t x, y, z;
|
||||
|
||||
// increment spawn numbers because zero is valid.
|
||||
emer[0] = (P_RandomKey(numhuntemeralds)) + 1;
|
||||
while (timeout++ < 100)
|
||||
{
|
||||
emer[1] = (P_RandomKey(numhuntemeralds)) + 1;
|
||||
|
||||
if (emer[1] != emer[0])
|
||||
break;
|
||||
}
|
||||
|
||||
timeout = 0;
|
||||
while (timeout++ < 100)
|
||||
{
|
||||
emer[2] = (P_RandomKey(numhuntemeralds)) + 1;
|
||||
|
||||
if (emer[2] != emer[1] && emer[2] != emer[0])
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (!emer[i])
|
||||
continue;
|
||||
|
||||
// decrement spawn values to the actual number because zero is valid.
|
||||
x = huntemeralds[emer[i] - 1]->x<<FRACBITS;
|
||||
y = huntemeralds[emer[i] - 1]->y<<FRACBITS;
|
||||
z = huntemeralds[emer[i] - 1]->z<<FRACBITS;
|
||||
|
||||
// spawn emerald
|
||||
P_SpawnMobj(x, y, z, MT_EMERHUNT);
|
||||
}
|
||||
}
|
||||
|
||||
static void P_SpawnMapThings(boolean spawnhoops)
|
||||
{
|
||||
size_t i;
|
||||
mapthing_t *mt;
|
||||
@@ -931,97 +972,68 @@ static void P_SpawnMapThings(void)
|
||||
// Spawn axis points first so they are at the front of the list for fast searching.
|
||||
for (i = 0, mt = mapthings; i < nummapthings; i++, mt++)
|
||||
{
|
||||
switch (mt->type)
|
||||
if (mt->type == 1700 || // MT_AXIS
|
||||
mt->type == 1701 || // MT_AXISTRANSFER
|
||||
mt->type == 1702) // MT_AXISTRANSFERLINE
|
||||
{
|
||||
case 1700: // MT_AXIS
|
||||
case 1701: // MT_AXISTRANSFER
|
||||
case 1702: // MT_AXISTRANSFERLINE
|
||||
mt->mobj = NULL;
|
||||
P_SpawnMapThing(mt);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
mt->mobj = NULL;
|
||||
P_SpawnMapThing(mt);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0, mt = mapthings; i < nummapthings; i++, mt++)
|
||||
{
|
||||
sector_t *mtsector = R_PointInSubsector((mt->x << FRACBITS), (mt->y << FRACBITS))->sector;
|
||||
sector_t *mtsector;
|
||||
|
||||
// srb2kart - ignore rings, coins and item patterns!
|
||||
if (mt->type == 300 || mt->type == 308 || mt->type == 309 ||
|
||||
(mt->type >= 600 && mt->type <= 609) ||
|
||||
mt->type == 1706 || mt->type == 1800)
|
||||
{
|
||||
mt->mobj = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
mtsector = R_PointInSubsector((mt->x << FRACBITS), (mt->y << FRACBITS))->sector;
|
||||
|
||||
// Z for objects
|
||||
mt->z = (INT16)(P_GetSectorFloorZAt(mtsector, (mt->x << FRACBITS), (mt->y << FRACBITS))) >> FRACBITS;
|
||||
|
||||
if (mt->type == 1700 // MT_AXIS
|
||||
|| mt->type == 1701 // MT_AXISTRANSFER
|
||||
|| mt->type == 1702) // MT_AXISTRANSFERLINE
|
||||
if (mt->type == 1700 || // MT_AXIS
|
||||
mt->type == 1701 || // MT_AXISTRANSFER
|
||||
mt->type == 1702) // MT_AXISTRANSFERLINE
|
||||
{
|
||||
continue; // These were already spawned
|
||||
}
|
||||
|
||||
mt->mobj = NULL;
|
||||
|
||||
// spawn hoops
|
||||
if (mt->type == 1705 || mt->type == 1713)
|
||||
{
|
||||
// Check for spawnhoops here so the hoops don't spawn ghost variants for players joining a netgame mid-level
|
||||
// ...It's a long story.
|
||||
if (spawnhoops)
|
||||
{
|
||||
// Z for objects Tails 05-26-2002
|
||||
mt->z = (INT16)(mtsector->floorheight >> FRACBITS);
|
||||
|
||||
P_SpawnHoops(mt);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mt->type == mobjinfo[MT_RANDOMITEM].doomednum)
|
||||
nummapboxes++;
|
||||
|
||||
mt->mobj = NULL;
|
||||
// Everything else
|
||||
P_SpawnMapThing(mt);
|
||||
}
|
||||
|
||||
// random emeralds for hunt
|
||||
if (numhuntemeralds)
|
||||
{
|
||||
INT32 emer1, emer2, emer3;
|
||||
INT32 timeout = 0; // keeps from getting stuck
|
||||
|
||||
emer1 = emer2 = emer3 = 0;
|
||||
|
||||
//increment spawn numbers because zero is valid.
|
||||
emer1 = (P_RandomKey(numhuntemeralds)) + 1;
|
||||
while (timeout++ < 100)
|
||||
{
|
||||
emer2 = (P_RandomKey(numhuntemeralds)) + 1;
|
||||
|
||||
if (emer2 != emer1)
|
||||
break;
|
||||
}
|
||||
|
||||
timeout = 0;
|
||||
while (timeout++ < 100)
|
||||
{
|
||||
emer3 = (P_RandomKey(numhuntemeralds)) + 1;
|
||||
|
||||
if (emer3 != emer2 && emer3 != emer1)
|
||||
break;
|
||||
}
|
||||
|
||||
//decrement spawn values to the actual number because zero is valid.
|
||||
if (emer1)
|
||||
P_SpawnMobj(huntemeralds[emer1 - 1]->x<<FRACBITS,
|
||||
huntemeralds[emer1 - 1]->y<<FRACBITS,
|
||||
huntemeralds[emer1 - 1]->z<<FRACBITS, MT_EMERHUNT);
|
||||
|
||||
if (emer2)
|
||||
P_SpawnMobj(huntemeralds[emer2 - 1]->x<<FRACBITS,
|
||||
huntemeralds[emer2 - 1]->y<<FRACBITS,
|
||||
huntemeralds[emer2 - 1]->z<<FRACBITS, MT_EMERHUNT);
|
||||
|
||||
if (emer3)
|
||||
P_SpawnMobj(huntemeralds[emer3 - 1]->x<<FRACBITS,
|
||||
huntemeralds[emer3 - 1]->y<<FRACBITS,
|
||||
huntemeralds[emer3 - 1]->z<<FRACBITS, MT_EMERHUNT);
|
||||
}
|
||||
|
||||
// Run through the list of mapthings again to spawn hoops and rings
|
||||
for (i = 0, mt = mapthings; i < nummapthings; i++, mt++)
|
||||
{
|
||||
if (mt->type == 300 || mt->type == 308 || mt->type == 309
|
||||
|| mt->type == 1706 || (mt->type >= 600 && mt->type <= 609)
|
||||
|| mt->type == 1705 || mt->type == 1713 || mt->type == 1800)
|
||||
{
|
||||
mt->mobj = NULL;
|
||||
|
||||
// Z for objects Tails 05-26-2002
|
||||
mt->z = (INT16)(R_PointInSubsector(mt->x << FRACBITS, mt->y << FRACBITS)->sector->floorheight>>FRACBITS);
|
||||
|
||||
P_SpawnHoops(mt);
|
||||
}
|
||||
}
|
||||
P_SpawnEmeraldHunt();
|
||||
}
|
||||
|
||||
static void P_SpawnEmblems(boolean loademblems)
|
||||
@@ -1035,22 +1047,22 @@ static void P_SpawnEmblems(boolean loademblems)
|
||||
|
||||
for (i = 0; i < numemblems; i++)
|
||||
{
|
||||
if (emblemlocations[i].level != gamemap || emblemlocations[i].type > ET_SKIN)
|
||||
const emblem_t *emblemlocation = &emblemlocations[i];
|
||||
|
||||
if (emblemlocation->level != gamemap || emblemlocation->type > ET_SKIN)
|
||||
continue;
|
||||
|
||||
emblemmobj = P_SpawnMobj(emblemlocations[i].x<<FRACBITS, emblemlocations[i].y<<FRACBITS,
|
||||
emblemlocations[i].z<<FRACBITS, MT_EMBLEM);
|
||||
emblemmobj = P_SpawnMobj(emblemlocation->x<<FRACBITS, emblemlocation->y<<FRACBITS, emblemlocation->z<<FRACBITS, MT_EMBLEM);
|
||||
|
||||
I_Assert(emblemlocations[i].sprite >= 'A' && emblemlocations[i].sprite <= 'Z');
|
||||
P_SetMobjStateNF(emblemmobj, emblemmobj->info->spawnstate + (emblemlocations[i].sprite - 'A'));
|
||||
I_Assert(emblemlocation->sprite >= 'A' && emblemlocation->sprite <= 'Z');
|
||||
P_SetMobjStateNF(emblemmobj, emblemmobj->info->spawnstate + (emblemlocation->sprite - 'A'));
|
||||
|
||||
emblemmobj->health = i+1;
|
||||
color = M_GetEmblemColor(&emblemlocations[i]);
|
||||
|
||||
emblemmobj->color = (UINT8)color;
|
||||
|
||||
if (emblemlocations[i].collected
|
||||
|| (emblemlocations[i].type == ET_SKIN && emblemlocations[i].var != players[0].skin))
|
||||
if (emblemlocation->collected || (emblemlocation->type == ET_SKIN && emblemlocation->var != players[0].skin))
|
||||
{
|
||||
P_UnsetThingPosition(emblemmobj);
|
||||
emblemmobj->flags |= MF_NOCLIP;
|
||||
@@ -3079,7 +3091,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
|
||||
// a shit ton of time loading mobj thinkers.
|
||||
CalculateDoomednumToMobjtype();
|
||||
|
||||
P_SpawnMapThings();
|
||||
P_SpawnMapThings(!fromnetsave);
|
||||
|
||||
P_SpawnEmblems(!fromnetsave);
|
||||
|
||||
|
||||
@@ -817,7 +817,6 @@ void R_AddSkins(UINT16 wadnum, boolean local)
|
||||
}
|
||||
|
||||
#undef lnumskins
|
||||
//sortSkinGrid();
|
||||
|
||||
return;
|
||||
}
|
||||
+921
-929
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user