mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-09 09:07:47 +02:00
API: Update error message of ns.singularity.joinFaction (#2700)
This commit is contained in:
@@ -779,6 +779,11 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
const facName = getEnumHelper("FactionName").nsGetMember(ctx, _facName);
|
||||
|
||||
if (Player.factions.includes(facName)) {
|
||||
helpers.log(ctx, () => `You are already a member of faction '${facName}'`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Player.factionInvitations.includes(facName)) {
|
||||
helpers.log(ctx, () => `You have not been invited by faction '${facName}'`);
|
||||
return false;
|
||||
|
||||
+3
-1
@@ -2362,8 +2362,10 @@ export interface Singularity {
|
||||
*
|
||||
* This function will automatically accept an invitation from a faction and join it.
|
||||
*
|
||||
* Note that this function returns false if you are already a member of the specified faction.
|
||||
*
|
||||
* @param faction - Name of faction to join.
|
||||
* @returns True if player joined the faction, and false otherwise.
|
||||
* @returns True if the player successfully accepts an invitation, and false otherwise.
|
||||
*/
|
||||
joinFaction(faction: FactionName): boolean;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user