Skip to content
Snippets Groups Projects
Commit d8c36d9d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Remove unnecessary current user (co-sysop) level/flag checks

As Andre pointed out, these checks perform no function because a user with a level lower than the user being edited cannot enter the related command-key anyway.

This was just effectively dead code that was held-over from ancient SBBS days, seemingly before I learned to effectively use the || operator:
if(!(atoi(str)>useron.level && console&CON_R_INPUT))

:-)

Fixes issue #361
parent e201f3cb
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2845 passed
......@@ -246,9 +246,6 @@ void sbbs_t::useredit(int usernumber)
menu("exempt");
continue;
}
if(user.level>useron.level
&& !(useron.exempt&FLAG(c)) && console&CON_R_INPUT)
continue;
user.exempt^=FLAG(c);
putuserrec(&cfg,user.number,U_EXEMPT,8,ultoa(user.exempt,tmp,16));
}
......@@ -284,25 +281,6 @@ void sbbs_t::useredit(int usernumber)
i=c&0xf;
continue;
}
if(user.level>useron.level && console&CON_R_INPUT)
switch(i) {
case 1:
if(!(useron.flags1&FLAG(c)))
continue;
break;
case 2:
if(!(useron.flags2&FLAG(c)))
continue;
break;
case 3:
if(!(useron.flags3&FLAG(c)))
continue;
break;
case 4:
if(!(useron.flags4&FLAG(c)))
continue;
break;
}
switch(i) {
case 1:
user.flags1^=FLAG(c);
......@@ -407,8 +385,7 @@ void sbbs_t::useredit(int usernumber)
bputs(text[UeditML]);
ultoa(user.level,str,10);
if(getstr(str,2,K_NUMBER|K_LINE))
if(!(atoi(str)>useron.level && console&CON_R_INPUT))
putuserrec(&cfg,user.number,U_LEVEL,2,str);
putuserrec(&cfg,user.number,U_LEVEL,2,str);
break;
case 'N':
bputs(text[UeditNote]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment