Sandcastle-Builder icon indicating copy to clipboard operation
Sandcastle-Builder copied to clipboard

Newpix Number used in ONGBase calculations is the wrong one: SBTF is borked, Log names are wrong, etc.

Open Eregrith opened this issue 5 months ago • 0 comments

Because of the refactoring done on the Molpy.ONG separating it into ONGBase and sub-ONGs functions, the order of newpixNumber incrementation and ONG operations has been wrong for 9 years.

Here is the code: https://github.com/eternaldensity/Sandcastle-Builder/blame/4ecf1f261420ef0836264910b90f4a37ebdb300b/castle.js#L3729

I noticed it when Swim Between The Flags did not work properly, giving me a boost to wave castle prod on ONGs reaching odd newpix despite what it should be. The logs names "Notification log for Newpix {...}" are also wrong because of that.

You can try it yourself:

  • Load the game on NP x
  • Check the log name: "Notification log for Newpix x"
  • wait for the ONG
  • New log name is ALSO "Notification log for Newpix x" despite the real newpix number being now x+1

Proposed fix: Put the call to Molpy.ONGBase(); below the lines 'todo' instead:

	var todo=Molpy.ONGs[type];
	if(todo==undefined){todo=Molpy.ONGs[0]}
	todo();
	Molpy.ONGBase();

Disclaimer: I'm not sure when should the second part of the ONGs functions be processed, like these:

	Molpy.Boosts['Controlled Hysteresis'].power=-1;
	Molpy.Boosts['Signpost'].power = 0;
	Molpy.Boosts['Signpost'].Refresh();
	Molpy.Boosts['PG'].Refresh();

Eregrith avatar Sep 21 '24 09:09 Eregrith