About Store Forum Documentation Contact



Post Reply 
Memc to Memp, cannot convert
Author Message
Tottel Offline
Member

Post: #1
Memc to Memp, cannot convert
I'm passing a Memc container to the Game.World.ObjGet method, and it gives me the following error:

Code:
Source\Turret.cpp(189): error C2664: 'EE::Game::WorldManager &EE::Game::WorldManager::objGet(EE::Memp<TYPE>,const EE::Ball &,Int)' : cannot convert parameter 1 from 'EE::Memc<TYPE>' to 'EE::Memp<TYPE>'
1>          with
1>          [
1>              TYPE=EE::Game::Obj *
1>          ]
1>          and
1>          [
1>              TYPE=Enemy *
1>          ]
1>          and
1>          [
1>              TYPE=EE::Game::Obj *
1>          ]
1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

This is the code that it breaks on:
Code:
// Get all the enemies around this turret
   Memc<Enemy*> enemies;
   Game.World.objGet(enemies, Ball(m_FiringRange + m_AimingRange, this->pos()), OBJ_CHR);

If I'm not mistaken, the Memp should be able to handle any container passed to it, which doesn't seem to work like this.
05-25-2013 10:32 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Memc to Memp, cannot convert
Hi, yes but it expects Game::Obj* and not Enemy* TYPE
05-26-2013 12:31 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #3
RE: Memc to Memp, cannot convert
Well, yes, but before this release it worked fine using Memc<Enemy*>

I guess I could just use type Obj* and use the obj_type param.
(This post was last modified: 05-26-2013 05:30 PM by Tottel.)
05-26-2013 05:28 PM
Find all posts by this user Quote this message in a reply
Post Reply