mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Fix improper assignement of spawn point in placeAt for non-actors (Bug #3417)
This commit is contained in:
		
							parent
							
								
									ab2089bbf3
								
							
						
					
					
						commit
						3645b3357e
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		|  | @ -1326,10 +1326,11 @@ namespace MWWorld | |||
| 
 | ||||
|         int fallbackDirections[4] = {direction, (direction+3)%4, (direction+2)%4, (direction+1)%4}; | ||||
| 
 | ||||
|         osg::Vec3f spawnPoint = pos; | ||||
| 
 | ||||
|         for (int i=0; i<4; ++i) | ||||
|         { | ||||
|             direction = fallbackDirections[i]; | ||||
|             osg::Vec3f spawnPoint = pos; | ||||
|             if (direction == 0) spawnPoint = pos + (orientation * osg::Vec3f(0,1,0)) * distance; | ||||
|             else if(direction == 1) spawnPoint = pos - (orientation * osg::Vec3f(0,1,0)) * distance; | ||||
|             else if(direction == 2) spawnPoint = pos - (orientation * osg::Vec3f(1,0,0)) * distance; | ||||
|  | @ -1345,12 +1346,12 @@ namespace MWWorld | |||
|                                                                pos.x(), pos.y(), pos.z() + 20)) | ||||
|             { | ||||
|                 // safe
 | ||||
|                 ipos.pos[0] = spawnPoint.x(); | ||||
|                 ipos.pos[1] = spawnPoint.y(); | ||||
|                 ipos.pos[2] = spawnPoint.z(); | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
|         ipos.pos[0] = spawnPoint.x(); | ||||
|         ipos.pos[1] = spawnPoint.y(); | ||||
|         ipos.pos[2] = spawnPoint.z(); | ||||
| 
 | ||||
|         if (!referenceObject.getClass().isActor()) | ||||
|         { | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue