C++ problem.

Grab your favourite IDE and tinker with the innards of game engines

C++ problem.

Postby GigaNova on Fri Jun 15, 2012 7:52 pm

Ok, i was restoring the Immolator for my mod, but i got stuck on this piece of code:
Code: Select all
void CWeaponImmolator::UpdateThink( void )
{
   CBaseCombatCharacter *pOwner = GetOwner();

   if( pOwner && !pOwner->IsAlive() )
   {
      StopImmolating();
      return;
   }

   Update();
   SetNextThink( gpGlobals->curtime + 0.05 );
}


I keep getting this error.
Code: Select all
1>------ Build started: Project: Client Episodic, Configuration: Release Win32 ------
2>------ Build started: Project: Server Episodic, Configuration: Release Win32 ------
1>  client_episodic-2005.vcxproj -> J:\HennySource2\src\game\client\.\Release_episodic\client.dll
2>  weapon_immolator.cpp
2>weapon_immolator.cpp(107): error C3867: 'CWeaponImmolator::UpdateThink': function call missing argument list; use '&CWeaponImmolator::UpdateThink' to create a pointer to member
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Changing it to '&CWeaponImmolator::UpdateThink gives me even more errors (AND THE SAME ONE TELLING ME TO CHANGE THE NAME).

Help would be appreciated
GigaNova
Member
Member
 
Joined: Mon Jun 11, 2012 6:32 pm

Re: C++ problem.

Postby fishshapedfish on Sat Jun 16, 2012 1:45 pm

Try commenting out/removing these lines, see if that helps.
Check Out the Team's Latest Mod!
WIP Screenshots
Recruiting/Our Goals
User avatar
fishshapedfish
Regular
Regular
 
Joined: Fri Aug 05, 2011 5:44 pm

Re: C++ problem.

Postby dark0r on Sat Jun 16, 2012 2:48 pm

Paste the whole file
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: C++ problem.

Postby Chris528 on Mon Jun 18, 2012 12:02 am

Your problem lies in where your think function "UpdateThink" is set, not the function itself. If you looked at your output you would see that it says "function call". Just do a search in your file for setthink. It's on line 107 as the output says. It should be changed to setthink( &CWeaponImmolator::UpdateThink );
User avatar
Chris528
Member
Member
 
Joined: Sat Mar 01, 2008 10:21 pm

Re: C++ problem.

Postby GigaNova on Mon Jun 18, 2012 3:08 pm

Ah, thanks guys the last one worked!
GigaNova
Member
Member
 
Joined: Mon Jun 11, 2012 6:32 pm

Return to Programming

Who is online

Users browsing this forum: No registered users