Skip to content
Snippets Groups Projects

JS BC

Merged lowercasedonkey requested to merge lowercasedonkey/fc-pregmod:backwards-js into pregmod-master

I'd like to organize BC a bit better going forward, it's always confusing to me where to add new BC material and it's a mishmash. May as well start with it in JS (seems to shave 20% off the time on my save).

Rather usefully this has also exposed two issues, as the JS is more verbal. I think they are original to master and not to my conversion, but I could be wrong. They are both labeled TODO in this mr for the moment.

const pornGenres = App.Porn.getAllGenres();
	pornGenres.foreach((genre) => {
		if (typeof V.pornStars[genre.fameVar] === "undefined") {
			V.pornStars[genre.fameVar] = {p1count: 0, p3ID: 0};
		}
	});

Originally I just ran forEach() on the function, but App.Porn.getAllGenres() does not seem to return an object so this doesn't work either way. It originally used range in SC:

<<for _genre range App.Porn.getAllGenres()>>
	<<if ndef $pornStars[_genre.fameVar]>>
		<<set $pornStars[_genre.fameVar] = { p1count: 0, p3ID: 0 }>>
	<</if>>
<</for>>

I think it was failing, but silently.

<<if $nurseryNannies > 0>>
	<<for _bci = 0; _bci < $cribs.length; _bci++>>
		<<run App.Update.Slave($cribs[_bci])>>
		<<set _nurseryChild = $cribs[_bci]>>
	<</for>>
<</if>>

I have no idea why a temp var is set here, it does nothing and nothing else in the code uses it that I can find.

edit: ahh no, forgot you can't use forEach on objects, only arrays. derp.

Edited by lowercasedonkey

Merge request reports

Approval is optional
Ready to merge by members who can write to the target branch.

Merge details

  • 1 commit and 1 merge commit will be added to pregmod-master.
  • Source branch will be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading