Page 1 of 1

Bug Report - Resistances.

Posted: Sun Jul 08, 2018 1:47 am
by Yukiko
A negative resistance causes POL to shut down. Yes. According to OSI things can have a negative resistance. Case in point dragon scales. See this page for details on dragon scales. This itemdesc.cfg entry:

Code: Select all

Item 0x26200
{
	//MainStuff
	Name			redscale
	Desc			red scale%s%
	Graphic			0x26B4
	Color			0x66D
	Weight			2
	MethodScript	scales/methods
	VendorBuysFor	2
	VendorSellsFor	4
    IName			red scale

	// Resistances
	PhysicalResist	1
	FireResist		11
	ColdResist		-3
	PoisonResist	1
	EnergyResist	1

	//Booleans
	Movable			1
}
causes POL to issue this error:

Code: Select all

Error loading itemdesc.cfg Elemental Resistances for :scales:redscale (0x26200) : Error reading die string '-3': Expect
d digit at beginning, got '-'
Server Shutdown: load_itemdesc
Initiating POL Cleanup....

Re: Bug Report - Resistances.

Posted: Sun Jul 08, 2018 9:43 pm
by DevGIB
Would it be as simple as changing the following line:
https://github.com/polserver/polserver/ ... .cpp#L142

From:

Code: Select all

      if ( !isdigit( *str ))
To:

Code: Select all

      if ( !isdigit( *str ) || *str != '-' )