- cheats.cpp and ccmds.cpp handled.

# Conflicts:
#	source/games/duke/src/cheats.cpp
This commit is contained in:
Christoph Oelckers 2020-10-23 20:07:26 +02:00
parent ad84c8149e
commit 669fcc967f
3 changed files with 15 additions and 14 deletions

View File

@ -1624,7 +1624,7 @@ void movetransports_r(void)
spawn(act, TRANSPORTERBEAM);
S_PlayActorSound(TELEPORTER, act);
for (k = connecthead; k >= 0; k = connectpoint2[k])// connectpoinhittype[i].temp_data[1][k])
for (k = connecthead; k >= 0; k = connectpoint2[k])
if (ps[k].cursectnum == Owner->s.sectnum)
{
ps[k].frag_ps = p;

View File

@ -46,7 +46,7 @@ static int ccmd_spawn(CCmdFuncPtr parm)
unsigned int cstat = 0, picnum = 0;
unsigned int pal = 0;
int ang = 0;
int set = 0, idx;
int set = 0;
#if 0 // fixme - route through the network and this limitation becomes irrelevant
if (netgame || numplayers > 1 || !(ps[myconnectindex].gm & MODE_GAME)) {
@ -88,14 +88,15 @@ static int ccmd_spawn(CCmdFuncPtr parm)
return CCMD_SHOWHELP;
}
idx = fi.spawn(ps[myconnectindex].i, (short)picnum);
if (set & 1) sprite[idx].pal = (char)pal;
if (set & 2) sprite[idx].cstat = (short)cstat;
if (set & 4) sprite[idx].ang = ang;
auto spawned = spawn(ps[myconnectindex].GetActor(), picnum);
if (set & 1) spawned->s.pal = (char)pal;
if (set & 2) spawned->s.cstat = (short)cstat;
if (set & 4) spawned->s.ang = ang;
if (set & 8) {
if (setsprite(idx, x, y, z) < 0) {
if (setsprite(spawned, x, y, z) < 0)
{
Printf("spawn: Sprite can't be spawned into null space\n");
deletesprite(idx);
deletesprite(spawned);
}
}

View File

@ -118,10 +118,10 @@ static const char *cheatKfc(int player)
{
for (int i = 0; i < 7; i++)
{
int spr = fi.spawn(ps[player].i, TILE_HEN);
sprite[spr].pal = 1;
sprite[spr].xrepeat = sprite[spr].xrepeat << 2;
sprite[spr].yrepeat = sprite[spr].yrepeat << 2;
auto spr = spawn(ps[player].GetActor(), TILE_HEN);
spr->s.pal = 1;
spr->s.xrepeat = spr->s.xrepeat << 2;
spr->s.yrepeat = spr->s.yrepeat << 2;
}
return quoteMgr.GetQuote(QUOTE_CHEAT_KFC);
}
@ -195,7 +195,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
ps[player].gotweapon.Zero();
ps[player].curr_weapon = KNEE_WEAPON;
ps[player].nocheat = 1;
sprite[ps[player].i].extra = 1;
ps[player].GetActor()->s.extra = 1;
return quoteMgr.GetQuote(QUOTE_YERFUCKED);
case CHT_AARON:
@ -486,7 +486,7 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
break;
case GIVE_HEALTH:
sprite[ps[player].i].extra = max_player_health << 1;
ps[player].GetActor()->s.extra = max_player_health << 1;
break;
case GIVE_WEAPONS: