mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 19:26:43 +00:00 
			
		
		
		
	Fixes #1302: Do not attempt to set OnPcAdd before the script has been added
This commit is contained in:
		
							parent
							
								
									5415ca6a63
								
							
						
					
					
						commit
						f99eda1a54
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -231,6 +231,8 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr | |||
|     { | ||||
|         CellStore *cell; | ||||
| 
 | ||||
|         MWBase::Environment::get().getWorld()->getLocalScripts().add(script, item); | ||||
| 
 | ||||
|         if(&(MWWorld::Class::get (player).getContainerStore (player)) == this) | ||||
|         { | ||||
|             cell = 0; // Items in player's inventory have cell set to 0, so their scripts will never be removed
 | ||||
|  | @ -243,7 +245,6 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr | |||
| 
 | ||||
|         item.mCell = cell; | ||||
|         item.mContainerStore = 0; | ||||
|         MWBase::Environment::get().getWorld()->getLocalScripts().add(script, item); | ||||
|     } | ||||
| 
 | ||||
|     return it; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue