错误 C2593:'运算符='含糊不清
当我在 VS 2003 ent 中编译时,我收到这些错误,
C:\SRC\Program\_Interface\FuncTextCmd.cpp(953): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(958): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(963): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(968): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(973): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(978): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(982): error C2593: 'operator =' is ambiguous
这是 FuncTextCmd.cpp 的这一部分,它指的是
BOOL TextCmd_CHANGEGLOW( CScanner& scanner )
{//98
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
scanner.GetToken();
CString strcr = scanner.Token;
CString CHANGEGLOW;
if( 2 <= strcr.GetLength() && strcr.GetLength() <= 7)
{
strcr.MakeLower();
if( strcmp( strcr, "RED" ) == 0 )
{
CHANGEGLOW = 1;//line 953
}
else
if( strcmp( strcr, "BLUE" ) == 0 )
{
CHANGEGLOW = 2;//line 958
}
else
if( strcmp( strcr, "GREEN" ) == 0 )
{
CHANGEGLOW = 3;//line 963
}
else
if( strcmp( strcr, "YELLOW" ) == 0 )
{
CHANGEGLOW = 4;//line 968
}
else
if( strcmp( strcr, "ORANGE" ) == 0 )
{
CHANGEGLOW = 5;//line 973
}
else
if( strcmp( strcr, "PINK" ) == 0 )
{
CHANGEGLOW = 6;//line 978
}
else if( strcmp( strcr, "PURPLE" ) == 0 )
{
CHANGEGLOW = 7;//line 982
}
else
{
strcr += "unknown glow";
pUser->AddText( strcr );
return FALSE;
}
}
else
{
strcr += "unknown glow";
pUser->AddText( strcr );
return FALSE;
}//2
#endif // __WORLDSERVER
return TRUE;
}
这是一个游戏,以 C++ 的方式,
上面的部分是说,如果用户在聊天框中键入所述颜色,则他们身体周围的发光将改变为他们输入的内容,但这只是命令,此功能的主要部分是在我的源代码的 Mover.cpp 中处理的,然后可以在下面看到发光的部分
void CMover::CreateAbilityOption_SetItemSFX( int nAbilityOption )
{
extern DWORD CHANGEGLOW;
DWORD dwSfx = 0;
switch( nAbilityOption )
{
case 3: dwSfx = XI_GEN_ITEM_SETITEM03; break;
case 4: dwSfx = XI_GEN_ITEM_SETITEM04; break;
case 5: dwSfx = XI_GEN_ITEM_SETITEM05; break;
case 6: dwSfx = XI_GEN_ITEM_SETITEM06; break;
case 7: dwSfx = XI_GEN_ITEM_SETITEM07; break;
case 8: dwSfx = XI_GEN_ITEM_SETITEM08; break;
case 9: dwSfx = XI_GEN_ITEM_SETITEM09; break;
case 10: dwSfx = CHANGEGLOW; break;
}
switch( CHANGEGLOW )
{
case 1: dwSfx = RED; break; //make sure that the uppercase RED is what
//you defined in defineobj.h
case 2: dwSfx = BLUE; break; //make sure that the uppercase BLUE is what
// you defined //in defineobj.h
case 3: dwSfx = GREEN; break; //make sure that the uppercase GREEN is what you
//defined in defineobj.h
case 4: dwSfx = YELLOW; break; //make sure that the uppercase YELLOW is what you
//defined in defineobj.h
case 5: dwSfx = ORANGE; break; //make sure that the uppercase ORANGE is what you
//defined in defineobj.h
case 6: dwSfx = PINK; break; //make sure that the uppercase PINK is what you
//defined in defineobj.h
case 7: dwSfx = PURPLE; break; //make sure that the uppercase PURPLE is what you
//defined in defineobj.h
}
//else
//case 10: dwSfx = XI_GEN_ITEM_SETITEM10; break;
CSfxPartsLinkShoulder* pSfx = NULL;
D3DXVECTOR3 v3Scal = D3DXVECTOR3( 1.0f, 1.0f, 1.0f );
if( nAbilityOption == 3 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
/*
else
if( nAbilityOption == 4 )
{
// ¸öÅë
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 6;
pSfx->SetScale(D3DXVECTOR3( 2.2f, 2.2f, 2.2f ));
}
*/
else
if( nAbilityOption == 4 )
{
// ¸öÅë
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 6;
pSfx->SetScale(D3DXVECTOR3( 3.0f, 3.0f, 3.0f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 5 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 6 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 7 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 8 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 9 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¹ß
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 26;
pSfx->SetScale(D3DXVECTOR3( 1.5f, 1.5f, 1.5f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 29;
pSfx->SetScale(D3DXVECTOR3( 1.5f, 1.5f, 1.5f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 10 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¸öÅë
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 6;
pSfx->SetScale(D3DXVECTOR3( 3.0f, 4.5f, 3.0f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 7;
pSfx->SetScale(D3DXVECTOR3( 3.0f, 3.0f, 3.0f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¹ß
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 26;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 29;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
}
#endif //__CLIENT
when i compile in VS 2003 ent i get these errors
C:\SRC\Program\_Interface\FuncTextCmd.cpp(953): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(958): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(963): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(968): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(973): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(978): error C2593: 'operator =' is ambiguous
C:\SRC\Program\_Interface\FuncTextCmd.cpp(982): error C2593: 'operator =' is ambiguous
this is this part of FuncTextCmd.cpp it's referring to
BOOL TextCmd_CHANGEGLOW( CScanner& scanner )
{//98
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
scanner.GetToken();
CString strcr = scanner.Token;
CString CHANGEGLOW;
if( 2 <= strcr.GetLength() && strcr.GetLength() <= 7)
{
strcr.MakeLower();
if( strcmp( strcr, "RED" ) == 0 )
{
CHANGEGLOW = 1;//line 953
}
else
if( strcmp( strcr, "BLUE" ) == 0 )
{
CHANGEGLOW = 2;//line 958
}
else
if( strcmp( strcr, "GREEN" ) == 0 )
{
CHANGEGLOW = 3;//line 963
}
else
if( strcmp( strcr, "YELLOW" ) == 0 )
{
CHANGEGLOW = 4;//line 968
}
else
if( strcmp( strcr, "ORANGE" ) == 0 )
{
CHANGEGLOW = 5;//line 973
}
else
if( strcmp( strcr, "PINK" ) == 0 )
{
CHANGEGLOW = 6;//line 978
}
else if( strcmp( strcr, "PURPLE" ) == 0 )
{
CHANGEGLOW = 7;//line 982
}
else
{
strcr += "unknown glow";
pUser->AddText( strcr );
return FALSE;
}
}
else
{
strcr += "unknown glow";
pUser->AddText( strcr );
return FALSE;
}//2
#endif // __WORLDSERVER
return TRUE;
}
this is for a game by the way it's in c++
the part above is saying if the user types said colors in the chat box then the glow around their body will change to what they typed but this is only the command the main part of this feature is handled in Mover.cpp of my source then part for glow can be seen below
void CMover::CreateAbilityOption_SetItemSFX( int nAbilityOption )
{
extern DWORD CHANGEGLOW;
DWORD dwSfx = 0;
switch( nAbilityOption )
{
case 3: dwSfx = XI_GEN_ITEM_SETITEM03; break;
case 4: dwSfx = XI_GEN_ITEM_SETITEM04; break;
case 5: dwSfx = XI_GEN_ITEM_SETITEM05; break;
case 6: dwSfx = XI_GEN_ITEM_SETITEM06; break;
case 7: dwSfx = XI_GEN_ITEM_SETITEM07; break;
case 8: dwSfx = XI_GEN_ITEM_SETITEM08; break;
case 9: dwSfx = XI_GEN_ITEM_SETITEM09; break;
case 10: dwSfx = CHANGEGLOW; break;
}
switch( CHANGEGLOW )
{
case 1: dwSfx = RED; break; //make sure that the uppercase RED is what
//you defined in defineobj.h
case 2: dwSfx = BLUE; break; //make sure that the uppercase BLUE is what
// you defined //in defineobj.h
case 3: dwSfx = GREEN; break; //make sure that the uppercase GREEN is what you
//defined in defineobj.h
case 4: dwSfx = YELLOW; break; //make sure that the uppercase YELLOW is what you
//defined in defineobj.h
case 5: dwSfx = ORANGE; break; //make sure that the uppercase ORANGE is what you
//defined in defineobj.h
case 6: dwSfx = PINK; break; //make sure that the uppercase PINK is what you
//defined in defineobj.h
case 7: dwSfx = PURPLE; break; //make sure that the uppercase PURPLE is what you
//defined in defineobj.h
}
//else
//case 10: dwSfx = XI_GEN_ITEM_SETITEM10; break;
CSfxPartsLinkShoulder* pSfx = NULL;
D3DXVECTOR3 v3Scal = D3DXVECTOR3( 1.0f, 1.0f, 1.0f );
if( nAbilityOption == 3 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
/*
else
if( nAbilityOption == 4 )
{
// ¸öÅë
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 6;
pSfx->SetScale(D3DXVECTOR3( 2.2f, 2.2f, 2.2f ));
}
*/
else
if( nAbilityOption == 4 )
{
// ¸öÅë
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 6;
pSfx->SetScale(D3DXVECTOR3( 3.0f, 3.0f, 3.0f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 5 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 6 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 7 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 8 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 9 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¹ß
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 26;
pSfx->SetScale(D3DXVECTOR3( 1.5f, 1.5f, 1.5f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 29;
pSfx->SetScale(D3DXVECTOR3( 1.5f, 1.5f, 1.5f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
else
if( nAbilityOption == 10 )
{
// ¾î±ú
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 0;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 1;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¾î±ú, Æȸñ Áß°£
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 4;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 5;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¸öÅë
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 6;
pSfx->SetScale(D3DXVECTOR3( 3.0f, 4.5f, 3.0f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 7;
pSfx->SetScale(D3DXVECTOR3( 3.0f, 3.0f, 3.0f ));
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¼Õ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.1f;
pSfx->m_nOldAbilityOption = nAbilityOption;
// Æȸñ
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 2;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 3;
pSfx->m_nOldAbilityOption = nAbilityOption;
// ¹ß
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 26;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, dwSfx, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 29;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 8;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
pSfx = (CSfxPartsLinkShoulder*)CreateSfx( D3DDEVICE, XI_SETIEM_EFFECTHAND, GetPos(), GetId(), GetPos(), GetId(), -1 );
pSfx->m_nPartsLink = 9;
pSfx->m_v3Offset.y = 0.2f;
pSfx->m_nOldAbilityOption = nAbilityOption;
}
}
#endif //__CLIENT
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在第一个代码片段中,您将
CHANGEGLOW
定义为CString
,然后分配一个数字。毫不奇怪,这不起作用。鉴于您在第二个片段中将其声明为 DWORD,我想这就是您真正想要的。因此,解决方法可能只是将该定义中的CString
更改为DWORD
。实际上,可能是 extern DWORD,因为否则它是函数的局部变量,并且分配它不会产生任何持久效果。实际上我想知道为什么你在本地声明它。由于您无法全局重用标识符,并且必须在全局某个地方定义它,因此是否有任何理由不在文件开头(或者更好的是在某些头文件中)进行全局声明?
In the first code snippet, you defined
CHANGEGLOW
to be aCString
, and then you assign a number. It is no surprise that this doesn't work. Given that in the second snippet you declared it asDWORD
I guess that's what you actually wanted. So the fix probably is to just changeCString
toDWORD
in that definition. Actually, probablyextern DWORD
because otherwise it's a local variable to the function and assigning it won't have any lasting effect.Actually I wonder why you locally declare it anyway. Since you cannot reuse the identifier globally, and have to define it somewhere globally anyway, is there any reason not to have a global declaration at the beginning of the file (or, better, in some header file)?
您正在尝试将数字文字(1、2、3 等)分配给
CString
类型的变量。即使编译成功,对我来说这似乎也是一个坏主意。也许您想要不同的变量类型,例如int
?鉴于您稍后要switch
它的值,无论如何,看起来您想要某种数字类型......You're trying to assign numeric literals (1, 2, 3 etc) to a variable of type
CString
. Even if that compiled, it would seem like a bad idea to me. Perhaps you want a different variable type, e.g.int
? Given that you're later going toswitch
on the value of it, it looks like you want some sort of numeric type, anyway...您在
FuncTextCmd.cpp
中的类型错误。 你就有了应该有的时候
Your type is wrong in
FuncTextCmd.cpp
. You havewhen it should be