About Store Forum Documentation Contact



Post Reply 
After redefinition of virtual function the door has ceased to open
Author Message
Babulesnik Offline
Member

Post: #1
After redefinition of virtual function the door has ceased to open
After redefinition of virtual function the door has ceased to open Door1 [0]. Toggle ();-not work
Code:
Bool Door_Open;
...
STRUCT(Door , Game::Door)
//{
    virtual void open();
};

Game::ObjMemx<Game::Static> Statics_login;
Game::ObjMemx<Door> Door1;
Game::ObjMemx<Game::Animatable> Zasov;


void Door::open()
{
    if(_state==STATE_OPENED)Door_Open=true;
}
...
Bool Update_Login()
{
...
    
        if(Ms.bp(0))
       {
           Door1[0].toggle();
       }
...
}
06-19-2011 02:48 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: After redefinition of virtual function the door has ceased to open
Code:
void Door::open()
{
    __super::open();
    if(_state==STATE_OPENED)Door_Open=true;
}
06-19-2011 08:19 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #3
RE: After redefinition of virtual function the door has ceased to open
(06-19-2011 08:19 PM)Driklyn Wrote:  
Code:
void Door::open()
{
    __super::open();
    if(_state==STATE_OPENED)Door_Open=true;
}
Thanks, but does not work. If using a standard class
Game::ObjMemx<Game::Door> Door1; - works
06-19-2011 09:55 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #4
RE: After redefinition of virtual function the door has ceased to open
Who knows where I ask to help made a mistake
06-21-2011 03:04 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #5
RE: After redefinition of virtual function the door has ceased to open
You should put the Bool inside of the Door class, make it be false by default (if you don't, it might be true initially instead of false), then override toggle() instead of open() and call __super::toggle(), then toggle the Bool.

This works. Just tested it.

----------
The code I posted earlier also works, but is less efficient than what I just posted.
(This post was last modified: 06-21-2011 07:39 PM by Driklyn.)
06-21-2011 07:38 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #6
RE: After redefinition of virtual function the door has ceased to open
(06-21-2011 07:38 PM)Driklyn Wrote:  You should put the Bool inside of the Door class, make it be false by default (if you don't, it might be true initially instead of false), then override toggle() instead of open() and call __super::toggle(), then toggle the Bool.

This works. Just tested it.

----------
The code I posted earlier also works, but is less efficient than what I just posted.

Thank you very much! it workslol
06-22-2011 08:47 PM
Find all posts by this user Quote this message in a reply
Post Reply