Skip to content

Commit

Permalink
reduced hale cost, added internal name code for string manipulating
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Jan 11, 2024
1 parent 9c382c8 commit 1fea87f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion berobot_config_reader.sp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ public void ReadConfig()
float fFloat;
RobotDefinition robot;
robot.name = robotName;
// char modifiedRobotName[NAMELENGTH];

// Copy the original name to the new variable
// CODE FOR internal names
// strcopy(modifiedRobotName, sizeof(robotName),robotName);

// // Define the search string and replacement string

// // Replace spaces with underscores
// ReplaceString(modifiedRobotName, sizeof(modifiedRobotName), " ", "", false);

// // Convert the robot name to lowercase
// MC_StrToLower(modifiedRobotName);
// PrintToChatAll("internal name %s", modifiedRobotName);

if (g_hConfig.GetString("class", sString, sizeof(robot.class)))
{

Expand Down Expand Up @@ -278,7 +293,7 @@ public void ReadConfig()
// Fetch cost
if (g_hConfig.GetFloat("rc_cost"))
{
// fFloat = g_hConfig.GetFloat("rc_cost", fFloat);
fFloat = g_hConfig.GetFloat("rc_cost", fFloat);
if (restrictions.RobotCoins == null)
{
restrictions.RobotCoins = new RobotCoinRestrictionDefinition();
Expand Down Expand Up @@ -464,6 +479,11 @@ MakeRobotFrame(client)
//PrintToChatAll("Mismatch! Expected robot name %s but got %s from config.", robotName, configRobotName);
return;
}

// Create a new variable for the modified name


// Now, configRobotName contains the original name, and modifiedRobotName contains the stripped-down internal name

if (i_hConfig.JumpToKey("remove_weapon_slots"))
{
Expand Down
2 changes: 1 addition & 1 deletion boss_saxtron_h4l3.sp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public OnPluginStart()
restrictions.TeamCoins = new RobotCoinRestrictionDefinition();
restrictions.TeamCoins.Overall = 1;
restrictions.RobotCoins = new RobotCoinRestrictionDefinition();
restrictions.RobotCoins.PerRobot = 4.0;
restrictions.RobotCoins.PerRobot = 3.0;

AddRobot(robot, MakeGiantSoldier, PLUGIN_VERSION, restrictions, 2);

Expand Down

0 comments on commit 1fea87f

Please sign in to comment.