Gwyrdain / apprentices-workshop

Creative Commons Zero v1.0 Universal
5 stars 2 forks source link

Tiren's Rock fails to import #129

Open TokugawaTFC opened 8 years ago

TokugawaTFC commented 8 years ago

I tried to import Tiren's Rock and it failed to import with the below error. I've emailed the file to you so you can debug it. Thanks

NoMethodError in AreasController#import undefined method `[]' for nil:NilClass Extracted source (around line #149):

147 148 149 150 151 152

  m = object.match(/^(\d*)\n(.*)~\n(.*)~\n(.*)~\n~\n/)
  object_info = Hash.new
  object_info["vnum"]     = m[1].to_i
  object_info["keywords"] = m[2].strip
  object_info["sdesc"]    = m[3].strip
  object_info["ldesc"]    = m[4].strip

Rails.root: /app Application Trace | Framework Trace | Full Trace

app/models/_import.rb:149:in block in parse_objects' app/models/_import.rb:146:ineach' app/models/_import.rb:146:in parse_objects' app/models/area.rb:276:inimport' app/controllers/areas_controller.rb:94:in `import'

Request

Parameters:

{"utf8"=>"✓", "authenticity_token"=>"z4pa50bcbxbxbKAcQXRreeIaqWggIViBRQ/kHAmcBYM=", "file"=>#<ActionDispatch::Http::UploadedFile:0x007ff1b0a83190 @tempfile=#<Tempfile:/tmp/RackMultipart20160529-3-u2goli>, @original_filename="tirensrock.are", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"tirensrock.are\"\r\nContent-Type: application/octet-stream\r\n">, "commit"=>"Import"}

Gwyrdain commented 8 years ago

This area contained some object long descriptions of more than one line. These will now parse properly (though the editor is setup for these to be single lines). There was a similar circumstance with MG mobiles having two line long descriptions.

If this is desired from an editor standpoint I can change those ldesc edit boxes to be two line.

Though this issue is resolved some additional issues have arisen as a result of this debugging that will preclude a fully successful import at this time:

Gwyrdain commented 8 years ago

FYI, also:

These were all reviewed and appear to be "correct" behavior. E.g. a two-handed weapon might have had the "T" for two-handed but not the extra flag for two handed. AW Added the extra flag. Same for "A" Animal, "N" No-wear-equipment, and "F" flammable.