MantisBT - Zandronum
View Issue Details
0002039Zandronum[All Projects] Suggestionpublic2014-12-29 21:222015-01-10 17:09
Monsterovich 
 
normalfeaturesometimes
newopen 
 
 
0002039: LMS CVar improvements
What my patch does:
- Removed lms_allow@WEAPONNAMEFROMDOOM2@ (because it doesn't work with custom weapons and cannot disallow them)
- Replaced integer cvar lms_allowedweapons with string that contains names of allowed weapons (default is:"Chainsaw,Fist,Pistol,Shotgun,SuperShotgun,Chaingun,RocketLauncher,PlasmaRifle")
if it's empty then all weapons are disallowed
- Added new cvar lms_onlyallowedweapons that controls lms_allowedweapons (false - all weapons are allowed, true - only weapons from the list are allowed)
Also, I removed other liminations:
- Added sv_lmsstarthealth (default is 200)
- Added sv_lmsstartinventory (default is: "GreenArmor,PowerStrength" in doom or "SilverArmor" in heretic)
No tags attached.
diff lms.diff (11,159) 2014-12-29 21:22
/tracker/file_download.php?file_id=1354&type=bug
diff lms2.diff (11,771) 2015-01-10 16:39
/tracker/file_download.php?file_id=1372&type=bug
diff lms2fix.diff (11,307) 2015-01-10 16:42
/tracker/file_download.php?file_id=1373&type=bug
diff lms3.diff (9,556) 2015-01-10 17:09
/tracker/file_download.php?file_id=1374&type=bug
Issue History
2014-12-29 21:22MonsterovichNew Issue
2014-12-29 21:22MonsterovichFile Added: lms.diff
2014-12-29 21:50DuskNote Added: 0011135
2014-12-29 21:52DuskNote Edited: 0011135bug_revision_view_page.php?bugnote_id=11135#r6203
2015-01-10 16:39MonsterovichFile Added: lms2.diff
2015-01-10 16:42MonsterovichFile Added: lms2fix.diff
2015-01-10 17:01Edward-sanNote Added: 0011358
2015-01-10 17:09MonsterovichFile Added: lms3.diff
2015-01-10 17:09MonsterovichNote Added: 0011359

Notes
(0011135)
Dusk   
2014-12-29 21:50   
(edited on: 2014-12-29 21:52)
I like the premise of the patch for the most part, though..

char *weapon = strtok((char*)FString(lmsallowedweapons).GetChars(), ",");


First you cast lmsallowedweapons to FString via constructor, then to const char* via GetChars(), then to char* via a C-style const cast?! And then you proceed to pass this to strtok which mutates its value..?

Using FString::IndexOf should produce a much cleaner version here. At least you should copy the value of lmsallowedweapons to a temporary buffer to make strtok safer to use.

(0011358)
Edward-san   
2015-01-10 17:01   
When you're making a new diff, please use unified diff ( '-u' option ).
(0011359)
Monsterovich   
2015-01-10 17:09   
Ahh, sorry. Fixed.