hrbrmstr / pewpew

:star: :star: :star: Build your own IP Attack Maps with SOUND!
https://rud.is/pewpew/
1.01k stars 234 forks source link

China mode breaks #22

Open ramandi opened 7 years ago

ramandi commented 7 years ago

Probably you are aware, but just in case... china_mode breaks after a while because slatlong and cnlatlong have different lengths.

Thank you for your work!

hrbrmstr commented 7 years ago

thx. prbly overhauling this to use WebGL this year.

ramandi commented 7 years ago

Sorry, I'm not sure whether I explained it clearly before. The problem I saw was simply because the arrays slatlong and cnlatlong, created from csv files, have different sizes. You get a random src between 0 and slatlong length. Later, if china_mode is enabled, you try to access src index in cnlatlong. Since samplatlong.csv has 2530 lines, while cnlatlong.csv only has 2519 lines, when src becomes greater than 2519 the indexation fails and the visualization hangs. Obviously, you can avoid the problem simply making cnlatlong.csv's length greater than samplatlong.csv's one. Despite that, maybe src should be randomly obtained between 0 and cnlatlong's length when china_mode is enabled. Not a big problem, but I thought I should note it. If it was clear before, sorry for insisting.