From d76817a3616fa8058d29bfcf8d7ef6f8c213bc51 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 29 May 2010 05:03:02 +0000 Subject: [PATCH] Fix a couple of stupid typos and remove some dead code from Mapster32 git-svn-id: https://svn.eduke32.com/eduke32@1656 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 32 ++++++------ polymer/eduke32/source/actors.c | 2 +- polymer/eduke32/source/astub.c | 84 ------------------------------- polymer/eduke32/source/sector.c | 13 +++-- 4 files changed, 26 insertions(+), 105 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 9b33cddf6..183c4f6dd 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -526,6 +526,10 @@ CANCEL: ExtPreCheckKeys(); + nextpage(); + synctics = totalclock-lockclock; + lockclock += synctics; + drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum); #ifdef SUPERBUILD ExtAnalyzeSprites(); @@ -546,9 +550,6 @@ CANCEL: #endif ExtCheckKeys(); - nextpage(); - synctics = totalclock-lockclock; - lockclock += synctics; if (keystatus[1]) { @@ -845,22 +846,23 @@ void editinput(void) if (keystatus[0x43]) // F9 { - mhk=1; - loadmhk(); + if (mhk) + { + Bmemset(spriteext, 0, sizeof(spriteext_t) * MAXSPRITES); + Bmemset(spritesmooth, 0, sizeof(spritesmooth_t) *(MAXSPRITES+MAXUNIQHUDID)); + mhk = 0; + initprintf("Maphacks disabled\n"); + } + else + { + loadmhk(); + mhk = 1; + } + keystatus[0x43] = 0; } - if (keystatus[0x44]) // F10 - { - Bmemset(spriteext, 0, sizeof(spriteext_t) * MAXSPRITES); - Bmemset(spritesmooth, 0, sizeof(spritesmooth_t) *(MAXSPRITES+MAXUNIQHUDID)); - mhk=0; - initprintf("Maphacks disabled\n"); - keystatus[0x44] = 0; - } begindrawing(); //{{{ - if (mhk) - printext256(0,16,whitecol,0,(mhk==1)?"Maphacks ON":"Maphacks ON (not found)",0); enddrawing(); //}}} if (angvel != 0) //ang += angvel * constant diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index bcdb93531..9f99b30c0 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -7669,7 +7669,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 mylight.horiz = SH; mylight.minshade = sprite[i].xoffset; mylight.maxshade = sprite[i].yoffset; - mylight.tilenum = actor[i].picnum; + mylight.tilenum = sprite[i].owner; if (CS & 2) { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index efb5002f9..af3e47fc7 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9059,90 +9059,6 @@ void ExtAnalyzeSprites(void) spritetype *tspr; int32_t frames=0, l; -#ifdef POLYMER - gamelightcount = 0; - - for (i=numsprites-1; i>=0; i--) - { - if (sprite[i].picnum == SECTOREFFECTOR && sprite[i].lotag == 49) - { - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = SECT; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = SX; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = SY; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = SZ; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = SHT; - if ((sprite[i].xvel | sprite[i].yvel | sprite[i].zvel) != 0) - { - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = sprite[i].xvel; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = sprite[i].yvel; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = sprite[i].zvel; - } - else - { - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = hictinting[PL].r; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = hictinting[PL].g; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = hictinting[PL].b; - } - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = 0; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].maxshade = sprite[i].yoffset; - // gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = SS; - - if (CS & 2) - { - if (CS & 512) - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = PR_LIGHT_PRIO_LOW; - else - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = PR_LIGHT_PRIO_HIGH; - } - else - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = PR_LIGHT_PRIO_MAX; - - gamelightcount++; - } - if (sprite[i].picnum == SECTOREFFECTOR && sprite[i].lotag == 50) - { - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = SECT; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = SX; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = SY; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = SZ; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = SHT; - if ((sprite[i].xvel | sprite[i].yvel | sprite[i].zvel) != 0) - { - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = sprite[i].xvel; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = sprite[i].yvel; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = sprite[i].zvel; - } - else - { - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = hictinting[PL].r; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = hictinting[PL].g; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = hictinting[PL].b; - } - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = (256-(SS+128))<<1; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = (int16_t)(gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius * 0.75f); - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].maxshade = sprite[i].yoffset; - - if (CS & 2) - { - if (CS & 512) - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = PR_LIGHT_PRIO_LOW; - else - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = PR_LIGHT_PRIO_HIGH; - } - else - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = PR_LIGHT_PRIO_MAX; - - gamelightcount++; - } - } -#endif - for (i=0,tspr=&tsprite[0]; iwantweaponfire = j; p->kickback_pic = 0; } - if ((int32_t)j != -1 && p->last_pissed_time <= (GAMETICSPERSEC*218) && p->show_empty_weapon == 0 /*&& p->kickback_pic == 0*/ && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0) + if ((int32_t)j != -1 && p->last_pissed_time <= (GAMETICSPERSEC*218) && p->show_empty_weapon == 0 /*&& p->kickback_pic == 0*/ && + p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0) { // if( ( p->weapon_pos == 0 || ( p->holster_weapon && p->weapon_pos == -9 ) )) { @@ -2743,7 +2744,7 @@ CHECKINV1: if (k == -1) k = 9; else if (k == 10) k = 0; - if ((p->gotweapon && (1<ammo_amount[k] > 0) + if ((p->gotweapon & (1<ammo_amount[k] > 0) { if (PLUTOPAK) // JBF 20040116: so we don't select grower with v1.3d if (k == SHRINKER_WEAPON && (p->subweapon&(1<curr_weapon][snum],p->i,snum); Gv_SetVar(g_iWeaponVarID,j, p->i, snum); + aGameVars[g_iReturnVarID].val.lValue = j; + VM_OnEvent(EVENT_SELECTWEAPON,p->i,snum, -1); j = aGameVars[g_iReturnVarID].val.lValue; + if ((int32_t)j != -1 && j <= MAX_WEAPONS) { if (j == HANDBOMB_WEAPON && p->ammo_amount[HANDBOMB_WEAPON] == 0)