mapsave fixed

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@156 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2006-01-31 21:21:30 +00:00
parent 611b943667
commit 34b8e85b89
4 changed files with 15 additions and 5 deletions
+1
View File
@@ -89,6 +89,7 @@ void spawn_dummy()
dynent *d = newdynent();
players.add(d);
d->o = player1->o;
strcpy(d->team, player1->team);
d->gunselect = player1->gunselect;
d->monsterstate = M_NONE;
strcpy(d->name, "dummy");
+3 -3
View File
@@ -413,10 +413,10 @@ void rotatevec(vec &point, vec &rot)
};
VAR(swayspeeddiv, 1, 125, 1000);
VAR(swaymovediv, 1, 100, 1000);
VAR(swaymovediv, 1, 200, 1000);
VAR(swayupspeeddiv, 1, 125, 1000);
VAR(swayupmovediv, 1, 100, 1000);
VAR(swayupmovediv, 1, 200, 1000);
VAR(x, 0, 0, 1000);
VAR(y, 0, 0, 1000);
@@ -477,7 +477,7 @@ void rendermd3gun()
//conoutf("%i up %i", swayspeed*1000, swayupspeed*1000);
#define g0(x) ((x) < 0.0f ? -(x) : (x))
float plspeed = max(0.1f, min(1.0f, sqrt(g0(player1->vel.x*player1->vel.x) + g0(player1->vel.y*player1->vel.y))));
float plspeed = min(1.0f, sqrt(g0(player1->vel.x*player1->vel.x) + g0(player1->vel.y*player1->vel.y)));
// if(plspeed<0.0f) plspeed = -plspeed;
swayspeed *= plspeed/2;
+10 -1
View File
@@ -216,12 +216,21 @@ entity *newentity(int x, int y, int z, char *what, int v1, int v2, int v3, int v
e.attr1 = (int)player1->yaw;
break;
};
printf("attrs: %i %i %i %i\n", e.attr1, e.attr2, e.attr3, e.attr4);
printf("attrs: %i %i %i %i\n", e.type, e.attr1, e.attr2, e.attr3, e.attr4);
addmsg(1, 10, SV_EDITENT, ents.length(), type, e.x, e.y, e.z, e.attr1, e.attr2, e.attr3, e.attr4);
ents.add(*((entity *)&e)); // unsafe!
if(type==LIGHT) calclight();
return &ents.last();
};
void mdlcheck()
{
loopv(ents)
{
entity &e = ents[i];
printf("%i %i %i %i %i\n", e.type, e.attr1, e.attr2, e.attr3, e.attr4);
}
}; COMMAND(mdlcheck, ARG_NONE);
void clearents(char *name)
{
+1 -1
View File
@@ -135,7 +135,7 @@ void save_world(char *mname)
backup(cgzname, bakname);
gzFile f = gzopen(cgzname, "wb9");
if(!f) { conoutf("could not write map to %s", (int)cgzname); return; };
hdr.version = 5; //MAPVERSION;
hdr.version = MAPVERSION;
hdr.numents = 0;
loopv(ents) if(ents[i].type!=NOTUSED) hdr.numents++;
header tmp = hdr;