Browse Source

Amulet -> level 26

metaverse
jl777 5 years ago
parent
commit
5fde22c3d8
  1. 2
      src/cc/rogue/rogue.h
  2. 20
      src/utilstrencodings.cpp

2
src/cc/rogue/rogue.h

@ -60,7 +60,7 @@
#define MAXOBJ 9
#define MAXPACK 23
#define MAXTRAPS 10
#define AMULETLEVEL 3 //26
#define AMULETLEVEL 26
#define NUMTHINGS 7 /* number of types of things */
#define MAXPASS 13 /* upper limit on number of passages */
#define NUMLINES 24

20
src/utilstrencodings.cpp

@ -419,10 +419,26 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out)
int mantissa_tzeros = 0;
bool mantissa_sign = false;
bool exponent_sign = false;
int ptr = 0;
int i,n,ptr = 0; char *str = val.c_str();
int end = val.size();
int point_ofs = 0;
n = val.size();
if ( n == 11 && (val[0] < '9' || val[1] < '3') )
{
uint64_t val64 = 0;
for (i=0; i<n; i++)
{
if ( val[i] < '0' || val[i] > '9' )
break;
val64 = (val64 * 10) + (val[i] - '0')
}
if ( i == n ) // 90000000000
{
*amount_out = val64 * COIN;
fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)val64/COIN);
return(true);
}
}
if (ptr < end && val[ptr] == '-') {
mantissa_sign = true;
++ptr;

Loading…
Cancel
Save