Allow changing of stkm spawn element by setting ctype

This commit is contained in:
jacksonmj 2011-06-24 23:20:01 +01:00 committed by Simon Robertshaw
parent 1a17e35c6f
commit d515575612
3 changed files with 12 additions and 2 deletions

View File

@ -15,6 +15,10 @@ int update_STKM(UPDATE_FUNC_ARGS) {
int r, rx, ry;
float pp, d;
float dt = 0.9;///(FPSB*FPSB); //Delta time in square
if ((parts[i].ctype>0 && parts[i].ctype<PT_NUM && ptypes[parts[i].ctype].falldown>0) || parts[i].ctype==SPC_AIR || parts[i].ctype == PT_NEUT || parts[i].ctype == PT_PHOT)
player[2] = parts[i].ctype;
//Tempirature handling
if (parts[i].temp<243)
parts[i].life -= 1;
@ -420,5 +424,6 @@ int update_STKM(UPDATE_FUNC_ARGS) {
parts[i].life -= 1;
isplayer = 1;
parts[i].ctype = player[2];
return 0;
}

View File

@ -15,6 +15,10 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
int r, rx, ry;
float pp, d;
float dt = 0.9;///(FPSB*FPSB); //Delta time in square
if ((parts[i].ctype>0 && parts[i].ctype<PT_NUM && ptypes[parts[i].ctype].falldown>0) || parts[i].ctype==SPC_AIR || parts[i].ctype == PT_NEUT || parts[i].ctype == PT_PHOT)
player2[2] = parts[i].ctype;
//Tempirature handling
if (parts[i].temp<243)
parts[i].life -= 1;
@ -420,6 +424,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
parts[i].life -= 1;
isplayer2 = 1;
parts[i].ctype = player2[2];
return 0;
}

View File

@ -3470,14 +3470,14 @@ int main(int argc, char *argv[])
//Setting an element for the stick man
if (isplayer==0)
{
if (ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT)
if ((sr<PT_NUM && ptypes[sr].falldown>0) || sr==SPC_AIR || sr == PT_NEUT || sr == PT_PHOT)
player[2] = sr;
else
player[2] = PT_DUST;
}
if (isplayer2==0)
{
if (ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT)
if ((sr<PT_NUM && ptypes[sr].falldown>0) || sr==SPC_AIR || sr == PT_NEUT || sr == PT_PHOT)
player2[2] = sr;
else
player2[2] = PT_DUST;