Fixed an issue where a faction could be joined twice.

This commit is contained in:
Olivier Gagnon
2021-08-15 14:31:38 -04:00
parent 41871de26c
commit 056f0213dd
8 changed files with 12 additions and 11 deletions
+1
View File
@@ -46,6 +46,7 @@ export function inviteToFaction(faction) {
}
export function joinFaction(faction) {
if(faction.isMember) return;
faction.isMember = true;
Player.factions.push(faction.name);
const factionInfo = faction.getInfo();
+1 -1
View File
@@ -100,7 +100,7 @@ export function WireCuttingGame(props: IMinigameProps): React.ReactElement {
return (<Grid container spacing={3}>
<GameTimer millis={timer} onExpire={props.onFailure} />
<Grid item xs={12}>
<h1 className={"noselect"}>Cut the wires with the following properties!</h1>
<h1 className={"noselect"}>Cut the wires with the following properties! (keyboard 1 to 9)</h1>
{questions.map((question, i) => <h3 key={i}>{question.toString()}</h3>)}
<pre>{(new Array(wires.length)).fill(0).map((_, i) => <span key={i}>&nbsp;{i+1}&nbsp;&nbsp;&nbsp;&nbsp;</span>)}</pre>
{(new Array(8)).fill(0).map((_, i) => <div key={i}>
+1 -1
View File
@@ -65,7 +65,7 @@ export class LocationCity extends React.Component<IProps, any> {
elems.push(<pre key={i}>{lineElems(lines[i])}</pre>)
}
return elems;
return <div className="noselect">{elems}</div>;
}
listCity(): React.ReactNode {
+1 -1
View File
@@ -158,7 +158,7 @@ export class GenericLocation extends React.Component<IProps, any> {
return (
<div>
<StdButton onClick={this.props.returnToCity} style={this.btnStyle} text={"Return to World"} />
<h1>
<h1 className="noselect">
{backdoorInstalled && !Settings.DisableTextEffects
? <CorruptableText content={this.props.loc.name}/>
: this.props.loc.name
+2 -2
View File
@@ -74,7 +74,7 @@ export class LocationRoot extends React.Component<IProps, IState> {
}
return (
<div>
<div className="noselect">
<h2>{this.state.city}</h2>
<LocationCity city={city} enterLocation={this.enterLocation} />
</div>
@@ -120,7 +120,7 @@ export class LocationRoot extends React.Component<IProps, IState> {
p.loseMoney(cost);
p.travel(to);
dialogBoxCreate(`You are now in ${to}!`);
dialogBoxCreate(<span className="noselect">You are now in {to}!</span>);
// Dynamically update main menu
if (p.firstTimeTraveled === false) {
+1 -1
View File
@@ -44,7 +44,7 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
}
return (
<div>
<div className="noselect">
<p>
From here, you can travel to any other city! A ticket
costs {Money(CONSTANTS.TravelCost)}.