Ignore:
Timestamp:
02/02/19 20:50:07 (5 years ago)
Author:
Maciej Komosinski
Message:

Getting int or float value casted from null or invalid is an ERROR (but still returns 0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/extvalue.cpp

    r845 r851  
    964964                logPrintf("ExtValue", "getInt", LOG_ERROR, "Getting integer value from object reference (%s)", getString().c_str());
    965965                return (paInt)(intptr_t)odata().param;
     966        case TUnknown:
     967        case TInvalid:
     968                logPrintf("ExtValue", "getInt", LOG_ERROR, "Getting integer value from %s", getString().c_str());
     969                return 0;
    966970        default:;
    967971        }
     
    979983                logPrintf("ExtValue", "getDouble", LOG_ERROR, "Getting floating point value from object reference (%s)", getString().c_str());
    980984                return (double)(intptr_t)odata().param;
     985        case TUnknown:
     986        case TInvalid:
     987                logPrintf("ExtValue", "getInt", LOG_ERROR, "Getting floating point value from %s", getString().c_str());
     988                return 0.0;
    981989        default:;
    982990        }
Note: See TracChangeset for help on using the changeset viewer.