summaryrefslogtreecommitdiff
path: root/src/engine/worldio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/worldio.cpp')
-rw-r--r--src/engine/worldio.cpp60
1 files changed, 14 insertions, 46 deletions
diff --git a/src/engine/worldio.cpp b/src/engine/worldio.cpp
index 4d5e178..4e309a8 100644
--- a/src/engine/worldio.cpp
+++ b/src/engine/worldio.cpp
@@ -70,22 +70,12 @@ bool loadents(const char *fname, vector<entity> &ents, uint *crc)
string gametype;
copystring(gametype, "fps");
- bool samegame = true;
int eif = 0;
- {
- int len = f->getchar();
- f->read(gametype, len+1);
- }
- if(strcmp(gametype, game::gameident()))
- {
- samegame = false;
- conoutf(CON_WARN, "WARNING: loading map from %s game, ignoring entities except for lights/mapmodels", gametype);
- }
- {
- eif = f->getlil<ushort>();
- int extrasize = f->getlil<ushort>();
- f->seek(extrasize, SEEK_CUR);
- }
+ int len = f->getchar();
+ f->read(gametype, len+1);
+ eif = f->getlil<ushort>();
+ int extrasize = f->getlil<ushort>();
+ f->seek(extrasize, SEEK_CUR);
ushort nummru = f->getlil<ushort>();
f->seek(nummru*sizeof(ushort), SEEK_CUR);
@@ -803,24 +793,14 @@ bool load_world(const char *mname, const char *cname) // still supports all map
string gametype;
copystring(gametype, "fps");
- bool samegame = true;
int eif = 0;
- {
- int len = f->getchar();
- f->read(gametype, len+1);
- }
- if(strcmp(gametype, game::gameident())!=0)
- {
- samegame = false;
- conoutf(CON_WARN, "WARNING: loading map from %s game, ignoring entities except for lights/mapmodels", gametype);
- }
- {
- eif = f->getlil<ushort>();
- int extrasize = f->getlil<ushort>();
- vector<char> extras;
- f->read(extras.pad(extrasize), extrasize);
- if(samegame) game::readgamedata(extras);
- }
+ int len = f->getchar();
+ f->read(gametype, len+1);
+ eif = f->getlil<ushort>();
+ int extrasize = f->getlil<ushort>();
+ vector<char> extras;
+ f->read(extras.pad(extrasize), extrasize);
+ game::readgamedata(extras);
texmru.shrink(0);
ushort nummru = f->getlil<ushort>();
@@ -838,19 +818,7 @@ bool load_world(const char *mname, const char *cname) // still supports all map
f->read(&e, sizeof(entity));
lilswap(&e.o.x, 3);
lilswap(&e.attr1, 5);
- if(samegame)
- {
- if(einfosize > 0) f->read(ebuf, einfosize);
- }
- else
- {
- if(eif > 0) f->seek(eif, SEEK_CUR);
- if(e.type>=ET_GAMESPECIFIC)
- {
- entities::deleteentity(ents.pop());
- continue;
- }
- }
+ if(einfosize > 0) f->read(ebuf, einfosize);
if(!insideworld(e.o))
{
if(e.type != ET_LIGHT && e.type != ET_SPOTLIGHT)
@@ -864,7 +832,7 @@ bool load_world(const char *mname, const char *cname) // still supports all map
if(hdr.numents > MAXENTS)
{
conoutf(CON_WARN, "warning: map has %d entities", hdr.numents);
- f->seek((hdr.numents-MAXENTS)*(samegame ? sizeof(entity) + einfosize : eif), SEEK_CUR);
+ f->seek((hdr.numents-MAXENTS)*(sizeof(entity) + einfosize), SEEK_CUR);
}
renderprogress(0, "loading slots...");