制造时出错,C ++'db.c:2127:错误:预期';'在“ ||”之前令牌'[关闭]

问题描述 投票:0回答:1
if ((mob_index[ZCMD.arg1].virtual < 7999) && (mob_index[ZCMD.arg1].virtual > 7899) ) { do { to_room = number(0, top_of_world); } while( (IS_SET_AR(world[to_room].room_flags,ROOM_PRIVATE)) ||(IS_SET_AR(world[to_room].room_flags,ROOM_GODROOM)) ||(IS_SET_AR(world[to_room].room_flags,ROOM_DEATH)) ||(IS_SET_AR(world[to_room].room_flags,ROOM_NOMOB)) ||(IS_SET_AR(world[to_room].room_flags,ROOM_HOUSE)) ||(IS_SET_AR(world[to_room].room_flags,ROOM_ATRIUM)) ||(world[to_room].sector_type == SECT_CITY) || (zone_table[world[to_room].zone].number == 36) ) || (zone_table[world[to_room].zone].number == 198) ) || (zone_table[world[to_room].zone].number == 100) ) || (zone_table[world[to_room].zone].number == 187) ) || (zone_table[world[to_room].zone].number == 145) ) || (zone_table[world[to_room].zone].number == 70) ) || (zone_table[world[to_room].zone].number == 163) );
我运行的是基于C ++的MUD或Text RPG,我试图在代码中添加一些内容。尝试运行时,出现以下错误:

db.c:2127: error: expected ';' before '||' token make[3]: *** [db.o] Error 1 make[3]: Leaving directory `/home/dpreturn/darkpawnsbuild/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/dpreturn/darkpawnsbuild/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/dpreturn/darkpawnsbuild/src' make: *** [all-recursive] Error 1```

c++ makefile mud
1个回答
0
投票
您需要计算括号

|| (zone_table[world[to_room].zone].number == 36) )

应该是

|| (zone_table[world[to_room].zone].number == 36)

等等
© www.soinside.com 2019 - 2024. All rights reserved.