View Single Post
06-17-20, 10:49 AM   #1
millo666
A Murloc Raider
Join Date: Jun 2020
Posts: 7
Lua logic question

I come from C++ and have coded in that language for a long time. I have a question about a simple if-statement that just won't work.

The variables petGUID and playerGUID exists. The sourceGUID and destGUID are read by CombatLogGetCurrentEventInfo() in a COMBAT_LOG_EVENT_UNFILTERED event. I can't for my life understand how it can write the petGUID when i check it as false?

As i read it the if-statement says that the sourceGUID variable can EITHER be playerGUID or petGUID but the destGUID CANNOT be petGUID or playerGUID. Is there something in lua i have missed? The if-statement still writes destGUID as petGUID. How is that possible?

if (sourceGUID == playerGUID or sourceGUID == petGUID) and (destGUID ~=petGUID and destGUID ~=playerGUID) then
print("sourceGUID "..sourceGUID)
print("destGUID "..destGUID)
end
  Reply With Quote