mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 11:26:37 +00:00 
			
		
		
		
	Support region names in cell dialogue filter (Fixes #2113)
This commit is contained in:
		
							parent
							
								
									105f0f8716
								
							
						
					
					
						commit
						4aed5158cc
					
				
					 2 changed files with 5 additions and 13 deletions
				
			
		|  | @ -126,7 +126,7 @@ bool MWDialogue::Filter::testPlayer (const ESM::DialInfo& info) const | ||||||
|     if (!info.mCell.empty()) |     if (!info.mCell.empty()) | ||||||
|     { |     { | ||||||
|         // supports partial matches, just like getPcCell
 |         // supports partial matches, just like getPcCell
 | ||||||
|         const std::string& playerCell = player.getCell()->getCell()->mName; |         const std::string& playerCell = MWBase::Environment::get().getWorld()->getCellName(player.getCell()); | ||||||
|         bool match = playerCell.length()>=info.mCell.length() && |         bool match = playerCell.length()>=info.mCell.length() && | ||||||
|             Misc::StringUtils::ciEqual(playerCell.substr (0, info.mCell.length()), info.mCell); |             Misc::StringUtils::ciEqual(playerCell.substr (0, info.mCell.length()), info.mCell); | ||||||
|         if (!match) |         if (!match) | ||||||
|  | @ -451,7 +451,8 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co | ||||||
| 
 | 
 | ||||||
|         case SelectWrapper::Function_NotCell: |         case SelectWrapper::Function_NotCell: | ||||||
| 
 | 
 | ||||||
|             return !Misc::StringUtils::ciEqual(mActor.getCell()->getCell()->mName, select.getName()); |             return !Misc::StringUtils::ciEqual(MWBase::Environment::get().getWorld()->getCellName(mActor.getCell()) | ||||||
|  |                                                , select.getName()); | ||||||
| 
 | 
 | ||||||
|         case SelectWrapper::Function_NotLocal: |         case SelectWrapper::Function_NotLocal: | ||||||
|         { |         { | ||||||
|  |  | ||||||
|  | @ -117,18 +117,9 @@ namespace MWScript | ||||||
|                         runtime.push(0); |                         runtime.push(0); | ||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|                     const ESM::Cell *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell()->getCell(); |                     const MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell(); | ||||||
| 
 | 
 | ||||||
|                     std::string current = cell->mName; |                     std::string current = MWBase::Environment::get().getWorld()->getCellName(cell); | ||||||
| 
 |  | ||||||
|                     if (!(cell->mData.mFlags & ESM::Cell::Interior) && current.empty() |  | ||||||
|                             && !cell->mRegion.empty()) |  | ||||||
|                     { |  | ||||||
|                         const ESM::Region *region = |  | ||||||
|                             MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().find (cell->mRegion); |  | ||||||
| 
 |  | ||||||
|                         current = region->mName; |  | ||||||
|                     } |  | ||||||
|                     Misc::StringUtils::toLower(current); |                     Misc::StringUtils::toLower(current); | ||||||
| 
 | 
 | ||||||
|                     bool match = current.length()>=name.length() && |                     bool match = current.length()>=name.length() && | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue