Final tweak for light sources

This commit is contained in:
Uleat 2015-02-27 19:28:28 -05:00
parent 2b8bdb9158
commit 8dfa0a7220
5 changed files with 14 additions and 41 deletions

View File

@ -1019,15 +1019,8 @@ uint8 Inventory::FindBrightestLightType()
auto item = inst->GetItem();
if (item == nullptr) { continue; }
switch (item->Light) {
case lightTypeCandle:
case lightTypeTorch:
case lightTypeSmallLantern:
case lightTypeLargeLantern:
continue;
default:
break;
}
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (LightProfile_Struct::TypeToLevel(item->Light))
general_light_type = item->Light;

View File

@ -477,17 +477,18 @@ struct LightProfile_Struct
/*
Current criteria (light types):
Equipment: { 0 .. 15 }
General: { 0 .. 15 } =/= { 1, 2, 4, 6 }
General: { 9 .. 13 }
Notes:
- Initial character load and item movement updates use different light source update behaviors
-- Server procedure matches the item movement behavior since most updates occur post-character load
- MainAmmo is not considered when determining light sources
- No 'Sub' or 'Aug' items are recognized as light sources
- Extinguishable light types { Candle, Torch, SmallLantern, LargeLantern } are not considered for general (carried) light sources
- Client calls '__debugbreak' for type values > 127
- Light types '< 9' and '> 13' are not considered for general (carried) light sources
- If values > 0x0F are valid, then assignment limiters will need to be removed
- MainCursor 'appears' to be a valid light source update slot..but, have not experienced updates during debug sessions
- "Fire Beetle Eyes" are still causing issues in general slots (no item movement sound effect)
- Wearable equipment types still register as valid light sources when in general slots (needs exemption criteria)
- All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item)
-- The timer-based update cancels out the invalid light source
*/
static uint8 TypeToLevel(uint8 lightType);

View File

@ -1441,15 +1441,8 @@ void Corpse::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
switch (item->Light) {
case lightTypeCandle:
case lightTypeTorch:
case lightTypeSmallLantern:
case lightTypeLargeLantern:
continue;
default:
break;
}
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (m_Light.TypeToLevel(item->Light))
general_light_type = item->Light;

View File

@ -5054,15 +5054,8 @@ void Merc::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
switch (item->Light) {
case lightTypeCandle:
case lightTypeTorch:
case lightTypeSmallLantern:
case lightTypeLargeLantern:
continue;
default:
break;
}
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (m_Light.TypeToLevel(item->Light))
general_light_type = item->Light;

View File

@ -737,15 +737,8 @@ void NPC::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
switch (item->Light) {
case lightTypeCandle:
case lightTypeTorch:
case lightTypeSmallLantern:
case lightTypeLargeLantern:
continue;
default:
break;
}
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (m_Light.TypeToLevel(item->Light))
general_light_type = item->Light;