MegaGlest Forum

MegaGlest => Bug reports => Closed bug reports => Topic started by: titi_son on 9 August 2014, 22:39:08

Title: [fixed]Crash with Lua scenario which does not appear in 3.9.1
Post by: titi_son on 9 August 2014, 22:39:08
Commit: e5d2bbbf9e26da22dfc206542a838655810cc2b1 (https://github.com/MegaGlest/megaglest-source/commit/e5d2bbbf9e26da22dfc206542a838655810cc2b1) but i think works with older too.

I get a crash with a scenario i made.
In line 73 i tried to use {SCENARIOPATH} and scenarioDir() (both crashed) for the staticSound and i think there must be the problem. The game somehow cuts of some letters or even lines.
In 3.9.1 the scenario works fine but if i try with git i get:
(click to show/hide)
(click to show/hide)

How to reproduce:
just start this scenario (http://titusgames.de/scenarios/famine_bug.7z) (you need the map "lost river" from mod-center for this)

The download contains the scenario with {SCENARIOPATH}. Change the function dialog to this to get the other crash:
EDIT: Titi tried this too and he only crashes with {SCENARIOPATH}

Code: [Select]
function dialog (dialogname)
if dialogname=="start" then
setCameraPosition(unitPosition(VikingKing))
playStaticSound(scenarioDir()..'/speak.wav')
showMessage("s1","Narrator")
showMessage("s2","Viking")
end
if dialogname=="nofood" then
setCameraPosition(unitPosition(lastCreatedUnit()))
playStaticSound(scenarioDir()..'/worker.wav')
showMessage("w1","Farmer")
showMessage("w2","Viking")
showMessage("w3","Farmer")
showMessage("w4","Viking")
showMessage("w5","Ally")
end
if dialogname=="allyAttacked" then
setCameraPosition({startLocation(ally)[1]-10,startLocation(ally)[2]})
playStaticSound(scenarioDir()..'/speak2.wav')
showMessage("a1","Ally")
showMessage("a2","Viking")
end
if dialogname=="allySurvived" then
setCameraPosition(startLocation(you))
playStaticSound(scenarioDir()..'/speak2.wav')
showMessage("a3","Ally")
showMessage("a4","Viking")
showMessage("a5","Ally")
end
if dialogname=="ownFood" then
setCameraPosition(unitPosition(lastCreatedUnit()))
playStaticSound(scenarioDir()..'/worker.wav')
showMessage("f1","Farmer")
showMessage("f2","Viking")
end
if dialogname=="sowsCanKill" then
setCameraPosition(unitPosition(lastDeadUnit()))
playStaticSound(scenarioDir()..'/speak2.wav')
showMessage("sow1","Ally")
showMessage("sow2","Viking")
showMessage("sow3","Ally")
end
if dialogname=="endGame" then
setCameraPosition(unitPosition(lastDeadUnit()))
playStaticSound(scenarioDir()..'/speak2.wav')
showMessage("end1","Ally")
showMessage("end2","Viking")
showMessage("end3","Ally")
showMessage("end4","Viking")
end
togglePauseGame(1)
end

I am using Ubuntu 12.04.
Title: Re: [e5d2bbb...]Crash with Lua scenario which does not appear in 3.9.1
Post by: titi on 9 August 2014, 23:07:18
git  0f3d6c084f22a586339601a567a211efac94174d crashes too.  ( https://github.com/MegaGlest/megaglest-source/commit/0f3d6c084f22a586339601a567a211efac94174d )
I am trying earlier revisions now.

Update:
I think I found the related changes now the bug must have beenintroduced in either

https://github.com/MegaGlest/megaglest-source/commit/5a48eb0b8aee727bbcd750188e1234aea430f29a
or
https://github.com/MegaGlest/megaglest-source/commit/7cae2b53f1a26ad4fb13e4ede8afba68b25cf261

Those are two revisions which directly follow each other ( both  Commits on Jan 28, 2014  ). Before everything was fine, after those two changes it was broken.
Title: Re: [e5d2bbb...]Crash with Lua scenario which does not appear in 3.9.1
Post by: titi on 23 September 2014, 23:18:43
fixed by softcoder
https://github.com/MegaGlest/megaglest-source/commit/1f5b571c9deadceaa29986b9345bc5741513e583