[0.69.420-PUBLIC#1814] totalVaginas() in creature.js doesn't take type argument

Status
Not open for further replies.

one_two

Well-Known Member
Jan 20, 2022
457
130
totalVaginas() function in creature.as originally could take a type argument which would return number of vaginas matching specified type:

JavaScript:
    public function totalVaginas(type: int = -1): Number {
        return vaginaTotal(type);
    }

this functionality is missing in the ported code in creature.js:

JavaScript:
    totalVaginas()
    {
        return this.vaginaTotal();
    }

this affects few transformatives (cerespirin, goblinola, muffstick) which try to detect whether the PC has orifices of specific type (and in JS port receive answer that yes, they do even when they actually do not), as well as few other places in the code which leverage this functionality.

(by the looks of it, vaginaTotal() in creature.js is capable of taking type argument, so there's no real reason why it can't be passed one now from totalVaginas())
 
Last edited:
  • Like
Reactions: ShadowAcc

one_two

Well-Known Member
Jan 20, 2022
457
130
Looking at creature.js there's been no change so yeah, it's still bugged as of [0.9.000-PUBLIC#1940]
 

OrangeBurner

Well-Known Member
Mar 13, 2022
305
72
Is this still a problem?
I can say that totalVaginas() hasn't been changed yet.

But, they is a function that does check if you have a certain vagina type: hasVaginaType(type = 0)
JavaScript:
hasVaginaType(type = 0) // 0 is Terran.
{
    if (this.vaginas.length <= 0) return false;
    for (let x = 0; x < this.vaginas.length; x++) {
        if (this.vaginas[x].type === type) return true;
    }
    return false;
}

I don't know what the reason was for changing it to this, though.
I'm gonna assume that for the TFs mentioned don't currently use this function either.

Also this function also doesn't tell you how many of those vaginas the character has just if they have them or not.
 
Status
Not open for further replies.