mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
NiGHTS objectplace: Place new hoop 1713 instead of 1705
* Add cv_ophoopflags consvar to manage hoop flags separately from other flags * Simplify hoop mt->options operation so we're not recalculating Z flags; just XOR cv_opflags OR cv_ophoopflags
This commit is contained in:
parent
01f1e7fc33
commit
e87530a9c3
3 changed files with 6 additions and 10 deletions
|
@ -807,6 +807,7 @@ void D_RegisterClientCommands(void)
|
||||||
COM_AddCommand("writethings", Command_Writethings_f);
|
COM_AddCommand("writethings", Command_Writethings_f);
|
||||||
CV_RegisterVar(&cv_speed);
|
CV_RegisterVar(&cv_speed);
|
||||||
CV_RegisterVar(&cv_opflags);
|
CV_RegisterVar(&cv_opflags);
|
||||||
|
CV_RegisterVar(&cv_ophoopflags);
|
||||||
CV_RegisterVar(&cv_mapthingnum);
|
CV_RegisterVar(&cv_mapthingnum);
|
||||||
// CV_RegisterVar(&cv_grid);
|
// CV_RegisterVar(&cv_grid);
|
||||||
// CV_RegisterVar(&cv_snapto);
|
// CV_RegisterVar(&cv_snapto);
|
||||||
|
|
|
@ -779,10 +779,12 @@ void Command_Setcontinues_f(void)
|
||||||
static CV_PossibleValue_t op_mapthing_t[] = {{0, "MIN"}, {4095, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t op_mapthing_t[] = {{0, "MIN"}, {4095, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t op_speed_t[] = {{1, "MIN"}, {128, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t op_speed_t[] = {{1, "MIN"}, {128, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t op_flags_t[] = {{0, "MIN"}, {15, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t op_flags_t[] = {{0, "MIN"}, {15, "MAX"}, {0, NULL}};
|
||||||
|
static CV_PossibleValue_t op_hoopflags_t[] = {{0, "MIN"}, {15, "MAX"}, {0, NULL}};
|
||||||
|
|
||||||
consvar_t cv_mapthingnum = {"op_mapthingnum", "0", CV_NOTINNET, op_mapthing_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_mapthingnum = {"op_mapthingnum", "0", CV_NOTINNET, op_mapthing_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_speed = {"op_speed", "16", CV_NOTINNET, op_speed_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_speed = {"op_speed", "16", CV_NOTINNET, op_speed_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_opflags = {"op_flags", "0", CV_NOTINNET, op_flags_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_opflags = {"op_flags", "0", CV_NOTINNET, op_flags_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_ophoopflags = {"op_hoopflags", "4", CV_NOTINNET, op_hoopflags_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
boolean objectplacing = false;
|
boolean objectplacing = false;
|
||||||
mobjtype_t op_currentthing = 0; // For the object placement mode
|
mobjtype_t op_currentthing = 0; // For the object placement mode
|
||||||
|
@ -986,17 +988,10 @@ void OP_NightsObjectplace(player_t *player)
|
||||||
{
|
{
|
||||||
UINT16 angle = (UINT16)(player->anotherflyangle % 360);
|
UINT16 angle = (UINT16)(player->anotherflyangle % 360);
|
||||||
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
|
INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle
|
||||||
sector_t *sec = player->mo->subsector->sector;
|
|
||||||
#ifdef ESLOPE
|
|
||||||
fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
|
|
||||||
#else
|
|
||||||
fixed_t fheight = sec->floorheight;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
player->pflags |= PF_ATTACKDOWN;
|
player->pflags |= PF_ATTACKDOWN;
|
||||||
|
|
||||||
mt = OP_CreateNewMapThing(player, 1705, false);
|
mt = OP_CreateNewMapThing(player, 1713, false);
|
||||||
|
|
||||||
// Tilt
|
// Tilt
|
||||||
mt->angle = (INT16)FixedInt(FixedDiv(angle*FRACUNIT, 360*(FRACUNIT/256)));
|
mt->angle = (INT16)FixedInt(FixedDiv(angle*FRACUNIT, 360*(FRACUNIT/256)));
|
||||||
|
@ -1007,7 +1002,7 @@ void OP_NightsObjectplace(player_t *player)
|
||||||
temp += 90;
|
temp += 90;
|
||||||
temp %= 360;
|
temp %= 360;
|
||||||
|
|
||||||
mt->options = (UINT16)((player->mo->z - fheight)>>FRACBITS);
|
mt->options = (mt->options ^ (UINT16)cv_opflags.value) | (UINT16)cv_ophoopflags.value;
|
||||||
mt->angle = (INT16)(mt->angle+(INT16)((FixedInt(FixedDiv(temp*FRACUNIT, 360*(FRACUNIT/256))))<<8));
|
mt->angle = (INT16)(mt->angle+(INT16)((FixedInt(FixedDiv(temp*FRACUNIT, 360*(FRACUNIT/256))))<<8));
|
||||||
|
|
||||||
P_SpawnHoopsAndRings(mt);
|
P_SpawnHoopsAndRings(mt);
|
||||||
|
|
|
@ -28,7 +28,7 @@ void cht_Init(void);
|
||||||
void Command_ObjectPlace_f(void);
|
void Command_ObjectPlace_f(void);
|
||||||
void Command_Writethings_f(void);
|
void Command_Writethings_f(void);
|
||||||
|
|
||||||
extern consvar_t cv_opflags, cv_mapthingnum, cv_speed;
|
extern consvar_t cv_opflags, cv_ophoopflags, cv_mapthingnum, cv_speed;
|
||||||
//extern consvar_t cv_snapto, cv_grid;
|
//extern consvar_t cv_snapto, cv_grid;
|
||||||
|
|
||||||
extern boolean objectplacing;
|
extern boolean objectplacing;
|
||||||
|
|
Loading…
Reference in a new issue