View Single Post
11-16-12, 01:01 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Compaions API broken ?

Hi,

I am trying to make an addon about companions / pets but I always get an error when I use the function:

Lua Code:
  1. CallCompanion("CRITTER",index);

where index <= GetNumCompanions("CRITTER")

The error is something like in English "You don't have any pets" (in italian is "Non hai un famiglio").

But a simple for loop print the name of all my pets:

Lua Code:
  1. for index=1,GetNumCompanions("CRITTER") do
  2.    local _,name=GetCompanionInfo("CRITTER",index);
  3.    print(name:lower())
  4. end

Also the other summon function

Lua Code:
  1. SummonRandomCritter()

gives to me the same error.

Probably the new pet combat system broken the api.

Am I looking in a wrong place for outdated documentation ? (http://wowprogramming.com and http://www.wowwiki.com/API_CallCompanion)

Should I use an external library like LibPetJournal ?

Or simply I missing something ? :-)

Thanks in advance for any help.
  Reply With Quote