作者laechan (打死不投马冏,李系咩安抓)
看板mud_sanc
标题Re: [wizs]问题请教(十四)
时间Thu Jul 19 00:56:15 2007
※ 引述《amosdeus (幽素)》之铭言:
: #include "../virtue.h"
: inherit ROOM;
: void create()
: {
: ::create();
: seteuid(getuid(this_object()));
: set("light",1);
: set("short","test");
: set("long",@PLAIN
: test
: PLAIN
: );
: }
: int room_check_poison(); // 事先宣告
: void init()
: {
: object ppl;
: if(!userp(ppl)) return ;
: if(query("callouting")) return ;
: set("callouting",1);
: check_poison();
拍谢,这里应该是 room_check_poison();
: return ;
: }
: void room_check_poison()
: {
: object env,ob=this_object();
: mixed usr=all_inventory(env);
: int i;
: foreach(ob in usr)
: {
: if(userp(ob))
: {
: // 看要让玩家怎麽中毒, 写在这里
: }
: else
: i++;
: }
: if(i==sizeof(usr))
: {
: delete("callouting");
: remove_call_out("room_check_poison");
: return ;
: }
: call_out("room_check_poison",看要设几秒写在这里);
: return ;
: }
: > /u/p/plain/wide/virtue/room2/nt01: 编译时段错误:
: /u/p/plain/wide/virtue/room2/nt01.c line 24: Undefined function check_poison before ;
: 编译时段错误:
这行是 check_poison 这个函数未定义的意思。
: /u/p/plain/wide/virtue/room2/nt01.c line 52: Warning: Return type doesn't match prototype ( void vs int ) before the end of line
return type doesn't match 的意思是,比方函数宣告为 int
(事前宣告那一项我宣告成 int),但实际在写函数时却宣告为
void (之後那一整个函数),「没有相符(match)」。
: 载入物件错误.
: Error: *Error in loading object '/u/p/plain/wide/virtue/room2/nt01'
: Errors written to /u/p/plain/log:
: /u/p/plain/wide/virtue/room2/nt01.c line 24: Undefined function check_poison before ;
: /u/p/plain/wide/virtue/room2/nt01.c line 52: Warning: Return type doesn't match prototype ( void vs int ) before the end of line
: 稍微有问题 我测试不出来24要修改哪里?
: 以上
: 谢谢
: Plain@Sanc
再改过应该就可了。
Laechan
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.231.229.57