User Tools

Site Tools


vodur:removewearflag

Scripts used to check:

do
local pre={}
for _,area in pairs(getarealist()) do
  for _,op in pairs(area.objprotos) do
    clearloopcount()
    pre[op.vnum]={}
    pre[op.vnum].wear=op:wear()
    pre[op.vnum].ex=op:extra()
  end
end
 
savetbl("prewf", pre)
end
 
do
local pre=loadtbl("prewf")
 
for vnum,v in pairs(pre) do
    log("checking "..vnum)
    local op=getobjproto(vnum)
    for _,v in pairs(v.wear) do
        if v=="nosac" then
            if not(op:extra("nosac")) then echo(vnum.." missing nosac") end
        elseif v=="translucent" then
            if not(op:extra("translucent")) then echo(vnum.." missing trans") end
        elseif v=="take" then
            if op.weartype=="nocarry" then echo(vnum.." had take flake but now nocarry") end
        elseif not(v==op.weartype) then
            echo(vnum.." wear flag "..v.." not equal to weartype "..op.weartype)
        end
    end
 
end
 
end
 
do
local pre=loadtbl("prewf")
 
for vnum,v in pairs(pre) do
    log("checking "..vnum)
    local nosac=false
    local trans=false
    local op=getobjproto(vnum)
    for _,v in pairs(v.wear) do
        if v=="nosac" then
            nosac=true
        elseif v=="translucent" then
            trans=true
        elseif v=="take" then
            if op.weartype=="nocarry" then echo(vnum.." had take flake but now nocarry") end
        elseif not(v==op.weartype) then
            echo(vnum.." wear flag "..v.." not equal to weartype "..op.weartype)
        end
    end
 
    for _,v in pairs(v.ex) do
        if not(op:extra(v)) then
            echo(vnum.." missing extra flag: "..v)
        end
    end
 
    for _,v in pairs(op:extra()) do
        if v=="nosac" and not(nosac) then echo(vnum.." has nosac when it shouldn't") end
        if v=="translucent" and not(trans) then echo(vnum.." has trans when it shouldn't") end
    end
end
 
end

Manually checked functionality of:

look
equipment
compare
lore
get
sacrifice
table
grep
ident
oedit
quest list

Used old Sagil and Whisklers pfiles to check WeaF loading and ExtF

vodur/removewearflag.txt · Last modified: 2015/10/23 04:31 by vodur