- if(lisp.get("contents", contentstring)) {
- if(contentstring == "coin") {
- contents = CONTENT_COIN;
- } else if(contentstring == "firegrow") {
- contents = CONTENT_FIREGROW;
- } else if(contentstring == "icegrow") {
- contents = CONTENT_ICEGROW;
- } else if(contentstring == "star") {
- contents = CONTENT_STAR;
- } else if(contentstring == "1up") {
- contents = CONTENT_1UP;
+ lisp::ListIterator iter(&lisp);
+ while(iter.next()) {
+ const std::string& token = iter.item();
+ if(token == "x") {
+ iter.value()->get(pos.x);
+ } else if(token == "y") {
+ iter.value()->get(pos.y);
+ } else if(token == "contents") {
+ std::string contentstring;
+ iter.value()->get(contentstring);
+ if(contentstring == "coin") {
+ contents = CONTENT_COIN;
+ } else if(contentstring == "firegrow") {
+ contents = CONTENT_FIREGROW;
+ } else if(contentstring == "icegrow") {
+ contents = CONTENT_ICEGROW;
+ } else if(contentstring == "star") {
+ contents = CONTENT_STAR;
+ } else if(contentstring == "1up") {
+ contents = CONTENT_1UP;
+ } else if(contentstring == "custom") {
+ contents = CONTENT_CUSTOM;
+ } else {
+ log_warning << "Invalid box contents '" << contentstring << "'" << std::endl;
+ }