Index: simfab.cc =================================================================== --- simfab.cc (revision 2357) +++ simfab.cc (working copy) @@ -172,6 +172,14 @@ total_input = total_output = 0; status = nothing; + const rauch_besch_t *rada = besch->get_rauch(); + if(rada) { + smoke_off = rada->get_pos_off(); + } + else { + smoke_off = koord(0,0); + } + // create producer information for(int i=0; i < fabesch->get_lieferanten(); i++) { const fabrik_lieferant_besch_t *lieferant = fabesch->get_lieferant(i); @@ -239,6 +247,26 @@ ; } } + + // smoke position + const rauch_besch_t *rada = besch->get_rauch(); + if(rada) { + smoke_off = rada->get_pos_off(); + koord size = besch->get_haus()->get_groesse() + koord(-1,-1); + // rotate smoke-offset if 4 layouts are defined + if (besch->get_haus()->get_all_layouts()==4) { + switch(rotate) { + case 0: break; + case 1: smoke_off = koord(smoke_off.y, size.x-smoke_off.x); break; + case 2: smoke_off = koord(size.x-smoke_off.x, size.y-smoke_off.y); break; + case 3: smoke_off = koord(size.y-smoke_off.y, smoke_off.x); break; + default: break; + } + } + } + else { + smoke_off = koord(0,0); + } } else { dbg->error("fabrik_t::baue()", "Bulding description not available!"); @@ -749,8 +777,8 @@ // do smoking? const rauch_besch_t *rada = besch->get_rauch(); if(rada) { - grund_t *gr=welt->lookup_kartenboden(pos.get_2d()+rada->get_pos_off()); - wolke_t *smoke = new wolke_t(welt, pos+rada->get_pos_off(), ((rada->get_xy_off().x+simrand(7)-3)*TILE_STEPS)/16, ((rada->get_xy_off().y+simrand(7)-3)*TILE_STEPS)/16, rada->get_bilder() ); + grund_t *gr=welt->lookup_kartenboden(pos.get_2d()+smoke_off); + wolke_t *smoke = new wolke_t(welt, pos+smoke_off, ((rada->get_xy_off().x+simrand(7)-3)*TILE_STEPS)/16, ((rada->get_xy_off().y+simrand(7)-3)*TILE_STEPS)/16, rada->get_bilder() ); gr->obj_add(smoke); welt->sync_add( smoke ); } @@ -886,8 +914,8 @@ // we produce some real quantity => smoke const rauch_besch_t *rada = besch->get_rauch(); if(rada) { - grund_t *gr=welt->lookup_kartenboden(pos.get_2d()+rada->get_pos_off()); - wolke_t *smoke = new wolke_t(welt, pos+rada->get_pos_off(), ((rada->get_xy_off().x+simrand(7)-3)*TILE_STEPS)/16, ((rada->get_xy_off().y+simrand(7)-3)*TILE_STEPS)/16, rada->get_bilder() ); + grund_t *gr=welt->lookup_kartenboden(pos.get_2d()+smoke_off); + wolke_t *smoke = new wolke_t(welt, pos+smoke_off, ((rada->get_xy_off().x+simrand(7)-3)*TILE_STEPS)/16, ((rada->get_xy_off().y+simrand(7)-3)*TILE_STEPS)/16, rada->get_bilder() ); gr->obj_add(smoke); welt->sync_add( smoke ); } @@ -1419,6 +1447,12 @@ pos.rotate90( y_size ); dbg->warning( "fabrik_t::rotate90()","no tile zero form %s at (%s)", get_name(), pos.get_str() ); } + // smoke position - rotate if 4 layouts are defined + const rauch_besch_t *rada = besch->get_rauch(); + if(rada && (besch->get_haus()->get_all_layouts()==4)) { + smoke_off = koord(besch->get_haus()->get_groesse(rotate).y-1-smoke_off.y, smoke_off.x); + } + rotate = (rotate+1)%besch->get_haus()->get_all_layouts(); for( uint32 i=0; i