diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 13aa1ad1..557ad909 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -38,12 +38,10 @@ void toggleedit() if(!editmode && !allowedittoggle()) return; // not in most multiplayer modes if(!(editmode = !editmode)) { - settagareas(); // reset triggers to allow quick playtesting entinmap(player1); // find spawn closest to current floating pos } else { - resettagareas(); // clear trigger areas to allow them to be edited player1->health = 100; //put call to clear/restart gamemode projreset(); diff --git a/source/src/entities.cpp b/source/src/entities.cpp index f939f5a6..f9127b14 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -18,20 +18,11 @@ char *entmdlnames[] = "pickups/pistolclips", "pickups/ammobox", "pickups/nades", "pickups/health", "pickups/kevlar", "pickups/akimbo", }; -int triggertime = 0; - void renderent(entity &e, char *mdlname, float z, float yaw, int anim = ANIM_MAPMODEL|ANIM_LOOP, int basetime = 0, float speed = 10.0f) { rendermodel(mdlname, anim, 0, 1.1f, e.x, z+S(e.x, e.y)->floor, e.y, yaw, 0, speed, basetime); } -int triggeranim(entity &e) -{ - int anim = ANIM_TRIGGER; - if(!triggertime) anim |= e.spawned ? ANIM_START : ANIM_END; - return anim; -} - void renderentities() { if(editmode) loopv(ents) @@ -41,7 +32,6 @@ void renderentities() vec v(e.x, e.y, e.z); particle_splash(2, 2, 40, v); } - if(lastmillis>triggertime+1000) triggertime = 0; loopv(ents) { entity &e = ents[i]; @@ -66,30 +56,10 @@ void renderentities() rendermodel(path, ANIM_FLAG|ANIM_LOOP, 0, 4, e.x, f.state==CTFF_INBASE ? (float)S(e.x, e.y)->floor : e.z, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, 120.0f); } } - else + else if(isitem(e.type)) { - if(OUTBORD(e.x, e.y)) continue; - if(e.type!=CARROT) - { - if(!e.spawned) continue; - if(!isitem(e.type)) continue; - renderent(e, entmdlnames[e.type-I_CLIPS], (float)(1+sinf(lastmillis/100.0f+e.x+e.y)/20), lastmillis/10.0f); - } - else switch(e.attr2) - { - case 1: - case 3: - continue; - - case 2: - case 0: - if(!e.spawned) continue; - renderent(e, "carrot", (float)(1+sinf(lastmillis/100.0+e.x+e.y)/20), lastmillis/(e.attr2 ? 1.0f : 10.0f)); - break; - - case 4: renderent(e, "switch2", 3, (float)e.attr3*90, triggeranim(e), triggertime); break; - case 5: renderent(e, "switch1", -0.15f, (float)e.attr3*90, triggeranim(e), triggertime); break; - } + if(OUTBORD(e.x, e.y) || !e.spawned) continue; + renderent(e, entmdlnames[e.type-I_CLIPS], (float)(1+sinf(lastmillis/100.0f+e.x+e.y)/20), lastmillis/10.0f); } } } @@ -189,12 +159,6 @@ void pickup(int n, playerent *d) additem(d, n, d->akimbo, 60, 9); break; - case CARROT: - ents[n].spawned = false; - triggertime = lastmillis; - trigger(ents[n].attr1, ents[n].attr2, false); // needs to go over server for multiplayer - break; - case LADDER: d->onladder = true; break; diff --git a/source/src/protos.h b/source/src/protos.h index 778d2e0a..f73e6e8e 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -149,9 +149,6 @@ extern void remipmore(block &b, int level = 0); extern int closestent(); extern int findentity(int type, int index = 0); extern int findentity(int type, int index, uchar attr2); -extern void trigger(int tag, int type, bool savegame); -extern void resettagareas(); -extern void settagareas(); extern entity *newentity(int x, int y, int z, char *what, int v1, int v2, int v3, int v4); // worldlight diff --git a/source/src/savegamedemo.cpp b/source/src/savegamedemo.cpp index c2d68aa4..3f8fb695 100644 --- a/source/src/savegamedemo.cpp +++ b/source/src/savegamedemo.cpp @@ -107,7 +107,6 @@ void loadgamerest() loopv(ents) { ents[i].spawned = gzgetc(f)!=0; - if(ents[i].type==CARROT && !ents[i].spawned) trigger(ents[i].attr1, ents[i].attr2, true); } restoreserverstate(ents); diff --git a/source/src/world.cpp b/source/src/world.cpp index baf85e55..e66185d7 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -10,56 +10,6 @@ int sfactor, ssize, cubicsize, mipsize; header hdr; -void settag(int tag, int type) // set all cubes with "tag" to space, if tag is 0 then reset ALL tagged cubes according to type -{ - int maxx = 0, maxy = 0, minx = ssize, miny = ssize; - loop(x, ssize) loop(y, ssize) - { - sqr *s = S(x, y); - if(s->tag) - { - if(tag) - { - if(tag==s->tag) s->type = SPACE; - else continue; - } - else - { - s->type = type ? SOLID : SPACE; - } - if(x>maxx) maxx = x; - if(y>maxy) maxy = y; - if(x