Remove test for unconverted characters after a superx= line
Historically, Descent ignored any trailing unconverted characters. The logic in Descent 1 was tightened in3368390f37
, and then the logic in Descent 2 was made to mirror Descent 1 in19699037ce
. Restore the lax parsing logic in both games. Reported-by: InsanityBringer <https://github.com/dxx-rebirth/dxx-rebirth/issues/464> (issue 5) Fixes:3368390f37
("Check for valid SuperX number") (for Descent 1) Fixes:19699037ce
("Move d2x-rebirth/main/bmread.cpp -> similar/main/bmread.cpp") (for Descent 2)
This commit is contained in:
parent
abb000177a
commit
b399794a53
|
@ -568,10 +568,11 @@ int gamedata_read_tbl(d_vclip_array &Vclip, int pc_shareware)
|
|||
SuperX = -1;
|
||||
|
||||
if ( (temp_ptr=strstr( inputline, "superx=" )) ) {
|
||||
char *p;
|
||||
const auto s = strtol(&temp_ptr[7], &p, 10);
|
||||
if (!*p)
|
||||
SuperX = s;
|
||||
/* Historically, this was done with atoi, so the input
|
||||
* source was allowed to have unconvertible characters.
|
||||
* Accept such lines by ignoring any trailing content.
|
||||
*/
|
||||
SuperX = strtol(&temp_ptr[7], nullptr, 10);
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
Assert(SuperX == 254);
|
||||
//the superx color isn't kept around, so the new piggy regeneration
|
||||
|
|
Loading…
Reference in a new issue