Kiatra / ChocolateBar

ChocolateBar is a World of Warcraft addons to display plugins in a bar on top or bottom of your screen
https://www.wowace.com/projects/chocolatebar
18 stars 9 forks source link

classic doesn't support vehicles #10

Closed houlia closed 2 years ago

houlia commented 3 years ago

Classic WoW doesn't understand the new vehicle code. version: 3.6.14

Date: 2021-04-12 20:08:07 ID: 1 Error occured in: Global Count: 1 Message: ..\AddOns\ChocolateBar\Jostle.lua line 135: attempt to call global 'UnitInVehicle' (a nil value) Debug: ChocolateBar\Jostle.lua:135: ChocolateBar\Jostle.lua:134 ChocolateBar\Jostle.lua:161: ChocolateBar\Jostle.lua:158 (tail call): ? Locals: (temporary) = nil (temporary) = "Player" (*temporary) = "attempt to call global 'UnitInVehicle' (a nil value)" ChocolateBar =

{ OnEnterWorld = defined @Interface\AddOns\ChocolateBar\Core.lua:251 SetDefaultModuleLibraries = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:367 TempDisAutohide = defined @Interface\AddOns\ChocolateBar\Core.lua:408 GetChocolate = defined @Interface\AddOns\ChocolateBar\Core.lua:424 OnLeaveCombat = defined @Interface\AddOns\ChocolateBar\Core.lua:295 modules =
{ } CancelTimer = defined @Interface\AddOns\Broker_DurabilityInfo\Libs\AceTimer-3.0\AceTimer-3.0.lua:147 IterateEmbeds = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:442 Jostle =
{ } OnDatabaseShutdown = defined @Interface\AddOns\ChocolateBar\Core.lua:161 AnchorBars = defined @Interface\AddOns\ChocolateBar\Core.lua:502 Printf = defined @Interface\AddOns\Atlas\Libs\AceConsole-3.0\AceConsole-3.0.lua:69 SetDefaultModulePrototype = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:409 isClassicWoW = true defaultModuleState = true IsEnabled = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:451 LibDataBroker_DataObjectCreated = defined @Interface\AddOns\ChocolateBar\Core.lua:316 ScheduleTimer = defined @Interface\AddOns\Broker_DurabilityInfo\Libs\AceTimer-3.0\AceTimer-3.0.lua:94 DisableModule = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:350 UpdateDB = defined @Interface\AddOns\ChocolateBar\Core.lua:603 RegisterMessage = defined @Interface\AddOns\Ara_Broker_Guild_Friends\libs\CallbackHandler-1.0.lua:90 UnregisterMessage = defined @Interface\AddOns\Ara_Broker_Guild_Friends\libs\CallbackHandler-1.0.lua:153 SetBars = defined @Interface\AddOns\ChocolateBar\Core.lua:440 AddBarOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1421 OnPetBattleOpen = defined @Interface\AddOns\ChocolateBar\Core.lua:257 OpenOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1400 SetEnabledState = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:424 enabledState = true RegisterEvent = defined @Interface\AddOns\Ara_Broker_Guild_Friends\libs\CallbackHandler-1.0.lua:90 IterateModules = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:437 GetBars = defined @Interface\AddOns\ChocolateBar\Core.lua:436 UpdateJostle = defined @Interface\AddOns\ChocolateBar\Core.lua:219 Bar =
{ } InCombat = false db =
{ } baseName = "ChocolateBar" OnInitialize = defined @Interface\AddOns\ChocolateBar\Core.lua:86 UnregisterAllEvents = defined @Interface\AddOns\Ara_Broker_Guild_Friends\libs\CallbackHandler-1.0.lua:174 AddBar = defined @Interface\AddOns\ChocolateBar\Core.lua:477 UpdateBarOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1791 RemoveBar = defined @Interface\AddOns\ChocolateBar\Options.lua:1774 GetModule = defined @Interface\AddOns\BCT\Libs\AceAddon-3.0\AceAddon-3.0.lua:210 RegisterOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1380 AddCustomPluginOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1765 AddDefaultModuleOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1739 defaultModuleLibraries =
{ } TimeLeft = defined @Interface\AddOns\Broker_DurabilityInfo\Libs\AceTimer-3.0\AceTimer-3.0.lua:172 OnEnterCombat = defined @Interface\AddOns\ChocolateBar\Core.lua:279 UnregisterChatCommand = defined @Interface\AddOns\Atlas\Libs\AceConsole-3.0\AceConsole-3.0.lua:111 RemovePluginOptions = defined @Interface\AddOns\ChocolateBar\Options.lua:1531 ScheduleRepeatingTimer = <func AddOns: Swatter, v8.2.6377 (SwimmingSeadragon) AraBrokerGuildFriends, vr91 Atlas, vv1.47.03.11304.00 AtlasClassicWoW, vv1.47.02.11304.00 AtlasLootClassic, vv1.5.9 AtlasLootClassicData, vv1.5.9 AtlasLootClassicDungeonsAndRaids, vv1.5.9 AucAdvanced, v8.2.6430 (SwimmingSeadragon) AucFilterBasic, v8.2.6364 (SwimmingSeadragon) AucStatHistogram, v8.2.6366 (SwimmingSeadragon) AucStatiLevel, v8.2.6370 (SwimmingSeadragon) AucStatPurchased, v8.2.6367 (SwimmingSeadragon) AucStatSimple, v8.2.6399 (SwimmingSeadragon) AucStatStdDev, v8.2.6369 (SwimmingSeadragon) AucUtilFixAH, v8.2.6371 (SwimmingSeadragon) Auctionator, v100.0.9 BagBrother, v Bagnon, v9.0.6 BCT, v1.37 BeanCounter, v8.2.6434 (SwimmingSeadragon) BigWigs, vv22-classic BootyBayGazette, v6.2.20210412 BrokerDurabilityInfo, vv1.29 BrokerMoneyFu, v80205-2 BrokerPortals, v1.10.4 ChocolateBar, vv3.6.14 ClassicCastbars, vv1.3.21 ClassicCastbarsOptions, vv1.3.21 Clique, vv90005-2.0.2 CommunityDKP, v3.2.3 CoordsTracking, vv2.16.11305.00 Details, v DetailsTinyThreat, v Dominos, v9.0.27 DominosCast, v DominosProgress, v DominosRoll, v Enchantrix, v8.2.6428 (SwimmingSeadragon) EnchantrixBarker, v8.2.6469 (SwimmingSeadragon) ExRT, v4520 ExtendedCharacterStats, v2.7.3 FishingBuddy, v0.7.3 Beta 7 GlobalIgnoreList, v1.13.5 Grid2, v1.1.20 Grid2LDB, v1.1.20 Grid2RaidDebuffs, v1.1.20 GTFO, v4.60 InFlightLoad, v1.13.005 Informant, v8.2.6374 (SwimmingSeadragon) ItemRack, v LeatrixPlus, v1.13.100 NauticusClassic, v1.3.1 NovaInstanceTracker, v1.15 NovaWorldBuffs, v1.91 PostalClassic, vv3.6.2 Prat30, v3.9.1 Prat30Libraries, v Questie, v6.2.5 RareAware, v1.0 Regen, v0.1.4 Restocker, v6.2 ShadowedUnitFrames, vv4.2.3-Classic SkilletClassic, v1.21 StealYourCarbon, v Stubby, v8.2.6376 (SwimmingSeadragon) ThreatClassic2, v2.29 TinyTooltip, v8.2.1 TradeSkillWhisperLookup, v0.2.6-beta WaterDispenser, v1.10 WeakAuras, v3.2.3 WeakAurasCompanion, v1.1.1 WIM, v3.9.0 zzInfoclock, v BlizRuntimeLib_enUS v1.13.6.11306 (ck=83b)

godsyn commented 3 years ago

While I'm sure this can be done more eloquently, this will fix the error: ~Line 139 of Jostle.lua:

local function LockMainMenuBar()
    if not ChocolateBar.isClassicWoW then
        if not InCombatLockdown() and not UnitInVehicle("Player") then
            MainMenuBar:SetMovable(true)
            MainMenuBar:SetUserPlaced(true)
            ChocolateBar:Debug("LockMainMenuBar")
            MainMenuBar:SetMovable(false)
        end
    end
    if ChocolateBar.isClassicWoW then
        if not InCombatLockdown() then
            MainMenuBar:SetMovable(true)
            MainMenuBar:SetUserPlaced(true)
            ChocolateBar:Debug("LockMainMenuBar")
            MainMenuBar:SetMovable(false)
        end
    end
end