From cbade0ca164e36750d1ef4b2ae125162a8ac8a76 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 10 Oct 2006 23:04:38 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@309 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 43 ++++++++++-- polymer/eduke32/source/savegame.c | 2 +- polymer/eduke32/source/sector.c | 111 ++++++++---------------------- polymer/eduke32/source/sounds.c | 7 +- 4 files changed, 74 insertions(+), 89 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 13c30f1b6..ad891b263 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -569,6 +569,9 @@ short shoot(short i,short atwith) { k = spawn(j,projectile[atwith].spawns); sprite[k].z -= (8<<8); + hittype[k].temp_data[6] = hitwall; + hittype[k].temp_data[7] = hitsect; + hittype[k].temp_data[8] = hitspr; } if (projectile[atwith].sound > -1) spritesound(projectile[atwith].sound,j); } @@ -729,6 +732,9 @@ short shoot(short i,short atwith) wh=spawn(k,projectile[atwith].spawns); if (projectile[atwith].sxrepeat > 4) sprite[wh].xrepeat=projectile[atwith].sxrepeat; if (projectile[atwith].syrepeat > 4) sprite[wh].yrepeat=projectile[atwith].syrepeat; + hittype[wh].temp_data[6] = hitwall; + hittype[wh].temp_data[7] = hitsect; + hittype[wh].temp_data[8] = hitspr; } } @@ -750,6 +756,9 @@ short shoot(short i,short atwith) wh=spawn(k,projectile[atwith].spawns); if (projectile[atwith].sxrepeat > 4) sprite[wh].xrepeat=projectile[atwith].sxrepeat; if (projectile[atwith].syrepeat > 4) sprite[wh].yrepeat=projectile[atwith].syrepeat; + hittype[wh].temp_data[6] = hitwall; + hittype[wh].temp_data[7] = hitsect; + hittype[wh].temp_data[8] = hitspr; } } if(p >= 0 && ( @@ -773,6 +782,9 @@ short shoot(short i,short atwith) wh=spawn(k,projectile[atwith].spawns); if (projectile[atwith].sxrepeat > 4) sprite[wh].xrepeat=projectile[atwith].sxrepeat; if (projectile[atwith].syrepeat > 4) sprite[wh].yrepeat=projectile[atwith].syrepeat; + hittype[wh].temp_data[6] = hitwall; + hittype[wh].temp_data[7] = hitsect; + hittype[wh].temp_data[8] = hitspr; } if( isadoorwall(wall[hitwall].picnum) == 1 ) goto DOSKIPBULLETHOLE; @@ -875,6 +887,9 @@ DOSKIPBULLETHOLE: wh=spawn(k,projectile[atwith].spawns); if (projectile[atwith].sxrepeat > 4) sprite[wh].xrepeat=projectile[atwith].sxrepeat; if (projectile[atwith].syrepeat > 4) sprite[wh].yrepeat=projectile[atwith].syrepeat; + hittype[wh].temp_data[6] = hitwall; + hittype[wh].temp_data[7] = hitsect; + hittype[wh].temp_data[8] = hitspr; } } else sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -1094,6 +1109,9 @@ DOSKIPBULLETHOLE: k = spawn(j,SMALLSMOKE); sprite[k].z -= (8<<8); spritesound(KICK_HIT,j); + hittype[k].temp_data[6] = hitwall; + hittype[k].temp_data[7] = hitsect; + hittype[k].temp_data[8] = hitspr; } if ( p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400 ) @@ -1235,7 +1253,10 @@ DOSKIPBULLETHOLE: else checkhitceiling(hitsect); } - spawn(k,SMALLSMOKE); + l = spawn(k,SMALLSMOKE); + hittype[l].temp_data[6] = hitwall; + hittype[l].temp_data[7] = hitsect; + hittype[l].temp_data[8] = hitspr; } if(hitspr >= 0) @@ -1250,7 +1271,13 @@ DOSKIPBULLETHOLE: sprite[l].xrepeat = sprite[l].yrepeat = 24; sprite[l].ang += 64-(TRAND&127); } - else spawn(k,SMALLSMOKE); + else + { + l = spawn(k,SMALLSMOKE); + hittype[l].temp_data[6] = hitwall; + hittype[l].temp_data[7] = hitsect; + hittype[l].temp_data[8] = hitspr; + } if(p >= 0 && ( sprite[hitspr].picnum == DIPSWITCH || @@ -1268,7 +1295,10 @@ DOSKIPBULLETHOLE: } else if( hitwall >= 0 ) { - spawn(k,SMALLSMOKE); + l = spawn(k,SMALLSMOKE); + hittype[l].temp_data[6] = hitwall; + hittype[l].temp_data[7] = hitsect; + hittype[l].temp_data[8] = hitspr; if( isadoorwall(wall[hitwall].picnum) == 1 ) goto SKIPBULLETHOLE; @@ -1351,7 +1381,12 @@ SKIPBULLETHOLE: { checkhitsprite(hitspr,k); if( sprite[hitspr].picnum != APLAYER ) - spawn(k,SMALLSMOKE); + { + l = spawn(k,SMALLSMOKE); + hittype[l].temp_data[6] = hitwall; + hittype[l].temp_data[7] = hitsect; + hittype[l].temp_data[8] = hitspr; + } else sprite[k].xrepeat = sprite[k].yrepeat = 0; } else if( hitwall >= 0 ) diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index e27444bbe..e248cb66f 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -126,7 +126,7 @@ int loadplayer(signed char spot) } if (kdfread(&nump,sizeof(nump),1,fil) != 1) return -1; - if(nump != numplayers) + if(nump != ud.multimode) { kclose(fil); ototalclock = totalclock; diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index b2a6d5838..b25f72eda 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2716,101 +2716,50 @@ CHECKINV1: j = ( (sb_snum&(15<<8))>>8 ) - 1; - if (j == 0) + SetGameVarID(g_iReturnVarID,j,p->i,snum); + + switch(j) { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + case 0: OnEvent(EVENT_WEAPKEY1,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 1) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 1: OnEvent(EVENT_WEAPKEY2,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 2) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 2: OnEvent(EVENT_WEAPKEY3,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 3) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 3: OnEvent(EVENT_WEAPKEY4,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 4) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 4: OnEvent(EVENT_WEAPKEY5,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 5) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 5: OnEvent(EVENT_WEAPKEY6,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 6) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 6: OnEvent(EVENT_WEAPKEY7,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 7) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 7: OnEvent(EVENT_WEAPKEY8,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 8) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 8: OnEvent(EVENT_WEAPKEY9,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 9) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 9: OnEvent(EVENT_WEAPKEY10,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } - - if (j == 10) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); + break; + case 10: OnEvent(EVENT_PREVIOUSWEAPON,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); + break; + case 11: + OnEvent(EVENT_NEXTWEAPON,p->i,snum, -1); + break; } - if (j == 11) - { - SetGameVarID(g_iReturnVarID,j,p->i,snum); - OnEvent(EVENT_NEXTWEAPON,p->i,snum, -1); - if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) - j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); - } + if((unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum) != j) + j = (unsigned long) GetGameVarID(g_iReturnVarID,p->i,snum); if (p->reloading == 1) j = -1; diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index 0e1168781..704f45d27 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -232,8 +232,9 @@ char loadsound(unsigned short num) fp = kopen4load(sounds[num],loadfromgrouponly); if(fp == -1) { - Bsprintf(fta_quotes[113],"Sound %s(#%d) not found.",sounds[num],num); - FTA(113,&ps[myconnectindex]); +// Bsprintf(fta_quotes[113],"Sound %s(#%d) not found.",sounds[num],num); +// FTA(113,&ps[myconnectindex]); + initprintf("Sound %s(#%d) not found.\n",sounds[num],num); return 0; } @@ -329,7 +330,7 @@ int xyzsound(short num,short i,long x,long y,long z) break; } - if (ps[screenpeek].sound_pitch) pitch = ps[screenpeek].sound_pitch; + if (ps[screenpeek].sound_pitch) pitch += ps[screenpeek].sound_pitch; if( Sound[num].num > 0 && PN != MUSICANDSFX ) {