DIRECTOR: LINGO: Fix reference->number conversion

This commit is contained in:
djsrv 2020-06-19 16:48:44 -04:00
parent 3d36728754
commit a3a6988178

View file

@ -714,8 +714,6 @@ int Datum::asInt() {
int res = 0; int res = 0;
switch (type) { switch (type) {
case REFERENCE:
// fallthrough
case STRING: case STRING:
{ {
Common::String src = asString(); Common::String src = asString();
@ -732,6 +730,7 @@ int Datum::asInt() {
// no-op // no-op
break; break;
case INT: case INT:
case REFERENCE:
res = u.i; res = u.i;
break; break;
case FLOAT: case FLOAT:
@ -748,8 +747,6 @@ double Datum::asFloat() {
double res = 0.0; double res = 0.0;
switch (type) { switch (type) {
case REFERENCE:
// fallthrough
case STRING: case STRING:
{ {
Common::String src = asString(); Common::String src = asString();
@ -766,6 +763,7 @@ double Datum::asFloat() {
// no-op // no-op
break; break;
case INT: case INT:
case REFERENCE:
res = (double)u.i; res = (double)u.i;
break; break;
case FLOAT: case FLOAT: