graememcc / micropolisJS

A port of Micropolis to JS/HTML5
Other
632 stars 96 forks source link

JS error when loading from saved game #34

Closed wesleytodd closed 2 years ago

wesleytodd commented 2 years ago

When I saved and reloaded the page then clicked "load game" this is in the console. Tried multiple times to re-load. Firefox 96.0.3 on osx. EDIT: just also gave it a go in Chrome, same error.

Uncaught TypeError: A.Position is not a constructor
    ue http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    mapScan http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    init http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    bi http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    ys http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    vn http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    jQuery 8
    dn http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    Pn http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    setTimeout handler*f http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    _verifyImage http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    lA http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    Sn http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    Tn http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    setTimeout handler*lA http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    un http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    setTimeout handler*f http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    _verifyImage http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    lA http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    <anonymous> http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    i http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    <anonymous> http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1
    <anonymous> http://www.graememcc.co.uk/micropolisJS/src/micropolis.js?f750f1ad7f255ea64b6a:1

EDIT: wow, the fact that this landed on the front-page of HN but appears to be inactive for 4 years is amazing. Kudos!

jcuenod commented 2 years ago

I get it when I try to build a police department (and maybe also fire department) even in a new game state and as the very first thing I do.

wesleytodd commented 2 years ago

Likely from here: https://github.com/graememcc/micropolisJS/blob/7d38a4059d0bd4554e604141d52bbe5621c2df1c/src/emergencyServices.js#L22

Maybe it is intended to import this file instead of accessing it off of GameMap?

wesleytodd commented 2 years ago

Wow! Thanks for the quick fix on here. My few minutes of play were fun but the citizens all seem to want police and fire lol.

graememcc commented 2 years ago

There is a lesson here about being cavalier about pushing commits that have been sitting on your hard drive for several years into production in response to an old project appearing on HN...

Apologies all! Will get it live in a few minutes.

graememcc commented 2 years ago

Looks like it's live now: build e2e67df27e36