Fix LSL validation errors in Bot_Manager, Controller_Memory, Player_RegistrationManager, and Floater_Manager

- Bot_Manager.lsl: Fixed 3 variable name conflicts (response, botIdx, botLives)
- Controller_Memory.lsl: Fixed 2 variable name conflicts (usedMemory, memoryPercentage)
- Player_RegistrationManager.lsl: Fixed 1 variable name conflict (i)
- Floater_Manager.lsl: Fixed 1 variable name conflict (i)
- Progress: 115 → 108 total errors (-7)
This commit is contained in:
RebeccaNod1 2025-09-18 12:26:14 -05:00
parent 4b3adf32a2
commit 7e8de1cc01
4 changed files with 18 additions and 18 deletions

View file

@ -126,8 +126,8 @@ doBotPick(string botName, integer count, integer diceMax, list avoidNumbers) {
} else {
llOwnerSay("[Bot Manager] ❌ " + botName + " cannot pick any numbers - all " + (string)diceMax + " numbers are taken!");
// Still send empty response to prevent game hanging
string response = "BOT_PICKED:" + botName + ":";
llMessageLinked(LINK_SET, -9997, response, NULL_KEY);
string emptyResponse = "BOT_PICKED:" + botName + ":";
llMessageLinked(LINK_SET, -9997, emptyResponse, NULL_KEY);
return;
}
}
@ -183,15 +183,15 @@ doBotPick(string botName, integer count, integer diceMax, list avoidNumbers) {
// Helper to respond to peril roll commands
doBotRoll(string botName, integer diceMax) {
// Validate bot exists and is still alive
integer botIdx = llListFindList(names, [botName]);
if (botIdx == -1) {
integer rollBotIdx = llListFindList(names, [botName]);
if (rollBotIdx == -1) {
llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' not found in game - ignoring roll command");
return;
}
integer botLives = llList2Integer(lives, botIdx);
if (botLives <= 0) {
llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' is eliminated (lives=" + (string)botLives + ") - ignoring roll command");
integer rollBotLives = llList2Integer(lives, rollBotIdx);
if (rollBotLives <= 0) {
llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' is eliminated (lives=" + (string)rollBotLives + ") - ignoring roll command");
return;
}

View file

@ -68,16 +68,16 @@ emergencyMemoryCleanup() {
}
reportMemoryStats() {
integer usedMemory = llGetUsedMemory();
float memoryPercentage = (float)usedMemory / 65536.0;
integer statsUsedMemory = llGetUsedMemory();
float statsMemoryPercentage = (float)statsUsedMemory / 65536.0;
llOwnerSay("📊 [Memory Monitor] Memory Monitor Stats:");
llOwnerSay(" Helper Memory Used: " + (string)usedMemory + " bytes (" +
(string)llRound(memoryPercentage * 100.0) + "% of 64KB)");
llOwnerSay(" Helper Memory Used: " + (string)statsUsedMemory + " bytes (" +
(string)llRound(statsMemoryPercentage * 100.0) + "% of 64KB)");
string memoryStatus;
if (memoryPercentage > MEMORY_CRITICAL_THRESHOLD) {
if (statsMemoryPercentage > MEMORY_CRITICAL_THRESHOLD) {
memoryStatus = "CRITICAL";
} else if (memoryPercentage > MEMORY_WARNING_THRESHOLD) {
} else if (statsMemoryPercentage > MEMORY_WARNING_THRESHOLD) {
memoryStatus = "WARNING";
} else {
memoryStatus = "NORMAL";

View file

@ -193,8 +193,8 @@ list getPicksFor(string nameInput) {
// Converts a player's key into their name (if registered)
string getNameFromKey(key id) {
integer i = llListFindList(alivePlayers, [id]);
if (i != -1) return llList2String(aliveNames, i);
integer idx = llListFindList(alivePlayers, [id]);
if (idx != -1) return llList2String(aliveNames, idx);
return (string)id;
}

View file

@ -142,9 +142,9 @@ handlePlayerRegistration(string regData, key requesterId) {
} else {
// Build lives string dynamically
string livesStr = "";
integer i;
for (i = 0; i < llGetListLength(names); i++) {
if (i > 0) livesStr += ",";
integer j;
for (j = 0; j < llGetListLength(names); j++) {
if (j > 0) livesStr += ",";
livesStr += "3"; // Everyone starts with 3 lives
}
syncMessage = livesStr + "~EMPTY~NONE~" + llList2CSV(names);