From c11c0174ece92b4502648ad33653975bfdfc39a0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 5 May 2008 17:45:30 +0000 Subject: lights with entity color, sunlight, network stats --- src/model/map.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/model/map.cc') diff --git a/src/model/map.cc b/src/model/map.cc index 8b70b95..618db79 100644 --- a/src/model/map.cc +++ b/src/model/map.cc @@ -14,6 +14,11 @@ namespace model { +// function to test spawnflags +inline bool spawnflag_isset(unsigned int spawnflags, unsigned int flag) { + return ((spawnflags & flag) == flag); +} + Model * Map::load(std::string const &name) { // open the .map file @@ -49,7 +54,8 @@ Model * Map::load(std::string const &name) continue; } else if (mapfile.got_key_int("spawnflags", u)) { - light->light_strobe = ((u & 1) == 1); + light->light_strobe = spawnflag_isset(u, 1); + light->light_entity = spawnflag_isset(u, 2); } else if (mapfile.got_key_float("light", light->light_radius)) { light->light_radius /= 100.0f; -- cgit v1.2.3