From 5b83c6fe685dc82dc35c228fea9014942949ff5d Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Mon, 6 Feb 2017 10:49:22 +0530 Subject: [PATCH] Add spaces to search string programmatically. --- plugins/generated-creature-renamer.cpp | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/plugins/generated-creature-renamer.cpp b/plugins/generated-creature-renamer.cpp index 8f82f0e63..caace087a 100644 --- a/plugins/generated-creature-renamer.cpp +++ b/plugins/generated-creature-renamer.cpp @@ -45,32 +45,32 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) return CR_OK; } -std::vector descriptors = { " blob", " quadruped", " humanoid", " silverfish", " mayfly", " dragonfly", -" damselfly", " stonefly", " earwig", " grasshopper", " cricket", " stick insect", " cockroach", " termite", -" mantis", " louse", " thrips", " aphid", " cicada", " assassin bug", " wasp", " hornet", " tiger beetle", -" ladybug", " weevil", " darkling beetle", " click beetle", " firefly", " scarab beetle", " stag beetle", -" dung beetle", " rhinoceros beetle", " rove beetle", " snakefly", " lacewing", " antlion larva", -" mosquito", " flea", " scorpionfly", " caddisfly", " butterfly", " moth", " caterpillar", " maggot", -" spider", " tarantula", " scorpion", " tick", " mite", " shrimp", " lobster", " crab", " nematode", -" snail", " slug", " earthworm", " leech", " bristleworm", " ribbon worm", " flat worm", " toad", " frog", -" salamander", " newt", " alligator", " crocodile", " lizard", " chameleon", " iguana", " gecko", " skink", -" gila monster", " monitor", " serpent", " viper", " rattlesnake", " cobra", " python", " anaconda", " turtle", -" tortoise", " pterosaur", " dimetrodon", " sauropod", " theropod", " iguanodont", " hadrosaurid", " stegosaurid", -" ceratopsid", " ankylosaurid", " duck", " goose", " swan", " turkey", " grouse", " chicken", " quail", " pheasant", -" gull", " loon", " grebe", " albatross", " petrel", " penguin", " pelican", " stork", " vulture", " flamingo", -" falcon", " kestrel", " condor", " osprey", " buzzard", " eagle", " harrier", " kite", " crane", " dove", -" pigeon", " parrot", " cockatoo", " cuckoo", " nightjar", " swift", " hummingbird", " kingfisher", -" hornbill", " quetzal", " toucan", " woodpecker", " lyrebird", " thornbill", " honeyeater", " oriole", -" fantail", " shrike", " crow", " raven", " magpie", " kinglet", " lark", " swallow", " martin", " bushtit", -" warbler", " thrush", " oxpecker", " starling", " mockingbird", " wren", " nuthatch", " sparrow", " tanager", -" cardinal", " bunting", " finch", " titmouse", " chickadee", " waxwing", " flycatcher", " opossum", " koala", -" wombat", " kangaroo", " sloth", " anteater", " armadillo", " squirrel", " marmot", " beaver", " gopher", -" mouse", " porcupine", " chinchilla", " cavy", " capybara", " rabbit", " hare", " lemur", " loris", " monkey", -" hedgehog", " shrew", " mole", " fruit bat", " wolf", " coyote", " jackal", " raccoon", " coati", -" weasel", " otter", " badger", " skunk", " bear", " panda", " panther", " mongoose", " hyena", " civet", -" walrus", " pangolin", " elephant", " mammoth", " horse", " zebra", " tapir", " rhinoceros", " warthog", -" hippopotamus", " camel", " llama", " giraffe", " deer", " moose", " antelope", " sheep", " goat", -" bison", " buffalo", " bull", " ape", " ant", " bat", " owl", " pig", " bee" }; +std::vector descriptors = { "blob", "quadruped", "humanoid", "silverfish", "mayfly", "dragonfly", +"damselfly", "stonefly", "earwig", "grasshopper", "cricket", "stick insect", "cockroach", "termite", +"mantis", "louse", "thrips", "aphid", "cicada", "assassin bug", "wasp", "hornet", "tiger beetle", +"ladybug", "weevil", "darkling beetle", "click beetle", "firefly", "scarab beetle", "stag beetle", +"dung beetle", "rhinoceros beetle", "rove beetle", "snakefly", "lacewing", "antlion larva", +"mosquito", "flea", "scorpionfly", "caddisfly", "butterfly", "moth", "caterpillar", "maggot", +"spider", "tarantula", "scorpion", "tick", "mite", "shrimp", "lobster", "crab", "nematode", +"snail", "slug", "earthworm", "leech", "bristleworm", "ribbon worm", "flat worm", "toad", "frog", +"salamander", "newt", "alligator", "crocodile", "lizard", "chameleon", "iguana", "gecko", "skink", +"gila monster", "monitor", "serpent", "viper", "rattlesnake", "cobra", "python", "anaconda", "turtle", +"tortoise", "pterosaur", "dimetrodon", "sauropod", "theropod", "iguanodont", "hadrosaurid", "stegosaurid", +"ceratopsid", "ankylosaurid", "duck", "goose", "swan", "turkey", "grouse", "chicken", "quail", "pheasant", +"gull", "loon", "grebe", "albatross", "petrel", "penguin", "pelican", "stork", "vulture", "flamingo", +"falcon", "kestrel", "condor", "osprey", "buzzard", "eagle", "harrier", "kite", "crane", "dove", +"pigeon", "parrot", "cockatoo", "cuckoo", "nightjar", "swift", "hummingbird", "kingfisher", +"hornbill", "quetzal", "toucan", "woodpecker", "lyrebird", "thornbill", "honeyeater", "oriole", +"fantail", "shrike", "crow", "raven", "magpie", "kinglet", "lark", "swallow", "martin", "bushtit", +"warbler", "thrush", "oxpecker", "starling", "mockingbird", "wren", "nuthatch", "sparrow", "tanager", +"cardinal", "bunting", "finch", "titmouse", "chickadee", "waxwing", "flycatcher", "opossum", "koala", +"wombat", "kangaroo", "sloth", "anteater", "armadillo", "squirrel", "marmot", "beaver", "gopher", +"mouse", "porcupine", "chinchilla", "cavy", "capybara", "rabbit", "hare", "lemur", "loris", "monkey", +"hedgehog", "shrew", "mole", "fruit bat", "wolf", "coyote", "jackal", "raccoon", "coati", +"weasel", "otter", "badger", "skunk", "bear", "panda", "panther", "mongoose", "hyena", "civet", +"walrus", "pangolin", "elephant", "mammoth", "horse", "zebra", "tapir", "rhinoceros", "warthog", +"hippopotamus", "camel", "llama", "giraffe", "deer", "moose", "antelope", "sheep", "goat", +"bison", "buffalo", "bull", "ape", "ant", "bat", "owl", "pig", "bee"}; DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) @@ -100,7 +100,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan for (size_t j = 0; j < descriptors.size(); j++) { - size_t pos = creatureRaw->caste[0]->description.find(descriptors[j]); + size_t pos = creatureRaw->caste[0]->description.find(" " + descriptors[j]); if (pos < minPos) { minPos = pos;