0

我有小问题。我在编译时收到标题中提到的错误。出现错误的行是 pItemData->GetName(), line。

但即使我改变了顺序,那条线上的任何东西都会给出同样的错误。

当我删除#ifdef 标签时,它们的问题就消失了。但是当我添加这些时,就会出现这个问题。

'void CPythonTextTail::RegisterItemTextTail(DWORD,const char *,CGraphicObjectInstance *,char *)' : 3 arguments cannot be converted from 'const char *' to 'CGraphicObjectInstance *'.

相关文件和定义(.h 文件):

#ifdef ENABLE_WEAPON_EVOLUTION_SYSTEM
void CPythonTextTail::RegisterItemTextTail(DWORD VirtualID, const char* c_szText, 
CGraphicObjectInstance* pOwner, char * evolutionMergeText)
#else
void CPythonTextTail::RegisterItemTextTail(DWORD VirtualID, const char* c_szText, 
CGraphicObjectInstance* pOwner)
#endif

错误行(.cpp 文件)

#ifdef ENABLE_WEAPON_EVOLUTION_SYSTEM
char evolutionMergeText[100]; char evolutionText[6][10] = { "", "Yaygın ", "Seyrek ", "Nadir 
", "Efsane ", "Eşsiz " };
sprintf(evolutionMergeText, "%s%s", evolutionText[evolution], pItemData->GetName());
#endif
rkTextTail.RegisterItemTextTail(
    dwVirtualID,
#ifdef ENABLE_WEAPON_EVOLUTION_SYSTEM
    evolutionMergeText,
#endif
    pItemData->GetName(),
    &pGroundItemInstance->ThingInstance

 );
4

1 回答 1

0

参数顺序错误。evolutionMergeText参数是函数中的最后一个。更改顺序

rkTextTail.RegisterItemTextTail(
    dwVirtualID,
    pItemData->GetName(),
    &pGroundItemInstance->ThingInstance
#ifdef ENABLE_WEAPON_EVOLUTION_SYSTEM
    , evolutionMergeText
#endif
 );
于 2021-08-14T18:14:21.507 回答