ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/books.ext
(Generate patch)

Comparing deliantra/server/ext/books.ext (file contents):
Revision 1.2 by root, Mon Jun 11 21:38:13 2007 UTC vs.
Revision 1.6 by root, Fri May 14 22:56:46 2010 UTC

21 push @{ $books[-1] }, $par; 21 push @{ $books[-1] }, $par;
22 } 22 }
23 } 23 }
24 24
25 @BOOKS = @books; 25 @BOOKS = @books;
26
27 ()
26} 28}
27 29
28cf::sync_job { 30cf::post_init {
29 reload; 31 $_[0] ? cf::async_ext { reload } : reload
30}; 32};
31 33
32sub make_book { 34sub make_book {
33 my ($book, $level) = @_; 35 my ($book, $level) = @_;
34 36
35 return unless @BOOKS; 37 return unless @BOOKS;
36 38
37 my ($title, @body) = @{$BOOKS[rand @BOOKS]}; 39 my ($title, @body) = @{$BOOKS[rand @BOOKS]};
38 40
41 # half-assed attempt to make it a single line text-only title
39 $title = cf::pod::as_text [$title]; 42 $title = cf::pod::as_cfpod [$title];
40 $title =~ s/\n/ /g; 43 $title =~ s/\n/ /g;
41 $title =~ s/ +$//; 44 $title =~ s/ +$//;
45 $title =~ s/B<([^>]*)>/$1/g;
42 46
43 $book->name ($title); 47 $book->name ($title);
44 $book->name_pl ($title); 48 $book->name_pl ($title);
45 $book->title (undef); 49 $book->title (undef);
46 $book->msg (cf::pod::as_text \@body); 50 $book->msg (cf::pod::as_cfpod \@body);
47} 51}
48 52

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines