Author: jave27
Date: 2005-11-14 22:22:55 +0100 (Mon, 14 Nov 2005)
New Revision: 2500
Modified:
trunk/src/worldobjs/entrance.cxx
trunk/src/worldobjs/exit.cxx
Log:
Set default owner_id on entrances and exits in case they aren't specified in
the level file. This fixes a lot of unplayable levels in the playable/ folder.
Modified: trunk/src/worldobjs/entrance.cxx
===================================================================
--- trunk/src/worldobjs/entrance.cxx 2005-11-14 18:19:17 UTC (rev 2499)
+++ trunk/src/worldobjs/entrance.cxx 2005-11-14 21:22:55 UTC (rev 2500)
@@ -39,6 +39,9 @@
reader.read_vector("position", pos);
reader.read_int ("release-rate", release_rate);
+ // Set default owner ID to 0
+ if (owner_id < 0 || owner_id > 3) owner_id = 0;
+
std::string direction_str;
reader.read_string("direction", direction_str);
Modified: trunk/src/worldobjs/exit.cxx
===================================================================
--- trunk/src/worldobjs/exit.cxx 2005-11-14 18:19:17 UTC (rev 2499)
+++ trunk/src/worldobjs/exit.cxx 2005-11-14 21:22:55 UTC (rev 2500)
@@ -41,6 +41,9 @@
reader.read_desc ("surface", desc);
reader.read_int ("owner-id", owner_id);
+ // Set default owner ID to 0
+ if (owner_id < 0 || owner_id > 3) owner_id = 0;
+
flag = Resource::load_sprite("core/misc/flag" + CL_String::to(owner_id));
sprite = Resource::load_sprite(desc);
_______________________________________________
pingus-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/pingus-cvs