I_Error("P_StartButton: no button slots left!");
}
//
//Function that changes wall texture.
//Tell it if switch is ok to use again (1=yes, it’s a button).
void P_ChangeSwitchTexture
( line_t* |
line, |
int |
useAgain ) |
{ |
|
int |
texTop; |
int |
texMid; |
int |
texBot; |
int |
i; |
int |
sound; |
if (!useAgain) line->special = 0;
texTop = sides[line->sidenum[0]].toptexture; texMid = sides[line->sidenum[0]].midtexture; texBot = sides[line->sidenum[0]].bottomtexture;
sound = sfx_swtchn;
// EXIT SWITCH?
if (line->special == 11) sound = sfx_swtchx;
for (i = 0;i < numswitches*2;i++)
{
if (switchlist[i] == texTop)
{
S_StartSound(buttonlist->soundorg,sound); sides[line->sidenum[0]].toptexture = switchlist[i^1];
if (useAgain) P_StartButton(line,top,switchlist[i],BUTTONTIME);
return;
}
else
{
if (switchlist[i] == texMid)
{
S_StartSound(buttonlist->soundorg,sound); sides[line->sidenum[0]].midtexture = switchlist[i^1];
if (useAgain)
P_StartButton(line, middle,switchlist[i],BUTTONTIME);
return;
}
else
{
if (switchlist[i] == texBot)
{
S_StartSound(buttonlist->soundorg,sound); sides[line->sidenum[0]].bottomtexture = switchlist[i^1];