作者laechan (小太保)
看板mud_sanc
标题[wizs] debug.log
时间Mon Nov 9 12:08:26 2009
执行时段错误: *Bad argument 1 to all_inventory()
Expected: object Got: 0.
程式: u/l/laechan/special/mob/fingerwind1.c:76
物件: 0
/d/blade/shuttindie "start_effect2" d/blade/shuttindie.c:151
/std/user#26729 "shut" std/user/attack.c:130
/adm/daemons/shut_d "shut_tar" adm/daemons/shut_d.c:295
/adm/obj/simul_efun "show" adm/simul_efun/show.c(adm/obj/simul_efun.c):150
0 "receive_damage" std/mob/attack.c:28
0 "die" u/l/laechan/special/mob/fingerwind1.c:76
已更新部份判断。我之前偷懒将 heart_beat 内的判断式直接
cp 一份到 die 函数才会出现上述问题(怪物都死了自然读取物
件时会读到 0)
执行时段错误: *Bad argument 1 to userp()
Expected: object Got: 0.
程式: d/ppl/highelf/children/mob/elf2.c:42
物件: /d/ppl/highelf/children/mob/elf2#997011
生物名: elf
/d/ppl/highelf/children/mob/elf2#997011 "check_beauty" d/ppl/highelf/children/mob/elf2.c:42
执行时段错误: *Bad argument 2 to foreach
Expected: array Got: 1.
程式: d/ppl/highelf/children/mob/elf2.c:51
物件: /d/ppl/highelf/children/mob/elf2#998936
生物名: elf
/d/ppl/highelf/children/mob/elf2#998936 "check_beauty" d/ppl/highelf/children/mob/elf2.c:51
ob=present("beauty",env);
if(ob && !userp(ob) && living(ob))
{
上面可以改为..
if(ob=present("beauty",env)) // 先判断有无
{
if(!userp(ob) && living(ob))
另外如果 beauty 是特殊 npc 或特殊物品的话,就取特殊的
id,例如 special beauty,这样你就无须判断 userp(ob),
因为玩家的 id 不可能是「special beauty」。
就是可以少一个判断。
执行时段错误: *Bad argument 1 to environment()
Expected: object Got: 1.
程式: adm/daemons/mob_d.c:45
物件: /adm/daemons/mob_d
/d/ppl/highelf/children/mob/elf2#994577 "heart_beat" std/gmonster.c:118
/adm/daemons/mob_d "continue_attack" adm/daemons/mob_d.c:491
/adm/daemons/mob_d "clean_up_attackers" adm/daemons/mob_d.c:45
void init 里头的写法并不好,那是每执行一次就会 check beauty
并做函数内的一些动作,这可能会造成系统负担。
一般针对这样的需求都会建议改采用 heary_beat 的方式,用周期性
的 check 替代频繁的 check。
执行时段错误: *Bad argument 1 to userp()
Expected: object Got: 1.
程式: cmds/std/_holybell.c:71
物件: /cmds/std/_holybell
/std/user#17834 "cmd_hook" std/user.c:294
/cmds/std/_holybell "cmd_holybell" cmds/std/_holybell.c:71
foreach(ob in obs)
{
if(!ob || (ob && !living(ob))) continue;
ob->set_temp("holybell_times",t);
if(userp(ob))
{
if(ob->query_temp("holybell_check")<check)
{
ob->set_temp("holybell_check",check);
if(ob->query_temp("shield2"))
tell_object(ob,HIG"你的护盾受到圣洁铃音的强化, 变得更加坚固了!!\n"NOR);
}
if(ob->query("block_command")>0)
{
if(env=ob->query_current_attacker() && !userp(env)) <= 这里出问题
{
ob->delete("block_command");
ob->delete("block_command_msg");
tell_object(ob,HIM"你的定身状态被圣洁铃音解除了!!\n"NOR);
}
}
}
}
query_current_attacker 函数是定义在 /std/user/attack.c
object query_current_attacker() {
int i;
if(i=sizeof(temp_data["ats"])) // me->query_temp("ats")))
return temp_data["ats"][i-1];
}
它这样确实有可能出现回传值不为物件的情况(就是 0)
我将上面的函数做了一些修改...
object query_current_attacker() {
int i;
mixed atts=temp_data["ats"];
atts-=({0});
i=sizeof(atts);
if(i>0) // me->query_temp("ats")))
return temp_data["ats"][i-1];
}
不过它还是有问题就是了。先暂时这样。
Expected: string or array or object Got: 0.
程式: cmds/std/_go.c:208
物件: /cmds/std/_go
0 "heart_beat" std/monster.c:130
0 "run_away" std/mob/living.c:124
/adm/daemons/mob_d "run_away" adm/daemons/mob_d.c:851
0 "force_me" std/mob/living.c:18
0 "cmd_hook" std/monster.c:34
/cmds/std/_go "cmd_go" cmds/std/_go.c:208
"
Heart beat in /d/ppl/quest/evil/mob/galloper#979431 turned off.
Error in error handler: *Bad argument 1 to call_other()
Expected: string or array or object Got: 0.
这东西跟 mob 的自动行走有关。
set_name(HIG"奔腾鬼马"NOR); <= 这个建议使用不空白全小写无色码的英文
拍谢上面我看错了, 不用修改.
_go.c 的第 208 行如下..
if( (object)me->query_temp("leader")== me)
我已经先修改为如下...
if(me && (object)me->query_temp("leader")== me)
我的推测是怪物阵亡→me 消失→所以上述判断出问题。
剩下的有空再 debug, 吃饭先。
Laechan
--
※ 发信站: 批踢踢实业坊(ptt.cc)
※ 编辑: laechan 来自: 61.225.163.161 (11/09 15:10)
1F:→ HighElf :fix 11/09 16:35