Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add glitchless mode #1196

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
const&-ify getcolorfromname and getcrewmanfromname
This brings these functions into conforming code style and is a small
performance optimization.
InfoTeddy committed Aug 30, 2024
commit 0edf0016d969800e29a82d41a779dd86e9c91758
4 changes: 2 additions & 2 deletions desktop_version/src/Script.cpp
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ void scriptclass::tokenize( const std::string& t )
}
}

static int getcolorfromname(std::string name)
static int getcolorfromname(const std::string& name)
{
if (name == "player") return CYAN;
else if (name == "cyan") return CYAN;
@@ -149,7 +149,7 @@ static int getcolorfromname(std::string name)
return color; // Last effort to give a valid color, maybe they just input the color?
}

static int getcrewmanfromname(std::string name)
static int getcrewmanfromname(const std::string& name)
{
if (name == "player") return obj.getplayer(); // Return the player
int color = getcolorfromname(name); // Maybe they passed in a crewmate name, or an id?