Page 1 of 1

Incorrect Spots coordinates generated with Town Sublevels

Posted: Mon Feb 11, 2013 12:15 am
by Hachem_Muche
Using the Town.lua map generator in a sublevel produces incorrect coordinates for spots. The spots coordinates appear to be computed from the sublevel starting coordinates rather than the main level starting coordinates, which can result in incorrectly placed effects.

Re: Incorrect Spots coordinates generated with Town Sublevel

Posted: Thu Feb 14, 2013 1:30 am
by Hachem_Muche
A small typo in the svn update (which also breaks 2 of the pride maps):

Code: Select all

Index: game/engines/default/engine/generator/map/Static.lua
===================================================================
--- game/engines/default/engine/generator/map/Static.lua	(revision 6410)
+++ game/engines/default/engine/generator/map/Static.lua	(working copy)
@@ -302,7 +302,7 @@
 		end
 
 		if not generator.auto_handle_spot_offsets then
-			for spot in ipairs(subspots) do
+			for i, spot in ipairs(subspots) do
 				spot.x = spot.x + data.__import_offset_x
 				spot.y = spot.y + data.__import_offset_y
 			end
Incidentally, this is another bug for which the engine creates no useful error messages.

Re: Incorrect Spots coordinates generated with Town Sublevel

Posted: Thu Feb 14, 2013 9:34 am
by darkgod
Ah oups; never code when tired ;)