diff --git a/libs/picomodel/lwo/lwob.c b/libs/picomodel/lwo/lwob.c index d59b8f07..d9786a86 100644 --- a/libs/picomodel/lwo/lwob.c +++ b/libs/picomodel/lwo/lwob.c @@ -384,16 +384,17 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){ case ID_TFLG: flags = getU2( fp ); + //only one of the three axis bits should be set if ( flags & 1 ) { - i = 0; + tex->axis = 0; } - if ( flags & 2 ) { - i = 1; + else if ( flags & 2 ) { + tex->axis = 1; } - if ( flags & 4 ) { - i = 2; + else if ( flags & 4 ) { + tex->axis = 2; } - tex->axis = i; + if ( tex->type == ID_IMAP ) { tex->param.imap.axis = i; }