mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Merge branch 'more-conversions' into 'master'
More UDMF conversions See merge request KartKrew/Kart!1336
This commit is contained in:
commit
b82392dee6
11 changed files with 223 additions and 267 deletions
|
|
@ -547,8 +547,6 @@ consvar_t cv_inttime = CVAR_INIT ("inttime", "10", CV_SAVE|CV_NETVAR, inttime_co
|
||||||
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Same"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
|
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Same"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
|
||||||
consvar_t cv_advancemap = CVAR_INIT ("advancemap", "Vote", CV_NETVAR, advancemap_cons_t, NULL);
|
consvar_t cv_advancemap = CVAR_INIT ("advancemap", "Vote", CV_NETVAR, advancemap_cons_t, NULL);
|
||||||
|
|
||||||
consvar_t cv_runscripts = CVAR_INIT ("runscripts", "Yes", 0, CV_YesNo, NULL);
|
|
||||||
|
|
||||||
consvar_t cv_pause = CVAR_INIT ("pausepermission", "Server", CV_SAVE|CV_NETVAR, pause_cons_t, NULL);
|
consvar_t cv_pause = CVAR_INIT ("pausepermission", "Server", CV_SAVE|CV_NETVAR, pause_cons_t, NULL);
|
||||||
consvar_t cv_mute = CVAR_INIT ("mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange);
|
consvar_t cv_mute = CVAR_INIT ("mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange);
|
||||||
|
|
||||||
|
|
@ -795,7 +793,6 @@ void D_RegisterServerCommands(void)
|
||||||
|
|
||||||
CV_RegisterVar(&cv_startinglives);
|
CV_RegisterVar(&cv_startinglives);
|
||||||
CV_RegisterVar(&cv_countdowntime);
|
CV_RegisterVar(&cv_countdowntime);
|
||||||
CV_RegisterVar(&cv_runscripts);
|
|
||||||
CV_RegisterVar(&cv_overtime);
|
CV_RegisterVar(&cv_overtime);
|
||||||
CV_RegisterVar(&cv_pause);
|
CV_RegisterVar(&cv_pause);
|
||||||
CV_RegisterVar(&cv_mute);
|
CV_RegisterVar(&cv_mute);
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ extern consvar_t cv_scrambleonchange;
|
||||||
extern consvar_t cv_netstat;
|
extern consvar_t cv_netstat;
|
||||||
|
|
||||||
extern consvar_t cv_countdowntime;
|
extern consvar_t cv_countdowntime;
|
||||||
extern consvar_t cv_runscripts;
|
|
||||||
extern consvar_t cv_mute;
|
extern consvar_t cv_mute;
|
||||||
extern consvar_t cv_pause;
|
extern consvar_t cv_pause;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -493,7 +493,7 @@ static inline int lib_getenum(lua_State *L)
|
||||||
if (mathlib) return luaL_error(L, "player sprite '%s' could not be found.\n", word);
|
if (mathlib) return luaL_error(L, "player sprite '%s' could not be found.\n", word);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (!mathlib && fastncmp("sfx_",word,4)) {
|
else if (fastncmp("sfx_",word,4)) {
|
||||||
p = word+4;
|
p = word+4;
|
||||||
for (i = 0; i < NUMSFX; i++)
|
for (i = 0; i < NUMSFX; i++)
|
||||||
if (S_sfx[i].name && fastcmp(p, S_sfx[i].name)) {
|
if (S_sfx[i].name && fastcmp(p, S_sfx[i].name)) {
|
||||||
|
|
|
||||||
|
|
@ -1299,13 +1299,6 @@ void readlevelheader(MYFILE *f, char * name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Individual triggers for level flags, for ease of use (and 2.0 compatibility)
|
// Individual triggers for level flags, for ease of use (and 2.0 compatibility)
|
||||||
else if (fastcmp(word, "SCRIPTISFILE"))
|
|
||||||
{
|
|
||||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
|
||||||
mapheaderinfo[num]->levelflags |= LF_SCRIPTISFILE;
|
|
||||||
else
|
|
||||||
mapheaderinfo[num]->levelflags &= ~LF_SCRIPTISFILE;
|
|
||||||
}
|
|
||||||
else if (fastcmp(word, "NOZONE"))
|
else if (fastcmp(word, "NOZONE"))
|
||||||
{
|
{
|
||||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||||
|
|
|
||||||
|
|
@ -6456,7 +6456,6 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"RF_GHOSTLYMASK",RF_GHOSTLYMASK},
|
{"RF_GHOSTLYMASK",RF_GHOSTLYMASK},
|
||||||
|
|
||||||
// Level flags
|
// Level flags
|
||||||
{"LF_SCRIPTISFILE",LF_SCRIPTISFILE},
|
|
||||||
{"LF_NOZONE",LF_NOZONE},
|
{"LF_NOZONE",LF_NOZONE},
|
||||||
{"LF_SECTIONRACE",LF_SECTIONRACE},
|
{"LF_SECTIONRACE",LF_SECTIONRACE},
|
||||||
{"LF_SUBTRACTNUM",LF_SUBTRACTNUM},
|
{"LF_SUBTRACTNUM",LF_SUBTRACTNUM},
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ struct mapheader_t
|
||||||
};
|
};
|
||||||
|
|
||||||
// level flags
|
// level flags
|
||||||
#define LF_SCRIPTISFILE (1<<0) ///< True if the script is a file, not a lump.
|
//#define LF_(this slot is free) (1<<0)
|
||||||
#define LF_NOZONE (1<<1) ///< Don't include "ZONE" on level title
|
#define LF_NOZONE (1<<1) ///< Don't include "ZONE" on level title
|
||||||
#define LF_SECTIONRACE (1<<2) ///< Section race level
|
#define LF_SECTIONRACE (1<<2) ///< Section race level
|
||||||
#define LF_SUBTRACTNUM (1<<3) ///< Use subtractive position number (for bright levels)
|
#define LF_SUBTRACTNUM (1<<3) ///< Use subtractive position number (for bright levels)
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@ enum line_e {
|
||||||
line_frontsector,
|
line_frontsector,
|
||||||
line_backsector,
|
line_backsector,
|
||||||
line_polyobj,
|
line_polyobj,
|
||||||
line_text,
|
|
||||||
line_callcount
|
line_callcount
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -162,7 +161,6 @@ static const char *const line_opt[] = {
|
||||||
"frontsector",
|
"frontsector",
|
||||||
"backsector",
|
"backsector",
|
||||||
"polyobj",
|
"polyobj",
|
||||||
"text",
|
|
||||||
"callcount",
|
"callcount",
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
|
|
@ -177,7 +175,6 @@ enum side_e {
|
||||||
side_sector,
|
side_sector,
|
||||||
side_special,
|
side_special,
|
||||||
side_repeatcnt,
|
side_repeatcnt,
|
||||||
side_text
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *const side_opt[] = {
|
static const char *const side_opt[] = {
|
||||||
|
|
@ -191,7 +188,6 @@ static const char *const side_opt[] = {
|
||||||
"sector",
|
"sector",
|
||||||
"special",
|
"special",
|
||||||
"repeatcnt",
|
"repeatcnt",
|
||||||
"text",
|
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
enum vertex_e {
|
enum vertex_e {
|
||||||
|
|
@ -1088,9 +1084,6 @@ static int line_get(lua_State *L)
|
||||||
case line_polyobj:
|
case line_polyobj:
|
||||||
LUA_PushUserdata(L, line->polyobj, META_POLYOBJ);
|
LUA_PushUserdata(L, line->polyobj, META_POLYOBJ);
|
||||||
return 1;
|
return 1;
|
||||||
case line_text:
|
|
||||||
lua_pushstring(L, line->text);
|
|
||||||
return 1;
|
|
||||||
case line_callcount:
|
case line_callcount:
|
||||||
lua_pushinteger(L, line->callcount);
|
lua_pushinteger(L, line->callcount);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -1187,9 +1180,6 @@ static int side_get(lua_State *L)
|
||||||
case side_repeatcnt:
|
case side_repeatcnt:
|
||||||
lua_pushinteger(L, side->repeatcnt);
|
lua_pushinteger(L, side->repeatcnt);
|
||||||
return 1;
|
return 1;
|
||||||
case side_text:
|
|
||||||
lua_pushstring(L, side->text);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1214,7 +1204,6 @@ static int side_set(lua_State *L)
|
||||||
case side_line:
|
case side_line:
|
||||||
case side_sector:
|
case side_sector:
|
||||||
case side_special:
|
case side_special:
|
||||||
case side_text:
|
|
||||||
default:
|
default:
|
||||||
return luaL_error(L, "side_t field " LUA_QS " cannot be set.", side_opt[field]);
|
return luaL_error(L, "side_t field " LUA_QS " cannot be set.", side_opt[field]);
|
||||||
case side_textureoffset:
|
case side_textureoffset:
|
||||||
|
|
|
||||||
|
|
@ -13138,6 +13138,11 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
|
||||||
mobj->flags2 |= MF2_AMBUSH;
|
mobj->flags2 |= MF2_AMBUSH;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MT_AMBIENT:
|
||||||
|
if (mthing->stringargs[0])
|
||||||
|
mobj->threshold = get_number(mthing->stringargs[0]);
|
||||||
|
mobj->health = mthing->args[0] ? mthing->args[0] : TICRATE;
|
||||||
|
break;
|
||||||
// SRB2Kart
|
// SRB2Kart
|
||||||
case MT_WAYPOINT:
|
case MT_WAYPOINT:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
412
src/p_setup.c
412
src/p_setup.c
|
|
@ -999,7 +999,6 @@ static void P_InitializeLinedef(line_t *ld)
|
||||||
|
|
||||||
ld->tripwire = false;
|
ld->tripwire = false;
|
||||||
|
|
||||||
ld->text = NULL;
|
|
||||||
ld->callcount = 0;
|
ld->callcount = 0;
|
||||||
|
|
||||||
// cph 2006/09/30 - fix sidedef errors right away.
|
// cph 2006/09/30 - fix sidedef errors right away.
|
||||||
|
|
@ -1104,10 +1103,55 @@ static void P_InitializeSidedef(side_t *sd)
|
||||||
sd->special = sd->line->special;
|
sd->special = sd->line->special;
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->text = NULL;
|
|
||||||
sd->colormap_data = NULL;
|
sd->colormap_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -- Reference implementation
|
||||||
|
static void P_WriteConstant(INT32 constant, char **target)
|
||||||
|
{
|
||||||
|
char buffer[12];
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
sprintf(buffer, "%d", constant);
|
||||||
|
len = strlen(buffer) + 1;
|
||||||
|
*target = Z_Malloc(len, PU_LEVEL, NULL);
|
||||||
|
M_Memcpy(*target, buffer, len);
|
||||||
|
} */
|
||||||
|
|
||||||
|
static void P_WriteDuplicateText(const char *text, char **target)
|
||||||
|
{
|
||||||
|
if (text == NULL || text[0] == '\0')
|
||||||
|
return;
|
||||||
|
|
||||||
|
size_t len = strlen(text) + 1;
|
||||||
|
*target = Z_Malloc(len, PU_LEVEL, NULL);
|
||||||
|
M_Memcpy(*target, text, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void P_WriteSkincolor(INT32 constant, char **target)
|
||||||
|
{
|
||||||
|
if (constant <= SKINCOLOR_NONE
|
||||||
|
|| constant >= (INT32)numskincolors)
|
||||||
|
return;
|
||||||
|
|
||||||
|
P_WriteDuplicateText(
|
||||||
|
va("SKINCOLOR_%s", skincolors[constant].name),
|
||||||
|
target
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void P_WriteSfx(INT32 constant, char **target)
|
||||||
|
{
|
||||||
|
if (constant <= sfx_None
|
||||||
|
|| constant >= (INT32)sfxfree)
|
||||||
|
return;
|
||||||
|
|
||||||
|
P_WriteDuplicateText(
|
||||||
|
va("sfx_%s", S_sfx[constant].name),
|
||||||
|
target
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static void P_LoadSidedefs(UINT8 *data)
|
static void P_LoadSidedefs(UINT8 *data)
|
||||||
{
|
{
|
||||||
mapsidedef_t *msd = (mapsidedef_t*)data;
|
mapsidedef_t *msd = (mapsidedef_t*)data;
|
||||||
|
|
@ -1153,6 +1197,9 @@ static void P_LoadSidedefs(UINT8 *data)
|
||||||
|
|
||||||
case 413: // Change music
|
case 413: // Change music
|
||||||
{
|
{
|
||||||
|
if (!isfrontside)
|
||||||
|
break;
|
||||||
|
|
||||||
char process[8+1];
|
char process[8+1];
|
||||||
|
|
||||||
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
|
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
|
||||||
|
|
@ -1170,35 +1217,38 @@ static void P_LoadSidedefs(UINT8 *data)
|
||||||
sd->midtexture = get_number(process);
|
sd->midtexture = get_number(process);
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->text = Z_Malloc(7, PU_LEVEL, NULL);
|
if (msd->toptexture[0] != '-' && msd->toptexture[1] != '\0')
|
||||||
if (isfrontside && !(msd->toptexture[0] == '-' && msd->toptexture[1] == '\0'))
|
|
||||||
{
|
{
|
||||||
|
sd->line->stringargs[0] = Z_Malloc(7, PU_LEVEL, NULL);
|
||||||
M_Memcpy(process,msd->toptexture,8);
|
M_Memcpy(process,msd->toptexture,8);
|
||||||
process[8] = '\0';
|
process[8] = '\0';
|
||||||
|
|
||||||
// If they type in O_ or D_ and their music name, just shrug,
|
// If they type in O_ or D_ and their music name, just shrug,
|
||||||
// then copy the rest instead.
|
// then copy the rest instead.
|
||||||
if ((process[0] == 'O' || process[0] == 'D') && process[7])
|
if ((process[0] == 'O' || process[0] == 'D') && process[7])
|
||||||
M_Memcpy(sd->text, process+2, 6);
|
M_Memcpy(sd->line->stringargs[0], process+2, 6);
|
||||||
else // Assume it's a proper music name.
|
else // Assume it's a proper music name.
|
||||||
M_Memcpy(sd->text, process, 6);
|
M_Memcpy(sd->line->stringargs[0], process, 6);
|
||||||
sd->text[6] = 0;
|
sd->line->stringargs[0][6] = '\0';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
sd->text[0] = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 414: // Play SFX
|
case 414: // Play SFX
|
||||||
{
|
{
|
||||||
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
|
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
|
||||||
|
|
||||||
|
if (!isfrontside)
|
||||||
|
break;
|
||||||
|
|
||||||
if (msd->toptexture[0] != '-' || msd->toptexture[1] != '\0')
|
if (msd->toptexture[0] != '-' || msd->toptexture[1] != '\0')
|
||||||
{
|
{
|
||||||
char process[8 + 1];
|
char process[8 + 1];
|
||||||
M_Memcpy(process, msd->toptexture, 8);
|
M_Memcpy(process, msd->toptexture, 8);
|
||||||
process[8] = '\0';
|
process[8] = '\0';
|
||||||
sd->text = Z_Malloc(strlen(process) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(sd->text, process, strlen(process) + 1);
|
P_WriteDuplicateText(process, &sd->line->stringargs[0]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1207,21 +1257,13 @@ static void P_LoadSidedefs(UINT8 *data)
|
||||||
case 14: // Bustable block parameters
|
case 14: // Bustable block parameters
|
||||||
case 15: // Fan particle spawner parameters
|
case 15: // Fan particle spawner parameters
|
||||||
{
|
{
|
||||||
char process[8*3+1];
|
if (msd->toptexture[7] == '\0' && strcasecmp(msd->toptexture, "MT_NULL") == 0)
|
||||||
memset(process,0,8*3+1);
|
{
|
||||||
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
|
// Don't bulk the conversion with irrelevant types
|
||||||
if (msd->toptexture[0] == '-' && msd->toptexture[1] == '\0')
|
|
||||||
break;
|
break;
|
||||||
else
|
}
|
||||||
M_Memcpy(process,msd->toptexture,8);
|
|
||||||
if (msd->midtexture[0] != '-' || msd->midtexture[1] != '\0')
|
|
||||||
M_Memcpy(process+strlen(process), msd->midtexture, 8);
|
|
||||||
if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')
|
|
||||||
M_Memcpy(process+strlen(process), msd->bottomtexture, 8);
|
|
||||||
sd->toptexture = get_number(process);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
// FALLTHRU
|
||||||
case 331: // Trigger linedef executor: Skin - Continuous
|
case 331: // Trigger linedef executor: Skin - Continuous
|
||||||
case 332: // Trigger linedef executor: Skin - Each time
|
case 332: // Trigger linedef executor: Skin - Each time
|
||||||
case 333: // Trigger linedef executor: Skin - Once
|
case 333: // Trigger linedef executor: Skin - Once
|
||||||
|
|
@ -1229,7 +1271,6 @@ static void P_LoadSidedefs(UINT8 *data)
|
||||||
case 335: // Trigger linedef executor: Object dye - Each time
|
case 335: // Trigger linedef executor: Object dye - Each time
|
||||||
case 336: // Trigger linedef executor: Object dye - Once
|
case 336: // Trigger linedef executor: Object dye - Once
|
||||||
case 425: // Calls P_SetMobjState on calling mobj
|
case 425: // Calls P_SetMobjState on calling mobj
|
||||||
case 434: // Custom Power
|
|
||||||
case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors
|
case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors
|
||||||
case 443: // Calls a named Lua function
|
case 443: // Calls a named Lua function
|
||||||
case 459: // Control text prompt (named tag)
|
case 459: // Control text prompt (named tag)
|
||||||
|
|
@ -1251,8 +1292,11 @@ static void P_LoadSidedefs(UINT8 *data)
|
||||||
M_Memcpy(process+strlen(process), msd->midtexture, 8);
|
M_Memcpy(process+strlen(process), msd->midtexture, 8);
|
||||||
if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')
|
if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')
|
||||||
M_Memcpy(process+strlen(process), msd->bottomtexture, 8);
|
M_Memcpy(process+strlen(process), msd->bottomtexture, 8);
|
||||||
sd->text = Z_Malloc(strlen(process)+1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(sd->text, process, strlen(process)+1);
|
P_WriteDuplicateText(
|
||||||
|
process,
|
||||||
|
&sd->line->stringargs[(isfrontside) ? 0 : 1]
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2379,7 +2423,7 @@ static void P_WriteTextmap(void)
|
||||||
{
|
{
|
||||||
case 9:
|
case 9:
|
||||||
case 10:
|
case 10:
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has ring drainer effect, which is not supported in UDMF. Use action 462 instead.\n"), sizeu1(i));
|
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has ring drainer effect, which is not supported in UDMF. Use action 460 instead.\n"), sizeu1(i));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -2513,6 +2557,8 @@ static void P_WriteTextmap(void)
|
||||||
fprintf(f, "blocking = true;\n");
|
fprintf(f, "blocking = true;\n");
|
||||||
if (wlines[i].flags & ML_BLOCKPLAYERS)
|
if (wlines[i].flags & ML_BLOCKPLAYERS)
|
||||||
fprintf(f, "blockplayers = true;\n");
|
fprintf(f, "blockplayers = true;\n");
|
||||||
|
if (wlines[i].flags & ML_BLOCKMONSTERS)
|
||||||
|
fprintf(f, "blockmonsters = true;\n");
|
||||||
if (wlines[i].flags & ML_TWOSIDED)
|
if (wlines[i].flags & ML_TWOSIDED)
|
||||||
fprintf(f, "twosided = true;\n");
|
fprintf(f, "twosided = true;\n");
|
||||||
if (wlines[i].flags & ML_DONTPEGTOP)
|
if (wlines[i].flags & ML_DONTPEGTOP)
|
||||||
|
|
@ -3169,20 +3215,25 @@ static void P_ProcessLinedefsAfterSidedefs(void)
|
||||||
|
|
||||||
switch (ld->special)
|
switch (ld->special)
|
||||||
{
|
{
|
||||||
// Compile linedef 'text' from both sidedefs 'text' for appropriate specials.
|
// Compile linedef text from both sidedefs for appropriate specials.
|
||||||
case 331: // Trigger linedef executor: Skin - Continuous
|
case 331: // Trigger linedef executor: Skin - Continuous
|
||||||
case 332: // Trigger linedef executor: Skin - Each time
|
case 332: // Trigger linedef executor: Skin - Each time
|
||||||
case 333: // Trigger linedef executor: Skin - Once
|
case 333: // Trigger linedef executor: Skin - Once
|
||||||
case 443: // Calls a named Lua function
|
case 443: // Calls a named Lua function
|
||||||
if (sides[ld->sidenum[0]].text)
|
if (ld->stringargs[0] && ld->stringargs[1])
|
||||||
{
|
{
|
||||||
size_t len = strlen(sides[ld->sidenum[0]].text) + 1;
|
size_t len[2];
|
||||||
if (ld->sidenum[1] != 0xffff && sides[ld->sidenum[1]].text)
|
len[0] = strlen(ld->stringargs[0]);
|
||||||
len += strlen(sides[ld->sidenum[1]].text);
|
len[1] = strlen(ld->stringargs[1]);
|
||||||
ld->text = Z_Malloc(len, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(ld->text, sides[ld->sidenum[0]].text, strlen(sides[ld->sidenum[0]].text) + 1);
|
if (len[1])
|
||||||
if (ld->sidenum[1] != 0xffff && sides[ld->sidenum[1]].text)
|
{
|
||||||
M_Memcpy(ld->text + strlen(ld->text) + 1, sides[ld->sidenum[1]].text, strlen(sides[ld->sidenum[1]].text) + 1);
|
ld->stringargs[0] = Z_Realloc(ld->stringargs[0], len[0] + len[1] + 1, PU_LEVEL, NULL);
|
||||||
|
M_Memcpy(ld->stringargs[0] + len[0] + 1, ld->stringargs[1], len[1] + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Z_Free(ld->stringargs[1]);
|
||||||
|
ld->stringargs[1] = NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 447: // Change colormap
|
case 447: // Change colormap
|
||||||
|
|
@ -3523,10 +3574,17 @@ static nodetype_t P_GetNodetype(const virtres_t *virt, UINT8 **nodedata)
|
||||||
nodetype_t nodetype = NT_UNSUPPORTED;
|
nodetype_t nodetype = NT_UNSUPPORTED;
|
||||||
char signature[4 + 1];
|
char signature[4 + 1];
|
||||||
|
|
||||||
|
*nodedata = NULL;
|
||||||
|
|
||||||
if (udmf)
|
if (udmf)
|
||||||
{
|
{
|
||||||
*nodedata = vres_Find(virt, "ZNODES")->data;
|
virtlump_t *virtznodes = vres_Find(virt, "ZNODES");
|
||||||
supported[NT_XGLN] = supported[NT_XGL3] = true;
|
|
||||||
|
if (virtznodes && virtznodes->size)
|
||||||
|
{
|
||||||
|
*nodedata = virtznodes->data;
|
||||||
|
supported[NT_XGLN] = supported[NT_XGL3] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -3535,24 +3593,39 @@ static nodetype_t P_GetNodetype(const virtres_t *virt, UINT8 **nodedata)
|
||||||
|
|
||||||
if (virtsegs && virtsegs->size)
|
if (virtsegs && virtsegs->size)
|
||||||
{
|
{
|
||||||
*nodedata = vres_Find(virt, "NODES")->data;
|
virtlump_t *virtnodes = vres_Find(virt, "NODES");
|
||||||
return NT_DOOM; // Traditional map format BSP tree.
|
if (virtnodes && virtnodes->size)
|
||||||
}
|
{
|
||||||
|
*nodedata = virtnodes->data;
|
||||||
virtssectors = vres_Find(virt, "SSECTORS");
|
return NT_DOOM; // Traditional map format BSP tree.
|
||||||
|
}
|
||||||
if (virtssectors && virtssectors->size)
|
|
||||||
{ // Possibly GL nodes: NODES ignored, SSECTORS takes precedence as nodes lump, (It is confusing yeah) and has a signature.
|
|
||||||
*nodedata = virtssectors->data;
|
|
||||||
supported[NT_XGLN] = supported[NT_ZGLN] = supported[NT_XGL3] = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Possibly ZDoom extended nodes: SSECTORS is empty, NODES has a signature.
|
{
|
||||||
*nodedata = vres_Find(virt, "NODES")->data;
|
virtssectors = vres_Find(virt, "SSECTORS");
|
||||||
supported[NT_XNOD] = supported[NT_ZNOD] = true;
|
|
||||||
|
if (virtssectors && virtssectors->size)
|
||||||
|
{ // Possibly GL nodes: NODES ignored, SSECTORS takes precedence as nodes lump, (It is confusing yeah) and has a signature.
|
||||||
|
*nodedata = virtssectors->data;
|
||||||
|
supported[NT_XGLN] = supported[NT_ZGLN] = supported[NT_XGL3] = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Possibly ZDoom extended nodes: SSECTORS is empty, NODES has a signature.
|
||||||
|
virtlump_t *virtnodes = vres_Find(virt, "NODES");
|
||||||
|
if (virtnodes && virtnodes->size)
|
||||||
|
{
|
||||||
|
*nodedata = virtnodes->data;
|
||||||
|
supported[NT_XNOD] = supported[NT_ZNOD] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*nodedata == NULL)
|
||||||
|
{
|
||||||
|
I_Error("Level has no nodes (does your map have at least 2 sectors?)");
|
||||||
|
}
|
||||||
|
|
||||||
M_Memcpy(signature, *nodedata, 4);
|
M_Memcpy(signature, *nodedata, 4);
|
||||||
signature[4] = '\0';
|
signature[4] = '\0';
|
||||||
(*nodedata) += 4;
|
(*nodedata) += 4;
|
||||||
|
|
@ -4338,14 +4411,6 @@ static void P_AddBinaryMapTags(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_WriteConstant(INT32 constant, char **target)
|
|
||||||
{
|
|
||||||
char buffer[12];
|
|
||||||
sprintf(buffer, "%d", constant);
|
|
||||||
*target = Z_Malloc(strlen(buffer) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(*target, buffer, strlen(buffer) + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static line_t *P_FindPointPushLine(taglist_t *list)
|
static line_t *P_FindPointPushLine(taglist_t *list)
|
||||||
{
|
{
|
||||||
INT32 i, l;
|
INT32 i, l;
|
||||||
|
|
@ -4585,7 +4650,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
|
lines[i].args[1] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
|
||||||
lines[i].args[2] = !!(lines[i].flags & ML_SKEWTD);
|
lines[i].args[2] = !!(lines[i].flags & ML_SKEWTD);
|
||||||
P_WriteConstant(sides[lines[i].sidenum[0]].toptexture, &lines[i].stringargs[0]);
|
|
||||||
break;
|
break;
|
||||||
case 16: //Minecart parameters
|
case 16: //Minecart parameters
|
||||||
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
|
|
@ -5060,7 +5124,7 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
lines[i].args[2] = 16;
|
lines[i].args[2] = 16;
|
||||||
}
|
}
|
||||||
if (lines[i].flags & ML_MIDSOLID)
|
if (lines[i].flags & ML_MIDSOLID)
|
||||||
P_WriteConstant(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS, &lines[i].stringargs[0]);
|
P_WriteSfx(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS, &lines[i].stringargs[0]);
|
||||||
if (lines[i].flags & ML_SKEWTD) // Kart Z delay. Yes, it used the same field as the above.
|
if (lines[i].flags & ML_SKEWTD) // Kart Z delay. Yes, it used the same field as the above.
|
||||||
lines[i].args[3] = (unsigned)(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS);
|
lines[i].args[3] = (unsigned)(sides[lines[i].sidenum[0]].textureoffset >> FRACBITS);
|
||||||
break;
|
break;
|
||||||
|
|
@ -5329,11 +5393,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
else
|
else
|
||||||
lines[i].args[0] = TMT_CONTINUOUS;
|
lines[i].args[0] = TMT_CONTINUOUS;
|
||||||
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
|
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
if (lines[i].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(lines[i].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], lines[i].text, strlen(lines[i].text) + 1);
|
|
||||||
}
|
|
||||||
lines[i].special = 331;
|
lines[i].special = 331;
|
||||||
break;
|
break;
|
||||||
case 334: // Object dye - continuous
|
case 334: // Object dye - continuous
|
||||||
|
|
@ -5346,11 +5405,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
else
|
else
|
||||||
lines[i].args[0] = TMT_CONTINUOUS;
|
lines[i].args[0] = TMT_CONTINUOUS;
|
||||||
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
|
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
lines[i].special = 334;
|
lines[i].special = 334;
|
||||||
break;
|
break;
|
||||||
case 337: //Emerald check - continuous
|
case 337: //Emerald check - continuous
|
||||||
|
|
@ -5489,11 +5543,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
lines[i].args[5] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].textureoffset >> FRACBITS : 0;
|
lines[i].args[5] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].textureoffset >> FRACBITS : 0;
|
||||||
lines[i].args[6] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].rowoffset >> FRACBITS : -1;
|
lines[i].args[6] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].rowoffset >> FRACBITS : -1;
|
||||||
lines[i].args[7] = sides[lines[i].sidenum[0]].bottomtexture;
|
lines[i].args[7] = sides[lines[i].sidenum[0]].bottomtexture;
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 414: //Play sound effect
|
case 414: //Play sound effect
|
||||||
lines[i].args[3] = tag;
|
lines[i].args[3] = tag;
|
||||||
|
|
@ -5533,37 +5582,7 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
lines[i].args[2] = TMSL_EVERYONE;
|
lines[i].args[2] = TMSL_EVERYONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 415: //Run script
|
|
||||||
{
|
|
||||||
INT32 scrnum;
|
|
||||||
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(9, PU_LEVEL, NULL);
|
|
||||||
strcpy(lines[i].stringargs[0], G_BuildMapName(gamemap));
|
|
||||||
lines[i].stringargs[0][0] = 'S';
|
|
||||||
lines[i].stringargs[0][1] = 'C';
|
|
||||||
lines[i].stringargs[0][2] = 'R';
|
|
||||||
|
|
||||||
scrnum = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
|
||||||
if (scrnum < 0 || scrnum > 999)
|
|
||||||
{
|
|
||||||
scrnum = 0;
|
|
||||||
lines[i].stringargs[0][5] = lines[i].stringargs[0][6] = lines[i].stringargs[0][7] = '0';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0][5] = (char)('0' + (char)((scrnum / 100)));
|
|
||||||
lines[i].stringargs[0][6] = (char)('0' + (char)((scrnum % 100) / 10));
|
|
||||||
lines[i].stringargs[0][7] = (char)('0' + (char)(scrnum % 10));
|
|
||||||
}
|
|
||||||
lines[i].stringargs[0][8] = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 416: //Start adjustable flickering light
|
case 416: //Start adjustable flickering light
|
||||||
case 417: //Start adjustable pulsating light
|
case 417: //Start adjustable pulsating light
|
||||||
case 602: //Adjustable pulsating light
|
case 602: //Adjustable pulsating light
|
||||||
|
|
@ -5628,13 +5647,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
|
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
break;
|
break;
|
||||||
case 425: //Change object state
|
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 426: //Stop object
|
case 426: //Stop object
|
||||||
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
|
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
break;
|
break;
|
||||||
|
|
@ -5671,20 +5683,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
case 433: //Enable/disable gravity flip
|
case 433: //Enable/disable gravity flip
|
||||||
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
|
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
break;
|
break;
|
||||||
case 434: //Award power-up
|
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
if (lines[i].sidenum[1] != 0xffff && lines[i].flags & ML_BLOCKPLAYERS) // read power from back sidedef
|
|
||||||
{
|
|
||||||
lines[i].stringargs[1] = Z_Malloc(strlen(sides[lines[i].sidenum[1]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[1], sides[lines[i].sidenum[1]].text, strlen(sides[lines[i].sidenum[1]].text) + 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
P_WriteConstant((lines[i].flags & ML_NOCLIMB) ? -1 : (sides[lines[i].sidenum[0]].textureoffset >> FRACBITS), &lines[i].stringargs[1]);
|
|
||||||
break;
|
|
||||||
case 435: //Change plane scroller direction
|
case 435: //Change plane scroller direction
|
||||||
lines[i].args[0] = tag;
|
lines[i].args[0] = tag;
|
||||||
lines[i].args[1] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS;
|
lines[i].args[1] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS;
|
||||||
|
|
@ -5711,31 +5709,7 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
break;
|
break;
|
||||||
case 442: //Change object type state
|
case 442: //Change object type state
|
||||||
lines[i].args[2] = tag;
|
lines[i].args[2] = tag;
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
lines[i].args[3] = (lines[i].sidenum[1] == 0xffff) ? 1 : 0;
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
if (lines[i].sidenum[1] == 0xffff)
|
|
||||||
lines[i].args[3] = 1;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lines[i].args[3] = 0;
|
|
||||||
if (sides[lines[i].sidenum[1]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[1] = Z_Malloc(strlen(sides[lines[i].sidenum[1]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[1], sides[lines[i].sidenum[1]].text, strlen(sides[lines[i].sidenum[1]].text) + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 443: //Call Lua function
|
|
||||||
if (lines[i].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(lines[i].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], lines[i].text, strlen(lines[i].text) + 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in the front texture fields)\n", sizeu1(i));
|
|
||||||
break;
|
break;
|
||||||
case 444: //Earthquake
|
case 444: //Earthquake
|
||||||
lines[i].args[0] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
|
lines[i].args[0] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
|
||||||
|
|
@ -5887,11 +5861,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
if (lines[i].flags & ML_MIDSOLID)
|
if (lines[i].flags & ML_MIDSOLID)
|
||||||
lines[i].args[3] |= TMP_FREEZETHINKERS;*/
|
lines[i].args[3] |= TMP_FREEZETHINKERS;*/
|
||||||
lines[i].args[4] = (lines[i].sidenum[1] != 0xFFFF) ? sides[lines[i].sidenum[1]].textureoffset >> FRACBITS : tag;
|
lines[i].args[4] = (lines[i].sidenum[1] != 0xFFFF) ? sides[lines[i].sidenum[1]].textureoffset >> FRACBITS : tag;
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 460: //Award rings
|
case 460: //Award rings
|
||||||
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
|
|
@ -5920,18 +5889,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lines[i].args[5] = 0;
|
lines[i].args[5] = 0;
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 463: //Dye object
|
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 464: //Trigger egg capsule
|
case 464: //Trigger egg capsule
|
||||||
lines[i].args[0] = tag;
|
lines[i].args[0] = tag;
|
||||||
|
|
@ -5946,16 +5903,6 @@ static void P_ConvertBinaryLinedefTypes(void)
|
||||||
lines[i].args[2] = TML_SECTOR;
|
lines[i].args[2] = TML_SECTOR;
|
||||||
lines[i].args[3] = !!(lines[i].flags & ML_MIDPEG);
|
lines[i].args[3] = !!(lines[i].flags & ML_MIDPEG);
|
||||||
break;
|
break;
|
||||||
case 475: // ACS_Execute
|
|
||||||
case 476: // ACS_ExecuteAlways
|
|
||||||
case 477: // ACS_Suspend
|
|
||||||
case 478: // ACS_Terminate
|
|
||||||
if (sides[lines[i].sidenum[0]].text)
|
|
||||||
{
|
|
||||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
|
||||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 480: //Polyobject - door slide
|
case 480: //Polyobject - door slide
|
||||||
lines[i].args[0] = tag;
|
lines[i].args[0] = tag;
|
||||||
lines[i].args[1] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
lines[i].args[1] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
|
|
@ -6746,7 +6693,9 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
break;
|
break;
|
||||||
case 543: //Balloon
|
case 543: //Balloon
|
||||||
if (mapthings[i].angle > 0)
|
if (mapthings[i].angle > 0)
|
||||||
P_WriteConstant(((mapthings[i].angle - 1) % (numskincolors - 1)) + 1, &mapthings[i].stringargs[0]);
|
{
|
||||||
|
P_WriteSkincolor(((mapthings[i].angle - 1) % (numskincolors - 1)) + 1, &mapthings[i].stringargs[0]);
|
||||||
|
}
|
||||||
mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH);
|
mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH);
|
||||||
break;
|
break;
|
||||||
case 555: //Diagonal yellow spring
|
case 555: //Diagonal yellow spring
|
||||||
|
|
@ -6771,22 +6720,22 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
case 706: //Water ambience G
|
case 706: //Water ambience G
|
||||||
case 707: //Water ambience H
|
case 707: //Water ambience H
|
||||||
mapthings[i].args[0] = 35;
|
mapthings[i].args[0] = 35;
|
||||||
P_WriteConstant(sfx_amwtr1 + mapthings[i].type - 700, &mapthings[i].stringargs[0]);
|
P_WriteSfx(sfx_amwtr1 + mapthings[i].type - 700, &mapthings[i].stringargs[0]);
|
||||||
mapthings[i].type = 700;
|
mapthings[i].type = 700;
|
||||||
break;
|
break;
|
||||||
case 708: //Disco ambience
|
case 708: //Disco ambience
|
||||||
mapthings[i].args[0] = 512;
|
mapthings[i].args[0] = 512;
|
||||||
P_WriteConstant(sfx_ambint, &mapthings[i].stringargs[0]);
|
P_WriteSfx(sfx_ambint, &mapthings[i].stringargs[0]);
|
||||||
mapthings[i].type = 700;
|
mapthings[i].type = 700;
|
||||||
break;
|
break;
|
||||||
case 709: //Volcano ambience
|
case 709: //Volcano ambience
|
||||||
mapthings[i].args[0] = 220;
|
mapthings[i].args[0] = 220;
|
||||||
P_WriteConstant(sfx_ambin2, &mapthings[i].stringargs[0]);
|
P_WriteSfx(sfx_ambin2, &mapthings[i].stringargs[0]);
|
||||||
mapthings[i].type = 700;
|
mapthings[i].type = 700;
|
||||||
break;
|
break;
|
||||||
case 710: //Machine ambience
|
case 710: //Machine ambience
|
||||||
mapthings[i].args[0] = 24;
|
mapthings[i].args[0] = 24;
|
||||||
P_WriteConstant(sfx_ambmac, &mapthings[i].stringargs[0]);
|
P_WriteSfx(sfx_ambmac, &mapthings[i].stringargs[0]);
|
||||||
mapthings[i].type = 700;
|
mapthings[i].type = 700;
|
||||||
break;
|
break;
|
||||||
case 750: //Slope vertex
|
case 750: //Slope vertex
|
||||||
|
|
@ -6849,8 +6798,7 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
mapthings[i].args[3] = sides[lines[j].sidenum[0]].rowoffset >> FRACBITS;
|
mapthings[i].args[3] = sides[lines[j].sidenum[0]].rowoffset >> FRACBITS;
|
||||||
mapthings[i].args[4] = lines[j].backsector ? sides[lines[j].sidenum[1]].textureoffset >> FRACBITS : 0;
|
mapthings[i].args[4] = lines[j].backsector ? sides[lines[j].sidenum[1]].textureoffset >> FRACBITS : 0;
|
||||||
mapthings[i].args[6] = mapthings[i].angle;
|
mapthings[i].args[6] = mapthings[i].angle;
|
||||||
if (sides[lines[j].sidenum[0]].toptexture)
|
P_WriteDuplicateText(lines[j].stringargs[0], &mapthings[i].stringargs[0]);
|
||||||
P_WriteConstant(sides[lines[j].sidenum[0]].toptexture, &mapthings[i].stringargs[0]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 762: //PolyObject spawn point (crush)
|
case 762: //PolyObject spawn point (crush)
|
||||||
|
|
@ -6938,8 +6886,8 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
mapthings[i].args[8] |= TMM_ALWAYSTHINK;
|
mapthings[i].args[8] |= TMM_ALWAYSTHINK;
|
||||||
if (mapthings[i].type == 1110)
|
if (mapthings[i].type == 1110)
|
||||||
{
|
{
|
||||||
P_WriteConstant(sides[lines[j].sidenum[0]].toptexture, &mapthings[i].stringargs[0]);
|
P_WriteDuplicateText(lines[j].stringargs[0], &mapthings[i].stringargs[0]);
|
||||||
P_WriteConstant(lines[j].backsector ? sides[lines[j].sidenum[1]].toptexture : MT_NULL, &mapthings[i].stringargs[1]);
|
P_WriteDuplicateText(lines[j].stringargs[1], &mapthings[i].stringargs[1]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -6980,7 +6928,11 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
mapthings[i].args[0] = P_AproxDistance(lines[j].dx, lines[j].dy) >> FRACBITS;
|
mapthings[i].args[0] = P_AproxDistance(lines[j].dx, lines[j].dy) >> FRACBITS;
|
||||||
mapthings[i].args[1] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS;
|
mapthings[i].args[1] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
mapthings[i].args[2] = !!(lines[j].flags & ML_NOCLIMB);
|
mapthings[i].args[2] = !!(lines[j].flags & ML_NOCLIMB);
|
||||||
P_WriteConstant(MT_ROCKCRUMBLE1 + (sides[lines[j].sidenum[0]].rowoffset >> FRACBITS), &mapthings[i].stringargs[0]);
|
INT32 id = (sides[lines[j].sidenum[0]].rowoffset >> FRACBITS);
|
||||||
|
// Rather than introduce deh_tables.h as a dependency for literally one
|
||||||
|
// conversion, we just... recreate the string expected to be produced.
|
||||||
|
if (id > 0 && id < 16)
|
||||||
|
P_WriteDuplicateText(va("MT_ROCKCRUMBLE%d", id+1), &mapthings[i].stringargs[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1221: //Minecart saloon door
|
case 1221: //Minecart saloon door
|
||||||
|
|
@ -7193,6 +7145,55 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
case 3786: // MT_BATTLEUFO_SPAWNER
|
case 3786: // MT_BATTLEUFO_SPAWNER
|
||||||
mapthings[i].args[0] = mapthings[i].angle;
|
mapthings[i].args[0] = mapthings[i].angle;
|
||||||
break;
|
break;
|
||||||
|
case 3400: // MT_WATERPALACETURBINE (TODO: not yet hardcoded)
|
||||||
|
{
|
||||||
|
mtag_t tag = (mtag_t)mapthings[i].angle;
|
||||||
|
INT32 j = Tag_FindLineSpecial(2009, tag);
|
||||||
|
|
||||||
|
if (j == -1)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Water Palace Turbine setup: Unable to find parameter line 2009 (tag %d)!\n", tag);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!lines[j].backsector)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Water Palace Turbine setup: No backside for parameter line 2009 (tag %d)!\n", tag);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
mapthings[i].angle = sides[lines[j].sidenum[0]].rowoffset >> FRACBITS;
|
||||||
|
|
||||||
|
if (mapthings[i].options & MTF_EXTRA)
|
||||||
|
mapthings[i].args[0] = 1;
|
||||||
|
if (mapthings[i].options & MTF_OBJECTSPECIAL)
|
||||||
|
mapthings[i].args[1] = 1;
|
||||||
|
|
||||||
|
mapthings[i].args[2] = lines[j].frontsector->floorheight >> FRACBITS;
|
||||||
|
mapthings[i].args[3] = lines[j].frontsector->ceilingheight >> FRACBITS;
|
||||||
|
|
||||||
|
mapthings[i].args[4] = lines[j].backsector->floorheight >> FRACBITS;
|
||||||
|
|
||||||
|
mapthings[i].args[5] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
|
if (mapthings[i].args[5] < 0)
|
||||||
|
mapthings[i].args[5] = -mapthings[i].args[5];
|
||||||
|
|
||||||
|
mapthings[i].args[6] = sides[lines[j].sidenum[1]].rowoffset >> FRACBITS;
|
||||||
|
if (mapthings[i].args[6] < 0)
|
||||||
|
mapthings[i].args[6] = -mapthings[i].args[6];
|
||||||
|
|
||||||
|
mapthings[i].args[7] = sides[lines[j].sidenum[1]].textureoffset >> FRACBITS;
|
||||||
|
if (mapthings[i].args[7] < 0)
|
||||||
|
mapthings[i].args[7] = -mapthings[i].args[7];
|
||||||
|
|
||||||
|
if (lines[j].flags & ML_SKEWTD)
|
||||||
|
mapthings[i].args[8] = R_PointToDist2(lines[j].v2->x, lines[j].v2->y, lines[j].v1->x, lines[j].v1->y) >> FRACBITS;
|
||||||
|
|
||||||
|
if (lines[j].flags & ML_NOSKEW)
|
||||||
|
mapthings[i].args[9] = 1;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 3441: // MT_DASHRING (TODO: not yet hardcoded)
|
case 3441: // MT_DASHRING (TODO: not yet hardcoded)
|
||||||
case 3442: // MT_RAINBOWDASHRING (TODO: not yet hardcoded)
|
case 3442: // MT_RAINBOWDASHRING (TODO: not yet hardcoded)
|
||||||
mapthings[i].args[0] = mapthings[i].options & 13;
|
mapthings[i].args[0] = mapthings[i].options & 13;
|
||||||
|
|
@ -7530,34 +7531,6 @@ void P_RespawnThings(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void P_RunLevelScript(const char *scriptname)
|
|
||||||
{
|
|
||||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_SCRIPTISFILE))
|
|
||||||
{
|
|
||||||
lumpnum_t lumpnum;
|
|
||||||
char newname[9];
|
|
||||||
|
|
||||||
strncpy(newname, scriptname, 8);
|
|
||||||
|
|
||||||
newname[8] = '\0';
|
|
||||||
|
|
||||||
lumpnum = W_CheckNumForName(newname);
|
|
||||||
|
|
||||||
if (lumpnum == LUMPERROR || W_LumpLength(lumpnum) == 0)
|
|
||||||
{
|
|
||||||
CONS_Debug(DBG_SETUP, "SOC Error: script lump %s not found/not valid.\n", newname);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
COM_BufInsertText(W_CacheLumpNum(lumpnum, PU_CACHE));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
COM_BufAddText(va("exec %s\n", scriptname));
|
|
||||||
}
|
|
||||||
COM_BufExecute(); // Run it!
|
|
||||||
}
|
|
||||||
|
|
||||||
static void P_ResetSpawnpoints(void)
|
static void P_ResetSpawnpoints(void)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
@ -7982,9 +7955,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
||||||
if (mapheaderinfo[gamemap-1]->runsoc[0] != '#')
|
if (mapheaderinfo[gamemap-1]->runsoc[0] != '#')
|
||||||
P_RunSOC(mapheaderinfo[gamemap-1]->runsoc);
|
P_RunSOC(mapheaderinfo[gamemap-1]->runsoc);
|
||||||
|
|
||||||
if (cv_runscripts.value && mapheaderinfo[gamemap-1]->scriptname[0] != '#')
|
|
||||||
P_RunLevelScript(mapheaderinfo[gamemap-1]->scriptname);
|
|
||||||
|
|
||||||
P_InitLevelSettings();
|
P_InitLevelSettings();
|
||||||
|
|
||||||
for (i = 0; i <= r_splitscreen; i++)
|
for (i = 0; i <= r_splitscreen; i++)
|
||||||
|
|
|
||||||
43
src/p_spec.c
43
src/p_spec.c
|
|
@ -2969,18 +2969,6 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
||||||
P_PlaySFX(stringargs[0] ? get_number(stringargs[0]) : sfx_None, mo, callsec, args[3], args[1], args[2]);
|
P_PlaySFX(stringargs[0] ? get_number(stringargs[0]) : sfx_None, mo, callsec, args[3], args[1], args[2]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 415: // Run a script
|
|
||||||
if (cv_runscripts.value)
|
|
||||||
{
|
|
||||||
lumpnum_t lumpnum = W_CheckNumForName(stringargs[0]);
|
|
||||||
|
|
||||||
if (lumpnum == LUMPERROR || W_LumpLength(lumpnum) == 0)
|
|
||||||
CONS_Debug(DBG_SETUP, "Line type 415 Executor: script lump %s not found/not valid.\n", stringargs[0]);
|
|
||||||
else
|
|
||||||
COM_BufInsertText(W_CacheLumpNum(lumpnum, PU_CACHE));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 416: // Spawn adjustable fire flicker
|
case 416: // Spawn adjustable fire flicker
|
||||||
TAG_ITER_SECTORS(args[0], secnum)
|
TAG_ITER_SECTORS(args[0], secnum)
|
||||||
P_SpawnAdjustableFireFlicker(§ors[secnum], args[2],
|
P_SpawnAdjustableFireFlicker(§ors[secnum], args[2],
|
||||||
|
|
@ -4191,19 +4179,38 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
||||||
|
|
||||||
case 460: // Award rings
|
case 460: // Award rings
|
||||||
{
|
{
|
||||||
|
if (gametyperules & GTR_SPHERES)
|
||||||
|
return false;
|
||||||
|
|
||||||
INT16 rings = args[0];
|
INT16 rings = args[0];
|
||||||
INT32 delay = args[1];
|
INT32 delay = args[1];
|
||||||
if (mo && mo->player)
|
if (
|
||||||
|
mo && mo->player // Player
|
||||||
|
&& rings != 0 // Any effect
|
||||||
|
&& (delay <= 0 || !(leveltime % delay)) // Timing
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Don't award rings while SPB is targetting you
|
if (rings > 0)
|
||||||
if (mo->player->pflags & PF_RINGLOCK)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (delay <= 0 || !(leveltime % delay))
|
|
||||||
{
|
{
|
||||||
|
// Don't award rings while SPB is targetting you
|
||||||
|
if (mo->player->pflags & PF_RINGLOCK)
|
||||||
|
return false;
|
||||||
|
|
||||||
// args[2]: don't cap rings to 20
|
// args[2]: don't cap rings to 20
|
||||||
K_AwardPlayerRings(mo->player, rings, args[2]);
|
K_AwardPlayerRings(mo->player, rings, args[2]);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Don't push you below baseline
|
||||||
|
if (mo->player->rings <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (rings > mo->player->rings)
|
||||||
|
rings = mo->player->rings;
|
||||||
|
|
||||||
|
mo->player->rings -= rings;
|
||||||
|
S_StartSound(mo, sfx_antiri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -612,7 +612,6 @@ struct line_t
|
||||||
|
|
||||||
boolean tripwire;
|
boolean tripwire;
|
||||||
|
|
||||||
char *text; // a concatenation of all front and back texture names, for linedef specials that require a string.
|
|
||||||
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
||||||
|
|
||||||
// UDMF user-defined custom properties.
|
// UDMF user-defined custom properties.
|
||||||
|
|
@ -640,8 +639,6 @@ struct side_t
|
||||||
INT16 special; // the special of the linedef this side belongs to
|
INT16 special; // the special of the linedef this side belongs to
|
||||||
INT16 repeatcnt; // # of times to repeat midtexture
|
INT16 repeatcnt; // # of times to repeat midtexture
|
||||||
|
|
||||||
char *text; // a concatenation of all top, bottom, and mid texture names, for linedef specials that require a string.
|
|
||||||
|
|
||||||
extracolormap_t *colormap_data; // storage for colormaps; not applied to sectors.
|
extracolormap_t *colormap_data; // storage for colormaps; not applied to sectors.
|
||||||
|
|
||||||
// UDMF user-defined custom properties.
|
// UDMF user-defined custom properties.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue